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

Short Starlark flags #11750

Closed
gregestren opened this issue Jul 10, 2020 · 3 comments
Closed

Short Starlark flags #11750

gregestren opened this issue Jul 10, 2020 · 3 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Configurability Issues for Configurability team type: feature request

Comments

@gregestren
Copy link
Contributor

Description of the problem / feature request:

Provide a way to alias Starlark flags so they don't take up so much space on the command line.

Feature requests: what underlying problem are you trying to solve with this feature?

Keep command lines crisp, simple, focused, uncluttered, and clear.

Also, as we migrate native (built into Bazel) flags like --cpu to Starlark flags, we don't want that to bloat command lines.

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

# Native (built directly into Bazel) flag:
$ bazel build //:my_project --cpu=x86
# Same-repository Starlark flag:
$ bazel build //:my_project --//my/starlark_flags:flag=foo
# Different-repository Starlark flag:
$ bazel build //:my_project --@some_other_repo//my/starlark_flags:flag=foo

Have you found anything relevant by searching the web?

Design document forthcoming.

@gregestren gregestren added type: feature request P1 I'll work on this now. (Assignee required) team-Configurability Issues for Configurability team labels Jul 10, 2020
@WarkahScott WarkahScott self-assigned this Jul 13, 2020
@WarkahScott
Copy link
Contributor

Design Doc: Starlark Shorthand Flag Mapping

bazel-io pushed a commit that referenced this issue Aug 17, 2020
For #11750

PiperOrigin-RevId: 327069423
@gregestren
Copy link
Contributor Author

FYI @WarkahScott authored and committed b47f228, even though it self-attributes to "Googler".

I believe future commits will correctly attribute @WarkahScott .

bazel-io pushed a commit that referenced this issue Aug 19, 2020
The main use case we're working toward for shorthand flags is to have them defined in an rcfile and then later used on the command line. Swapping the parsing order allows for the parser to build the full list of known aliases before running into something that looks like an unknown option.

For #11750

PiperOrigin-RevId: 327485224
bazel-io pushed a commit that referenced this issue Sep 3, 2020
For #11750

RELNOTES: None.
PiperOrigin-RevId: 329924598
bazel-io pushed a commit that referenced this issue Sep 17, 2020
For #11750

RELNOTES: None.
PiperOrigin-RevId: 332302279
Yannic pushed a commit to Yannic/bazel that referenced this issue Oct 5, 2020
bazel-io pushed a commit that referenced this issue Oct 8, 2020
For #11750

RELNOTES[NEW]: Starlark-defined flags can now be shorthanded using --flag_alias.

PiperOrigin-RevId: 336089524
bazel-io pushed a commit that referenced this issue Oct 13, 2020
For #11750

RELNOTES: None.
PiperOrigin-RevId: 336939219
bazel-io pushed a commit that referenced this issue Oct 16, 2020
For #11750

RELNOTES: None.
PiperOrigin-RevId: 337566063
@WarkahScott
Copy link
Contributor

Implemented, should be available in the next release 🎉

bazel-io pushed a commit that referenced this issue Oct 16, 2020
For #11750

RELNOTES: --flag_alias can now be used without --experimental_enable_flag_alias
PiperOrigin-RevId: 337583219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Configurability Issues for Configurability team type: feature request
Projects
None yet
Development

No branches or pull requests

2 participants