Open aherrmann opened 3 years ago
This sounds reasonable.
I believe the solution requires:
--default_override
build flag.--config
.So basically have the C++ bazelrc parser include entries for zero-valued --config
s. Then have the Java consumer recognize that and skip https://github.com/bazelbuild/bazel/blob/199e70c11716cccf098f06b50c98d4f44df08b53/src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java#L265-L267 for those cases.
I'd be happy to review anyone who wants to put up a PR.
Ran into this as well. Surprisingly, this, at a minimum, ran:
build:foo --
I can only imagine that causing any number of problems, though, lol.
The workaround is to add a noop flag.
The one that I use:
common:myconfig --announcerc=false
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage
) if you think this issue is still relevant or you are interested in getting the issue resolved.
@bazelbuild/triage not stale
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
--announcerc=false
is no longer available on bazel 7.3.2. Looking at the current output of bazel help build
and bazel help run
I picked --show_progress
as the noop flag (that's already the default and unlikely to change any time soon).
But would love to just be allowed to define empty config instead.
Description of the feature request:
Allow users to define empty configurations for the
--config
flag in.bazelrc
. E.g. the following should work without error:.bazelrc
:Currently, this will fail with the following error message:
Feature requests: what underlying problem are you trying to solve with this feature?
For some projects it is useful to expose a set of
--config
options as a stable interface. E.g.rules_haskell
exposes a set of configuration options to define the platform and build configuration (linux-bindist
,linux-nixpkgs
,macos-bindist
,macos-nixpkgs
,windows-bindist
).However, there is no way to declare such a stable set of configuration options independent of the corresponding configuration options. Meaning, if a configuration happens to be empty, even just for some commands, then it cannot be defined or enabled.
For example, I would like to be able to declare the following in the rules_haskell:
To ensure that the corresponding
--config
options work for every command.What operating system are you running Bazel on?
Ubuntu 20.10
What's the output of
bazel info release
?release 3.7.2