rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.59k stars 12.62k forks source link

bootstrap: Support `--` as an alternative to `--args` and `--test-args` #107375

Closed jyn514 closed 1 year ago

jyn514 commented 1 year ago

Right now, x.py is pretty inconsistent with cargo's CLI. To pass arguments to compiletest, you use --test-args; to pass arguments to expand-yaml-anchors you use --args; to pass arguments to cargo you use CARGOFLAGS. I would like to unify these with the same syntax as cargo:

Teapot4195 commented 1 year ago

@rustbot claim

Teapot4195 commented 1 year ago

Looking at the current setup for argument parsing, it appears that getopts::Options struct doesn't have a state engine based parser, so it wont be able to parse -- as a state changing flag. I'm thinking probably parse and translate the args in python then just pass it on to the bootstrap executable, (unless someone here has a better idea).

jyn514 commented 1 year ago

@Teapot4195 let's not put any logic in python if we can help it, it's going away soon: #94829. I think it would be ok to switch to clap or another arg parser if it makes things easier.

Teapot4195 commented 1 year ago

Ah, I was thinking something like getting rid of the python script was going to happen someday. clap will probably do for the functionality we will need from it.

Teapot4195 commented 1 year ago

I'm out of town for the rest of the week so if anyone would like to take this issue while I'm away, go for it.