-
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
Test the cargo args generated by bootstrap.py #112281
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good to me, r=me with questions answered.
@bors r=albertlarsan68 |
📌 Commit c2723c70b1fd31de5a57558ad1e373d0e0f36052 has been approved by It is now in the queue for this repository. |
⌛ Testing commit c2723c70b1fd31de5a57558ad1e373d0e0f36052 with merge bdae42044ea1244db04c548301491ce5f1919556... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
It seems like the hack to allow for two levels of defaults is not working anymore. |
lmao - ok what went wrong isn't that the hack broke, but that we started testing it at all 😂 before we didn't include the profile in the config the unit tests created, only the config from the main bootstrap.py process. i think once i switch configure.py not to deserialize and reserialize the toml this problem will go away entirely, but in the meantime i'm going to change the hack back again so it's untested. |
☔ The latest upstream changes (presumably #112974) made this pull request unmergeable. Please resolve the merge conflicts. |
Before it would unconditionally print `configure-args = []`.
Previous, it used the built-in test runner, which doesn't support options unless they're manually passed in the script.
This moves a lot of code around, but the logic itself is not too terribly complicated. - Move almost all logic in `def bootstrap` to the `RustBuild` class, to avoid mixing setting configuration with running commands - Update various doctests to the new (more complete) RustBuild config. In particular, don't pretend that `bin_root` supports `build` being unset. - Change `parse_args` not to use a global, to allow testing it - Set BUILD_DIR appropriately so bootstrap.py doesn't panic because cargo isn't found
These weren't being passed in to bootstrap consistently before; in particular `serialize_and_parse` forgot to pass them in.
06dcbcd
to
db8f6a0
Compare
It generates invalid TOML. I want to get rid of it eventually, but this avoids the issue in the meantime.
db8f6a0
to
24e67d5
Compare
@bors r=albertlarsan68 |
⌛ Testing commit 24e67d5 with merge b716bc479aaeb4143d9f05a9390fb9d659d57525... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
- fix tests when `--build` is set - don't leak `config.example.toml` fd - don't crash if `config.toml` doesn't exist yet
Thanks for the PR! |
Rollup of 3 pull requests Successful merges: - rust-lang#112281 (Test the cargo args generated by bootstrap.py) - rust-lang#113028 (rustdoc: handle assoc const equalities in cross-crate impl-Trait-in-arg-pos) - rust-lang#113029 (CI: do not run Bump dependencies workflow on forks) r? `@ghost` `@rustbot` modify labels: rollup
.env("BUILD_DIR", &builder.out) | ||
.env("BUILD_PLATFORM", &builder.build.build.triple) | ||
.current_dir(builder.src.join("src/bootstrap/")) | ||
.args(builder.config.test_args()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that x test src/bootstrap -- <rust_test_name>
no longer works, as unittest
throws an exception when the test name doesn't exist as a module and stops the testing
We could maybe try and reproduce the logic pytest uses for finding modules, and remove arguments that aren't flags or valid modules but that seems a bit brittle 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm going to revert this for now - people can use python -m pytest
manually if they want to pass test args.
…clubby789 Don't pass --test-args to `python -m unitest` The args for unittest and cargo test are mutually incompatible. Suggest that people use `python -m unittest ...` manually instead. This also changes `bootstrap_test.py` to be easier to run standalone; see the commit for details. r? `@clubby789` cc rust-lang#112281 (comment)
I recommend reviewing this commit-by-commit using the instructions in https://rustc-dev-guide.rust-lang.org/git.html#moving-large-sections-of-code.
Test cargo arguments passed by bootstrap.py
This moves a lot of code around, but the logic itself is not too terribly complicated.
def bootstrap
to theRustBuild
class, to avoid mixing setting configuration with running commandsbin_root
supportsbuild
being unset.parse_args
not to use a global, to allow testing itAllow passing arguments to
bootstrap_test.py
Previous, it used the built-in test runner, which doesn't support options unless they're manually passed in the script.
Fix progress messages for configure in bootstrap_test.py
Before it would unconditionally print
configure-args = []
.r? @albertlarsan68 cc #112089 #111979 (comment)