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

Expose BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN through a flag #19714

Closed
tpudlik opened this issue Oct 3, 2023 · 4 comments
Closed

Expose BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN through a flag #19714

tpudlik opened this issue Oct 3, 2023 · 4 comments

Comments

@tpudlik
Copy link
Contributor

tpudlik commented Oct 3, 2023

Description of the feature request:

To ensure Bazel uses only hermetic, vendored C++ toolchains, and does not attempt to configure a local toolchain, you need to set the environment variable BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN.

This is not very ergonomic: it would be better to expose this option through a flag, so it can be set via .bazelrc alongside other configuration options.

In general, is there some guidance on when Bazel configuration options should be set via flags vs via environment variables?

Which category does this issue belong to?

C++/Objective-C Rules

What underlying problem are you trying to solve with this feature?

No response

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

release 6.3.2

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@benjaminp
Copy link
Collaborator

You can do --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1.

@tpudlik
Copy link
Contributor Author

tpudlik commented Oct 3, 2023

Ah, I didn't know about the --repo_env flag!

But per the documentation, the variables specified by that flag are "available only for repository rules". So I don't think this will actually affect what cc_configure.bzl does.

@benjaminp
Copy link
Collaborator

But per the documentation, the variables specified by that flag are "available only for repository rules". So I don't think this will actually affect what cc_configure.bzl does.

The linked line is inside the cc_autoconf_toolchains repository rule.

@tpudlik
Copy link
Contributor Author

tpudlik commented Oct 3, 2023

D'uh, good point. Thank you for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants