Any update to this? Still can’t see anything returned at https://download.swift.org/prebuilts/swift-syntax/602.0.0/swiftlang-6.1.2.1.2-MacroSupport-macos_aarch64.zip.
I'm not entirely sure if this is related, but just in case, I wanted to mention I've started getting error: module compiled with Swift 6.0.3 cannot be imported by the Swift 6.2 compiler error in Github actions.
I'm using Swift 6.2, Swift Syntax 602.0.0, and this is an SPM project.
Update: the error stopped after I’ve added the --disable-experimental-prebuilts flag, so I guess that settles it.
Could you raise a GitHub issue on swift-package-manager with more info and if you can a sample project where this can be reproduced?
As stated previously in this thread, we have removed support for the 6.1 prebuilts. They were only experimental and focus has now switched to 6.2 and beyond.
Umm, considering the issue stopped after I disabled prebuilt SwiftSyntax, I don’t think this is an SPM issue? It looks like a wrong prebuilt binary was chosen.
Prebuilts are SPM feature so it is SPM issue ![]()
I do not have the capacity to prepare a reproduction project right now, hope the report is enough.
Sorry to bump this again, but despite the prebuilt being enabled by default in Xcode 26, ensuring it's downloaded and installed, and double checking my builds, it seems that it no longer prevents swift-syntax from being built from source. This also means it doesn't prevent the swift-syntax double build, where it's always built for ARM64 and Intel. Nor does it seem to speed up incremental builds, where the "Emit Swift module" step seems to be reexpanding all macros with unoptimized versions. With the removal of the Swift 6.1 prebuilt version (I should've archived it) I can't compare to Xcode 16.4 anymore, so it's hard to validate everything is set up right.
running swift test --enable-experimental-prebuilts from the command line, every time i see this line:
Downloading package prebuilt https://download.swift.org/prebuilts/swift-syntax/601.0.1/6.1-MacroSupport-macos_aarch64.zip
Is that expected? Am I holding it wrong? Do I not need to pass the flag every time, just once?
As noted somewhere above, the 6.1 prebuilts have been disabled. The “Downloading” message is SwiftPM trying to download them. You’d get a “Downloaded” message if it was successful and you don’t get anything when it fails. (And, yeah, that could be made more obvious).
Just a sideways observation here… if we are trending in a direction where this thread becomes the de facto place for engineers to go for status updates when prebuilts are not working as expected maybe we can ship some kind of online dashboard or tool or someplace other than this specific thread where any known issues are highlighted with potential workarounds? This might also aggregate issues from the "open source" side along with known Apple issues from the "closed source" side.
I'm just thinking maybe this one thread might not scale very well as we ship more and more versions and more platforms and more toolchains.
That’s a great point. Assume 6.2 forward, swift-syntax prebuilts for macros should just work. If not, please report as issues on the swift-package-manager GitHub page. I’m monitoring all incoming issues there and can respond.
I’ll also announce any changes in new posts. They would probably just get lost in this one.
I’m having this exact issue of trying to run my swift package that relies on swift syntax and getting the exact same warnings and errors as you.
In my case I’m building through Xcode and I can’t seem to find any way to work around this - including disabling prebuilts.
I’ve tried on Xcode 26.0.1 and 26.1 and getting the same issue.
Make sure you Reset Package Caches when you disable prebuilts. We need to re-resolve the package graph to set things back to build from source. Failing that also fully delete your DerivedData for the project or your scratch path (.build) if using SwiftPM.
Thanks @dschaefer2 for the quick reply!
I could have sworn I’d tried these steps many times already but maybe in some other order - either way I’ve just done the below and it now builds for me on Xcode 26.0.1 and Xcode 26.1 (targeting the aligned iOS releases):
defaults write com.apple.dt.Xcode IDEPackageEnablePrebuilts NOon Package root in terminal- Reset Package Caches
- Deleted derived data (and Reset Package Caches directly after)
- Build and run tests
Is there a CI option I can pass along?
I’m currently doing an xcodebuild but it looks like I can’t pass down the flags needed here:
xcodebuild test -scheme MyScheme -destination "platform=iOS Simulator,name=iPhone 17,OS=26.0.1"
Update: think I got tunnel vision from this but ultimately realised I can add steps to disable prebuilts and optionally clear SPM caches in my GitHub actions:
# Disable SwiftPM prebuilts for this runner user
- name: Disable SwiftPM prebuilts in Xcode
run: |
defaults write com.apple.dt.Xcode IDEPackageEnablePrebuilts -bool NO
defaults read com.apple.dt.Xcode IDEPackageEnablePrebuilts
# (Optional) ensure no cached prebuilts are reused
- name: Clear SwiftPM caches
run: |
rm -rf ~/.swiftpm/artifacts ~/.swiftpm/cache
I have been able to just reset the package caches and have that work. Deleting the derived data resets everything.
Today I learned, you can pass the user default on the xcodebuild command line, e.g.
xcodebuild -scheme my-Package -desination "name=My Mac" -IDEPackageEnablePrebuilts=NO
I cannot make it work. In package.swift I have .package(url: "https://github.com/swiftlang/swift-syntax.git", from: "601.0.0-latest") as dependency.
I tried to compile with three methods:
- The command
defaults write com.apple.dt.Xcode IDEPackageEnablePrebuilts YES - the flag
-IDEPackageEnablePrebuilts=YESto xcodebuild - using
swift build -c release --enable-experimental-prebuilts
Also using version 600, 601, 602.
In all cases, it tries to compile swift-syntax, and if I look in the prebuilts directory of the build files, I get the following:
$ cat prebuilts/swift-syntax/601.0.1/6.1-MacroSupport-macos_aarch64.zip
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>Apple</center>
</body>
</html>
I thank you in advance for your answer.
The package.swift:
import PackageDescription
import CompilerPluginSupport
let package = Package(
name: "proj1",
platforms: [.macOS(.v11), .iOS(.v14)],
products: [
.library(
name: "proj1",
targets: ["proj1"]
),
],
dependencies: [
.package(url: "https://github.com/swiftlang/swift-syntax.git", from: "601.0.0-latest"),
],
targets: [
.macro(
name: "proj1Macros",
dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
]
),
.target(name: "proj1", dependencies: ["proj1Macros"]),
]
)
What tools are you using? The Swift 6.1 prebuilts have been removed due to issues with the early implementation. If you want to get a prebuilt you need to update to 6.2.
I did recently notice the prebuilts seem incompatible with using swift-syntax from a registry, which is pretty annoying. SPM / Xcode also can't handle manually specifying it from a repo, it seems conflicts between the repo and registry versions. Makes registries that much less useful.
That’s worth a GitHub Issue. The prebuilts feature keys off the Identity of the package and we currently only consider swift-syntax from its GitHub repo. Mind you, since there’s no standard for the identity in a registry, i.e. what’s the "scope” component, this might be difficult to do.