Hey, thank you for helping the whole community, this is a huge improvement and years of waiting saved
I wanted to share that I've discovered an issue with tests, while building my first macros with swift-macro-testing library.
Was having the following issue:
I created sample project (new package -> macros)
Run pre-created sample tests - all working
Switched to swift-macro-testing - tests are not compiling due to Missing required module 'SwiftCompilerPlugin'
Guys from pointfree helped me to understand that this is related to IDEPackageEnablePrebuilts, and after switching it to NO I was able to compile and run tests.
I had this issue with xcode 16.4 as well as xcode 26. And reported it to Apple as FB19179615.
I gave tried it out with Xcode 26 beta 4 and SwiftSyntax "601.0.1", just copying stringify macro example.
The build time changed from 6 to 20 seconds with defaults write com.apple.dt.Xcode IDEPackageEnablePrebuilts YES
Without IDEPackageEnablePrebuilts YES flag build time is 23 seconds.
No matter why the build time differs when IDEPackageEnablePrebuilts is set to yes or no, the overall build time increment is small enough for adopting macro in library development.
Sounds like you didnât get the prebuilt. The build would be much faster otherwise. And the build impact is much much higher in release builds, especially on slower builder VMs.
There is an issue with macros depending on libraries that also depend on swift-syntax. Since we can't immediately tell whether the library is also a dependency for non macro targets, or ones that build for non-host platforms, we fall back to building from source.
It's probably worth raising an Issue for this on SwiftPM to see whether we have enough information in the package graph to determine that. We just need to make sure we don't break anything.
This is great, thank you for this work @dschaefer2 ! What the first supported version that has the prebuilt behavior? I was unsure if your first message listed those versions as the initial test and if all went well binaries would be provided for older versions as well.
Iâm just trying to figure out if Iâll need to update our versions to see this behavior or if all versions of swift-syntax in Xcode 16.4 should automatically see this.
Generally, if prebuilts arenât being used itâs because they havenât been published for the given toolchain builds. Itâs still a manual process to build them for the Xcode betaâs and I donât think thatâs been done for the last couple.
That said, we really should provide a debug message to explain why. Please raise an issue on the swift-package-manager GitHub repo and we can add it to the queue.
On a related note, would it be possible to publish a metamanifest.json file that lists all the currently available prebuilt versions? I'd like to look at writing a tool that can download and install the prebuilt outside of Xcode, just to ensure the cache is preheated locally or in CI.
Weâre having enough trouble with the current per compiler manifest since the three host platforms build at different times and we need to do a complicated merge which recently just had a bug. Iâm actually thinking of changing it so that each prebuilt zip file has its own manifest.
That said, you can assume each released compiler has prebuilts. You can check the generator implementation in SwiftPMâs Source/swift-build-prebuilts/BuildPrebuilts.swift for the naming scheme. That may also change over time, though. For example, I may want to base the Linux ones more closely to the info in the /etc/os-release files on the host.
Did anyone else start running into this today? This was working fine for weeks, and suddenly we get:
cannot load module 'SwiftSyntax' built with SDK 'macosx15.2' when using SDK 'macosx15.5': /tmp/build/SourcePackages/prebuilts/swift-syntax/600.0.1/6.1-MacroSupport-macos_aarch64/Modules/SwiftSyntax.swiftmodule
cannot load module 'SwiftSyntax' built with SDK 'macosx15.2' when using SDK 'macosx15.5': /tmp/build/SourcePackages/prebuilts/swift-syntax/600.0.1/6.1-MacroSupport-macos_aarch64/Modules/SwiftSyntax.swiftmodule
Looks like weâre running into an issue with the minor version update for 6.1.3. Good news, it is fixed in 6.2. But for now, if you run into this, please turn off the experimental flag. Instructions are in the original post on this thread.
This may also be a configuration problem on our end. But for now, if you do see this, you can at least temporarily disable the flag until we conclude our investigation.
Unfortunately, weâve had to pull them. There is a bug in the 6.1 SwiftPM that is exposed in the 6.1.3 prebuilts which essentially locked us into to supporting only one version in 6.1, which was 6.1.2.
In 6.2, we now use the compiler version from âswiftc -print-target-infoâ to make sure we use the prebuilt swift modules appropriate for that compiler version.
Thanks everyone for your help on the 6.1.2 experimental release of this feature. The feedback was invaluable. As you may have seen, that has allowed us to turn it on by default in 6.2 in the beta and snapshot releases.