Skip to content
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

avoid updating LLVM submodule during bootstrap unit tests #130306

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Sep 13, 2024

To test this, make sure you don't have src/llvm-project fetched and then set llvm.download-ci-llvm=true and run x test bootstrap.

@rustbot
Copy link
Collaborator

rustbot commented Sep 13, 2024

r? @albertlarsan68

rustbot has assigned @albertlarsan68.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Sep 13, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 13, 2024

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@Kobzol
Copy link
Contributor

Kobzol commented Sep 13, 2024

Could we use a hard-coded config.toml file (string) for unit tests, to avoid sprinkling these cfg gates throughout bootstrap's codebase?

@onur-ozkan
Copy link
Member Author

Could we use a hard-coded config.toml file (string) for unit tests, to avoid sprinkling these cfg gates throughout bootstrap's codebase?

We don't use a consistent configuration for all unit tests, which is the problem. You can find some examples in the config test module.

@Kobzol
Copy link
Contributor

Kobzol commented Sep 13, 2024

Hmm, yeah, that might better be refactored to share some default test configuration, but that's a bigger change.

You can r=me if CI is green. But CI checks out all submodules anyway, so I don't expect that this should break bootstrap tests. I tried to deinit all submodules locally and bootstrap tests were also green.

@onur-ozkan
Copy link
Member Author

Hmm, yeah, that might better be refactored to share some default test configuration, but that's a bigger change.

I guess that can't help either as we intentionally set some options to test them.

@bors r=Kobzol

@bors
Copy link
Contributor

bors commented Sep 13, 2024

📌 Commit 2af4636 has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 13, 2024
@ehuss
Copy link
Contributor

ehuss commented Sep 13, 2024

This seems to not work if you don't have the submodules already checked out. There are some steps that require submodules to exist. This PR causes failures like:

---- core::builder::tests::validate_path_remap stdout ----
warning: unable to check if origin/master is old due to error: No such file or directory (os error 2)
warning: origin/master is used to determine if files have been modified
warning: if it is not updated, this may cause files to be needlessly reformatted
submodule src/doc/book does not appear to be checked out, but it is required for this step
thread 'core::builder::tests::validate_path_remap' panicked at /Users/eric/Temp/z25/rust/src/tools/build_helper/src/util.rs:22:9:
status code: 1

To reproduce:

git submodule deinit --all --force
gh pr checkout 130306
./x test bootstrap

@onur-ozkan
Copy link
Member Author

This seems to not work if you don't have the submodules already checked out. There are some steps that require submodules to exist. This PR causes failures like:

---- core::builder::tests::validate_path_remap stdout ----
warning: unable to check if origin/master is old due to error: No such file or directory (os error 2)
warning: origin/master is used to determine if files have been modified
warning: if it is not updated, this may cause files to be needlessly reformatted
submodule src/doc/book does not appear to be checked out, but it is required for this step
thread 'core::builder::tests::validate_path_remap' panicked at /Users/eric/Temp/z25/rust/src/tools/build_helper/src/util.rs:22:9:
status code: 1

To reproduce:

git submodule deinit --all --force
gh pr checkout 130306
./x test bootstrap

Hmm, I guess for now we should only ignore llvm-submodule as the others are necessary even for the unit test and dry-run builds.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 13, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Sep 13, 2024

Interesting, I did the same (just deinited the submodules after checking out this PR), and it worked for me 🤔

Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the avoid-submodule-updates-in-tests branch from 2af4636 to f03bfb8 Compare September 13, 2024 15:55
@onur-ozkan onur-ozkan changed the title avoid updating submodules during bootstrap unit tests avoid updating LLVM submodule during bootstrap unit tests Sep 13, 2024
@onur-ozkan
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 13, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Sep 13, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Sep 13, 2024

📌 Commit f03bfb8 has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 13, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2024
Rollup of 5 pull requests

Successful merges:

 - rust-lang#130138 (bootstrap: Print more debug info when `find_initial_libdir` fails)
 - rust-lang#130199 (Don't call closure_by_move_body_def_id on FnOnce async closures in MIR validation)
 - rust-lang#130302 (add llvm-bitcode-linker and llvm-tools bins to ci-rustc's sysroot)
 - rust-lang#130306 (avoid updating LLVM submodule during bootstrap unit tests)
 - rust-lang#130317 (`ProjectionElem` and `UnOp`/`BinOp` dont need to be `PartialOrd`/`Ord`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2024
Rollup of 5 pull requests

Successful merges:

 - rust-lang#130138 (bootstrap: Print more debug info when `find_initial_libdir` fails)
 - rust-lang#130199 (Don't call closure_by_move_body_def_id on FnOnce async closures in MIR validation)
 - rust-lang#130302 (add llvm-bitcode-linker and llvm-tools bins to ci-rustc's sysroot)
 - rust-lang#130306 (avoid updating LLVM submodule during bootstrap unit tests)
 - rust-lang#130317 (`ProjectionElem` and `UnOp`/`BinOp` dont need to be `PartialOrd`/`Ord`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 59698a7 into rust-lang:master Sep 14, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2024
Rollup merge of rust-lang#130306 - onur-ozkan:avoid-submodule-updates-in-tests, r=Kobzol

avoid updating LLVM submodule during bootstrap unit tests

To test this, make sure you don't have `src/llvm-project` fetched and then set `llvm.download-ci-llvm=true` and run `x test bootstrap`.
@onur-ozkan onur-ozkan deleted the avoid-submodule-updates-in-tests branch September 14, 2024 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants