-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix cross-compile build failure. #75970
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
Conversation
In Build-FoundationMacros, use the build Swift SDK for the build case and when cross-compiling, use the swift syntax build from the build arch binary cache as opposed to the host arch binary cache or else the architecture mismatch will happen.
@swift-ci please test |
@@ -1766,6 +1766,12 @@ function Build-FoundationMacros() { | |||
$InstallDir = "$($Arch.ToolchainInstallRoot)\usr" | |||
} | |||
|
|||
$SwiftSyntaxCMakeModules = if ($Build -and $HostArch -ne $BuildArch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not get away with if ($Build)
? We will have the host build for distribution anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because SwiftSyntax
is built part of Build-Compilers
and in a normal (not cross-compiling) build, we only build in the host-arch binary cache (Get-HostProjectCMakeModules Compilers
) and the build-arch binary cache (Get-BuildProjectCMakeModules Compilers
) would be empty. If we just have if ($Build)
, we would look for the SwiftSyntax build artifacts in the empty location. It's true that we build FoundationMacros
twice and both for the build-arch and host-arch binary caches. But this is about its dependency SwiftSyntax
.
Thanks for the fix. Can we also cherry-pick this to release/6.0 branch? |
I'm on it |
@shahmishal Created #75988 for release/6.0 |
This fix is similar to swiftlang#75970 but for `Build-TestingMacros`.
This fix is similar to swiftlang#75970 but for `Build-TestingMacros`.
This fix is similar to swiftlang#75970 but for `Build-TestingMacros`.
In Build-FoundationMacros, use the build Swift SDK for the build case and when cross-compiling, use the swift syntax build from the build arch binary cache as opposed to the host arch binary cache or else the architecture mismatch will happen.
This fixes the CI failure: https://ci-external.swift.org/job/swift-6.0-windows-toolchain-arm64/192/console