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

Move check for LLVM toolchain outside of repository_rule #1090

Merged
merged 3 commits into from
Aug 16, 2023

Conversation

gferon
Copy link
Contributor

@gferon gferon commented Aug 16, 2023

Checking CC=clang in the implementation of the repository_rule doesn't work when using --incompatible_enable_cc_toolchain_resolution (for example when using https://github.com/grailbio/bazel-toolchain to bring a hermetic LLVM toolchain).

Moving the check for LLVM the repository_rule to the Swift toolchain impl used by all rules instead solves this issue.

I tested that the check (the failure message) is triggered on Linux with:

  • only gcc installed
  • a LLVM toolchain configured in WORKSPACE but without --incompatible_enable_cc_toolchain_resolution

Fixes #991

Copy link
Member

@keith keith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice thanks! note that with swift it's possible the hermetic llvm toolchain may not work since swift's llvm fork could differ in required ways, but this still seems like a nice fix

@keith keith merged commit df485c2 into bazelbuild:master Aug 16, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

Flag --incompatible_enable_cc_toolchain_resolution will break rules_swift in Bazel 7.0
2 participants