Skip to content

Fix CMake build to explicitly pick up ar and ranlib from toolchain. #6754

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

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

al45tair
Copy link
Contributor

CMake under various conditions will attempt to use llvm-ar and llvm-ranlib when it spots that we're building using clang, and while that works fine on Linux, it doesn't work so well on Darwin, leaving us with a link failure with a perplexing error message.

The rest of the Swift build is resilient to this problem already, but the bootstrap script here doesn't pass the relevant options to CMake, so it's possible to end up with the build failing when trying to link lib/libCYaml.a after the build has mangled the static library with llvm-ranlib.

rdar://113028933

CMake under various conditions will attempt to use `llvm-ar` and
`llvm-ranlib` when it spots that we're building using `clang`, and
while that works fine on Linux, it doesn't work so well on Darwin,
leaving us with a link failure with a perplexing error message.

The rest of the Swift build is resilient to this problem already,
but the `bootstrap` script here doesn't pass the relevant options
to CMake, so it's possible to end up with the build failing when
trying to link `lib/libCYaml.a` after the build has mangled the
static library with `llvm-ranlib`.

rdar://113028933
@al45tair al45tair added the swift 5.8 This PR targets the 5.8 branch label Jul 28, 2023
@al45tair
Copy link
Contributor Author

This is a cherry pick of #6721

@al45tair
Copy link
Contributor Author

@swift-ci smoke test

@finagolfin
Copy link
Member

Both linux and Windows CI failed with unrelated errors long before building SPM.

@tomerd
Copy link
Contributor

tomerd commented Jul 28, 2023

@swift-ci smoke test linux

@tomerd
Copy link
Contributor

tomerd commented Jul 28, 2023

@swift-ci smoke test windows

@tomerd
Copy link
Contributor

tomerd commented Jul 28, 2023

cc @shahmishal

@finagolfin
Copy link
Member

Something appears to be seriously wrong with the linux CI, it's repeatedly failing on startup itself.

@tomerd
Copy link
Contributor

tomerd commented Jul 28, 2023

@swift-ci smoke test linux

1 similar comment
@tomerd
Copy link
Contributor

tomerd commented Jul 28, 2023

@swift-ci smoke test linux

@tomerd tomerd merged commit bc51350 into swiftlang:release/5.8 Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift 5.8 This PR targets the 5.8 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants