Whenever I try to run swift test from the command line I get a bunch of errors like
macro expansion @Test:3:111: error: 'Actor' is only available in macOS 10.15 or newer
or
@__swiftmacro_16CustomSignsTests0aB4TestV12testBirthday0D0fMp_.swift:7:132: error: 'isolation()' is only available in macOS 10.15 or newer
I am definitely on a more recent version of macOS. Are there any extra parameters or things I need to do to run the tests?
Additionally, when I try to run the tests manually in Xcode they are skipped due to the .enabled(if: RUNALL)) condition, and I do not recall seeing any instructions as to how to enable them.
Any help with either would be appreciated.
PS - for swift version information:
% swift --version
swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Target: arm64-apple-macosx15.0
I don’t remember seeing that when I started. Thanks for pointing that out!
I found something similar in a web search, including how to add it to the Scheme in Xcode, so I can run the tests in Xcode now. (Albeit I have to manually edit the scheme for each new project.)
Running from the command line is still broken, though.
(or whatever minimum macOS version you’d like to target) to the Package.swift file seems to resolve the issue. Is there some way to get that added to the template that generates the downloads?
I’ve been unsuccessful in reproducing your issue and there is no such issue in CI. Wanted to gather some more details to understand the root cause before adding platforms to all the Package.swift files. It’s simple to add this optional property, but it would introduce a new point of maintenance.
What is your history with Xcode and Swift installation? Is it a fresh install, or have you upgraded over time? If it’s not a fresh install, did you try cleaning the cache using swift package clean or removing Derived Data?
Please share the output of the following commands:
I just tried swift package clean but I still see the same issue.
I installed swiftly using brew .
These are my outputs:
$ swift --version
Apple Swift version 6.2.3 (swift-6.2.3-RELEASE)
Target: arm64-apple-macosx26.0
Build config: +assertions
$ sw_vers
ProductName: macOS
ProductVersion: 26.2
BuildVersion: 25C56
$ xcode-select -p
/Library/Developer/CommandLineTools
Since you mentioned this. I have to admit I was a bit confused with how to setup swift on my machine.
Sure there is the documentation on Installing Swift locally | Exercism's Docs, but I feel like I need a little bit more of what is going under the hood. What is actually happening (compiling, linking) when I just hit swift test .