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

Flag --incompatible_enable_cc_toolchain_resolution will break rules_swift in Bazel 7.0 #991

Open
keertk opened this issue Jan 30, 2023 · 1 comment · Fixed by #1090
Open

Comments

@keertk
Copy link
Member

keertk commented Jan 30, 2023

Incompatible flag --incompatible_enable_cc_toolchain_resolution will be enabled by default in the next major release (Bazel 7.0), thus breaking rules_swift. Please migrate to fix this and unblock the flip of this flag.

The flag is documented here: bazelbuild/bazel#7260.

Please check the following CI builds for build and test results:

Never heard of incompatible flags before? We have documentation that explains everything.
If you have any questions, please file an issue in https://github.com/bazelbuild/continuous-integration.

@gferon
Copy link
Contributor

gferon commented Apr 13, 2023

We're already using --incompatible_enable_cc_toolchain_resolution to use an hermetic LLVM tooclchain (using https://github.com/grailbio/bazel-toolchain) and the CC=clang check prevents us to run rules_swift. Without this check, everything works fine and as expected, so maybe we could simply remove the check? I can't think of a way to check if the flag is set or not.

keith pushed a commit that referenced this issue 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 `rule`s 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
@keith keith reopened this Aug 16, 2023
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 a pull request may close this issue.

3 participants