Closed jyn514 closed 1 year ago
@rustbot claim
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).
@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.
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.
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.
Right now, x.py is pretty inconsistent with cargo's CLI. To pass arguments to compiletest, you use
--test-args
; to pass arguments toexpand-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:x test ui -- --force-rerun --ignored
would behave the same asx test ui --test-args --force-rerun --test-args --ignored
todayx run miri -- run --print=sysroot
would behave the same asx run miri --args run --args --print=sysroot
x fix -- --fix-broken
would behave the same asCARGOFLAGS=--fix-broken x fix
today, except that it would only pass it to cargo commands invoked by bootstrap, not when building bootstrap itself (avoiding the "argument --fix-broken not expected" error you'd get today).