bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.13k stars 4.05k forks source link

--output_groups can't override previous --output_groups arguments #22242

Open Fil-Den opened 5 months ago

Fil-Den commented 5 months ago

Description of the bug:

From --output_groups documantation: If at least one group is not prefixed, the default set of output groups is omitted.

From this, I expected that the command bazel build ... --output_groups=+foo --output_groups=bar would only produce bar files. However, in reality, both foo and bar files are created.

Can that logic be adjusted to the expected outcome?

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

It can be viewed in the output groups realization: https://github.com/bazelbuild/bazel/blob/44dd49469d9fe1382892d2eecb87074ed8d2c6cb/src/main/java/com/google/devtools/build/lib/analysis/OutputGroupInfo.java#L249.

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

Release 7.0.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 HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

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

comius commented 4 months ago

The docs should say, that "If at least one group is not prefixed, the default set of output groups is omitted."

This is also the intent and behaviour of the code.

comius commented 4 months ago

P3 to update the docs.