Uh oh!
There was an error while loading. Please reload this page.
Test the cargo args generated by bootstrap.py - #112281
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
albertlarsan68
left a comment
There was a problem hiding this comment.
Looks mostly good to me, r=me with questions answered.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jyn514
commented
Jun 6, 2023
@bors r=albertlarsan68 |
bors
commented
Jun 6, 2023
📌 Commit c2723c70b1fd31de5a57558ad1e373d0e0f36052 has been approved by It is now in the queue for this repository. |
bors
commented
Jun 8, 2023
⌛ Testing commit c2723c70b1fd31de5a57558ad1e373d0e0f36052 with merge bdae42044ea1244db04c548301491ce5f1919556... |
This comment has been minimized.
This comment has been minimized.
bors
commented
Jun 8, 2023
💔 Test failed - checks-actions |
albertlarsan68
commented
Jun 8, 2023
It seems like the hack to allow for two levels of defaults is not working anymore. |
jyn514
commented
Jun 8, 2023
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. |
Uh oh!
There was an error while loading. Please reload this page.
bors
commented
Jun 24, 2023
☔ 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.
It generates invalid TOML. I want to get rid of it eventually, but this avoids the issue in the meantime.
jyn514
commented
Jun 24, 2023
@bors r=albertlarsan68 |
bors
commented
Jun 24, 2023
bors
commented
Jun 25, 2023
⌛ Testing commit 24e67d5 with merge b716bc479aaeb4143d9f05a9390fb9d659d57525... |
This comment has been minimized.
This comment has been minimized.
bors
commented
Jun 25, 2023
💔 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
albertlarsan68
commented
Jun 25, 2023
Thanks for the PR! |
bors
commented
Jun 25, 2023
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.
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.
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 bootstrapto theRustBuildclass, to avoid mixing setting configuration with running commandsbin_rootsupportsbuildbeing unset.parse_argsnot to use a global, to allow testing itAllow passing arguments to
bootstrap_test.pyPrevious, 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)