CMake: fix build for Apple Silicon hosts#34998
Conversation
|
@swift-ci please smoke test |
compnerd
left a comment
There was a problem hiding this comment.
Id want an okay from Michael on this as well; the CMake side of the change is proper, the question is, is there anything that depends on this?
|
Thanks for the PR. There are some other places where
|
|
@varungandhi-apple thanks for highlighting those, updated now. |
|
@swift-ci please smoke test |
|
@MaxDesiatov can this be merged/are you waiting on something specific? |
CMake: fix builds for Apple Silicon hosts When building with `build-script` using these arguments ``` utils/build-script --skip-build-benchmarks --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "arm64" --sccache --release-debuginfo --test ``` the build fails with ``` ninja: error: 'stdlib/swift-test-stdlib-macosx-x86_64', needed by 'stdlib/CMakeFiles/swift-test-stdlib', missing and no known rule to make it ``` I think that the "Getting Started" guide should avoid hardcoding `x86_64` arguments, and suggest using `$(uname -m)` instead. `SWIFT_PRIMARY_VARIANT_ARCH_default` could also get its value from `CMAKE_HOST_SYSTEM_PROCESSOR` in the root `CMakeLists.txt`. Same as upstream swiftlang#34998.
|
@MaxDesiatov @compnerd @varungandhi-apple I independently stumbled across this issue over break. (Too bad this PR wasn't merged then.) My version of a fix is in #35231 . |
|
IMO we should merge this, since it also updates the documentation. We don't need to be blocked on review, we can change things after-the-fact if there's an issue. |
|
@swift-ci please smoke test macOS platform |
When building with
build-scriptusing these argumentsthe build fails with
I think that the "Getting Started" guide should avoid hardcoding
x86_64arguments, and suggest using$(uname -m)instead.SWIFT_PRIMARY_VARIANT_ARCH_defaultcould also get its value fromCMAKE_HOST_SYSTEM_PROCESSORin the rootCMakeLists.txt.Resolves SR-13943.