-
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
Make the default stage for x.py configurable #76165
Comments
Instead of trying to second-guess what everyone's individual subjective workflow is, I think it's much better to make a CLI that is simple and predictable. That means that defaults shouldn't change randomly based on second-guessing everyone's individual subjective workflow. What is simpler to understand, a function like f(x) = x^2, or a function like
Why is the default stage different between If someone does not understand |
Alternatively, have |
This sounds more like a reply to #73964 than anything else; it's not really related to this issue. I'm sorry this broke your workflow. There was an MCP in the compiler-team repo for a couple weeks but I understand you don't have time to watch every major change.
I object to calling the changes second-guessing. These aren't just my personal preferences, they're what the majority of frequent contributors were using before the changes. Having the defaults being different from the recommended workflow made it much harder for new contributors to get started and more annoying for frequent contributors.
I have no objection to this! It wouldn't be hard to keep it updated either since the defaults rarely change - maybe you'd be interested in a PR adding it? ;)
You're right that the new defaults are not simpler, however I believe they're more helpful, because they require less work in the common case.
This is gatekeeping and I don't appreciate it. |
Thanks for the balanced response. I will see about making a PR when I have time, but it'd be nice if whoever else pushes this issue forward, does it whilst also making the change I suggested.
The very existence of this issue indicates that you understand different people have different preferences for the defaults. You may be right that these defaults would satisfy a majority of contributors, but neither of us really know for sure. So I think it's fair to call this second-guessing. Also I think you are mixing up "new contributors" and "frequent contributors". As someone else mentioned on #73964, these new defaults make it quicker to manually execute a debug-oriented workflow, as a frequent contributor. However imagine that all your knowledge about rustc was wiped away and that you are a new contributor. You checkout Generally a good principle is to make the primary API as simple and predictable as possible - ideally the overall options available should be a simple cartesian product of all the individual options. Then one can think about a secondary API with some convenient defaults. For example (as another alternative to my |
This is not the case.
Hmm ... in retrospect this might have been a better idea. But I don't think it's worth changing it back now the change is already made - now automated tools and humans have to think about what the defaults are because it's really non-obvious and depends where in time you are. If you do think this is worth pursuing feel free to open an MCP: https://github.com/rust-lang/compiler-team/issues/new/choose
Sure, I don't think the issues are linked but I don't mind adding a 'stable' bootstrap interface at the same time. |
Yes, the situation is confusing. Because now my question is, what does In fact I've always been a bit confused on the rust compilation stages, and why stage 0 involves building anything at all. Typically "stage 0" should just mean the bootstrap compiler, and "stage 1" is where the first build happens, and "stage 2" is where the second build happens. There is normally no need for a third compilation, which apparently is what |
Ah, I remember, stage0-rustc won't use stage0-std because it was not built by itself but by the bootstrap compiler, and the ABI could be different. OTOH since rustc uses std in its code, we need to build stage0-std first in order to build stage0-rustc. But that suggests that this new behaviour of not building stage-N rustc artifacts should be the case for every stage N, there is no reason to special-case stage 1. |
Correct, that's the case.
See also rust-lang/rustc-dev-guide#843, I'd be interested in your opinion on that. |
Right, this is why |
…acrum Make the default stage for x.py configurable This also allows configuring each sub-command individually. Possibly rust-lang#76617 should land before this? I don't feel strongly either way, I don't mind waiting. Closes rust-lang#76165. r? @Mark-Simulacrum
Previously, `x.py` would unconditionally run `x.py build` to get the help message. After rust-lang#76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`).
Previously, `x.py` would unconditionally run `x.py build` to get the help message. After rust-lang#76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`).
Don't generate bootstrap usage unless it's needed Previously, `x.py` would unconditionally run `x.py build` to get the help message. After rust-lang#76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`). r? @Mark-Simulacrum This should fix the CI failures in rust-lang#76797 and rust-lang#75991.
Don't generate bootstrap usage unless it's needed Previously, `x.py` would unconditionally run `x.py build` to get the help message. After rust-lang#76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`). r? @Mark-Simulacrum This should fix the CI failures in rust-lang#76797 and rust-lang#75991.
Don't generate bootstrap usage unless it's needed Previously, `x.py` would unconditionally run `x.py build` to get the help message. After rust-lang#76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`). r? @Mark-Simulacrum This should fix the CI failures in rust-lang#76797 and rust-lang#75991.
Don't generate bootstrap usage unless it's needed Previously, `x.py` would unconditionally run `x.py build` to get the help message. After rust-lang#76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`). r? @Mark-Simulacrum This should fix the CI failures in rust-lang#76797 and rust-lang#75991.
Don't generate bootstrap usage unless it's needed Previously, `x.py` would unconditionally run `x.py build` to get the help message. After rust-lang#76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`). r? @Mark-Simulacrum This should fix the CI failures in rust-lang#76797 and rust-lang#75991.
Don't generate bootstrap usage unless it's needed Previously, `x.py` would unconditionally run `x.py build` to get the help message. After rust-lang#76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`). r? @Mark-Simulacrum This should fix the CI failures in rust-lang#76797 and rust-lang#75991.
The defaults are a lot better after #73964, but they still aren't ideal for everyone. Some issues that have been mentioned:
x.py test
does not runui-fulldeps
(and inherently can't with--stage 1
): Ignore gated-plugin test on stage1 #75404 (comment)x.py doc
uses stage 0 by default which is not my preference, I almost always want---stage 1
. But new contributors will normally want--stage 0
, so it doesn't make sense to change it for everyone.It would be great to allow configuring the default stage on a per-subcommand level. This would both make it easier to add new commands to the test suite (e.g. #70533 (comment)), and more convenient for local contributors who want defaults other than those hardcoded into bootstrap. The existing defaults could still be left in
config.toml.example
, making this backwards-compatible for contributors.The text was updated successfully, but these errors were encountered: