Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 6.1 can not cross-compile the macro examples from the swift-syntax repository with the latest static linux Musl SDK or Android SDK bundles #1723

Open
finagolfin opened this issue Nov 3, 2024 · 0 comments

Comments

@finagolfin
Copy link
Contributor

I was just testing out cross-compilation of Swift packages that use macros, and it works fine with the latest 6.0 release for the first time:

> cd swift-syntax/Examples
> ~/swift-6.0.2-RELEASE-fedora39/usr/bin/swift sdk install ~/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
Swift SDK bundle at `swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz` is assumed to be an archive, unpacking...
Swift SDK bundle at `swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz` successfully installed as swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.
> ~/swift-6.0.2-RELEASE-fedora39/usr/bin/swift build --swift-sdk aarch64-swift-linux-musl
Building for debugging...
Build complete! (1.04s)

However, if I try the same with the latest trunk 6.1 Musl or Android SDK bundles, it fails:

> ~/swift-6.0.2-RELEASE-fedora39/usr/bin/swift sdk remove swift-6.0.2-RELEASE_static-linux-0.0.1
Swift SDK bundle at path `/home/finagolfin/.swiftpm/swift-sdks/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle` was successfully removed from the file system.
> ~/swift-6.0.2-RELEASE-fedora39/usr/bin/swift package clean
> ~/swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a-ubi9/usr/bin/swift sdk install ~/swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a_static-linux-0.0.1.artifactbundle.tar.gz
Swift SDK bundle at `/home/finagolfin/swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a_static-linux-0.0.1.artifactbundle.tar.gz` is assumed to be an archive, unpacking...
Swift SDK bundle at `/home/finagolfin/swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a_static-linux-0.0.1.artifactbundle.tar.gz` successfully installed as swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a_static-linux-0.0.1.artifactbundle.
> ~/swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a-ubi9/usr/bin/swift build --swift-sdk aarch64-swift-linux-musl                  
Building for debugging...
error: link command failed with exit code 1 (use -v to see invocation)
clang: error: no such file or directory: '/home/finagolfin/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a_static-linux-0.0.1.artifactbundle/swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a_static-linux-0.0.1/swift-linux-musl/musl-1.2.5.sdk/aarch64/usr/lib/swift/linux-static/aarch64/swiftrt.o'

If I pass in -Xswiftc -disallow-use-new-driver, it works again, so clearly a regression in this swift-driver, most likely related to #1667, which I argued against at the time.

@al45tair, can you confirm this regression and advise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant