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

--experimental_propagate_custom_flag is error-prone #25208

Open
armandomontanez opened this issue Feb 5, 2025 · 4 comments · May be fixed by #25259
Open

--experimental_propagate_custom_flag is error-prone #25208

armandomontanez opened this issue Feb 5, 2025 · 4 comments · May be fixed by #25259
Assignees
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug untriaged

Comments

@armandomontanez
Copy link

Description of the bug:

After tripping over this flag for a bit, I finally was able to root-cause the usability issues:

  1. The label passed to --experimental_propagate_custom_flag must be fully qualified. This means both using the canonical repo name, AND expanding any labels that match the name of their parent directory (e.g. //foo:foo).
  2. If a nonexistent flag is passed, Bazel doesn't emit any warnings or errors.

The compounding of the two issues makes --experimental_propagate_custom_flag difficult to use since the only way to ensure you've done the right thing is by creating some kind of test that verifies the behavior change of the flag.

Which category does this issue belong to?

Configurability

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

https://github.com/armandomontanez/bazel_reproducers/tree/main/propagate_custom_flag_issues

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

8.0.0

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 ?


If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

#22457

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

No response

@sgowroji sgowroji added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Feb 6, 2025
@tpudlik
Copy link
Contributor

tpudlik commented Feb 11, 2025

@katre

@gregestren
Copy link
Contributor

1's current behavior sounds reasonable.

If this sufficiently addressed by better enforcing 2?

@armandomontanez
Copy link
Author

Since canonical repo names are unstable (e.g. @@+_repo_rules5+llvm_toolchain_macos, where the number can change for reasons I haven't investigated), it'd be preferable if we could support both apparent and canonical repo names. Either way, I'd gladly take error messages when the flag has no effect, since at least then we'll catch when things move.

@fmeum
Copy link
Collaborator

fmeum commented Feb 11, 2025

Cc @Wyverald

@fmeum fmeum self-assigned this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants