-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
x.py (bootstrap) does not accept -j, despite the docs and apparent logic to handle it. #40920
Comments
Odd, I seem to recall successfully passing |
|
Duplicate of #38373 |
This is indeed a duplicate. The first parameter to |
Well, then, the bug is in the documentation. The help appears to state that I would consider this mis-information as a separate bug from the inability to parse options before subcommands. |
...and I'm putting my time where my mouth is -- working on a PR ;-) |
It's coming along nicely. I have at least one more fix and a feature to do before I submit the PR. Work is on this branch, if anyone's interested. |
…hton Overhaul Bootstrap (x.py) Command-Line-Parsing & Help Output While working on rust-lang#40417, I got frustrated with the behavior of x.py and the bootstrap binary it wraps, so I decided to do something about it. This PR should improve documentation, make the command-line-parsing more flexible, and clean up some of the internals. No command that worked before should stop working. At least that's the theory. :-) This should resolve at least rust-lang#40920 and rust-lang#38373. Changes: - No more manual args manipulation -- getopts used everywhere except the one place it's not possible. As a result, options can be in any position, now, even before the subcommand. - The additional options for test, bench, and dist now appear in the help output. - No more single-letter variable bindings used internally for large scopes. - Don't output the time measurement when just invoking `x.py` or explicitly passing `-h` or `--help` - Logic is now much more linear. We build strings up, and then print them. - Refer to subcommands as subcommands everywhere (some places we were saying "command") - Other minor stuff. @alexcrichton This is my first PR. Do I need to do something specific to request reviewers or anything?
…hton Overhaul Bootstrap (x.py) Command-Line-Parsing & Help Output While working on rust-lang#40417, I got frustrated with the behavior of x.py and the bootstrap binary it wraps, so I decided to do something about it. This PR should improve documentation, make the command-line-parsing more flexible, and clean up some of the internals. No command that worked before should stop working. At least that's the theory. :-) This should resolve at least rust-lang#40920 and rust-lang#38373. Changes: - No more manual args manipulation -- getopts used everywhere except the one place it's not possible. As a result, options can be in any position, now, even before the subcommand. - The additional options for test, bench, and dist now appear in the help output. - No more single-letter variable bindings used internally for large scopes. - Don't output the time measurement when just invoking `x.py` or explicitly passing `-h` or `--help` - Logic is now much more linear. We build strings up, and then print them. - Refer to subcommands as subcommands everywhere (some places we were saying "command") - Other minor stuff. @alexcrichton This is my first PR. Do I need to do something specific to request reviewers or anything?
While working on #40417 I discovered that
x.py
spits out the help string if you try to use the-j
option. This will affect #40366 as well, which I ran across while looking to see if this issue had already been reported.x.py
is just a thin wrapper around themain()
function ofsrc/bootstrap/bootstrap.py
, which mostly ensures thebootstrap
binary (src/bootstrap/bin/main.rs
) has been compiled and then passes most arguments (including-j
) to thebootstrap
binary.It is the
bootstrap
binary itself which can't handle the-j
argument -- the python script just passes the argument through to it. Thebootstrap
binary is placed atbuild/bootstrap/debug/bootstrap
when it is built. You can see the buggy behavior by just doing this:If the
bootstrap
binary hasn't been built yet, you can build it by runningx.py build
first.I think the problem is in the
getopts
logic insrc/bootstrap/flags.rs
. That's where I have gotten to debugging the program, anyway. I have never used thegetopts
module, so I paused to create this issue before diving into the docs.I'll continue on and see if I can debug it and produce a patch, but I would be delighted if someone beat me to it. ;-)
The text was updated successfully, but these errors were encountered: