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

Cleanup rmake.rs setup in compiletest #127958

Merged
merged 16 commits into from
Jul 21, 2024

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Jul 19, 2024

While debugging rmake.rs tests I realized that the rmake.rs setup itself in compiletest is very messy and confused. Now that I know some of the bootstrap steps and the rmake.rs tests themselves better, I realized there are cleanups that are possible:

  • Rework how source_root and build_root are calculated. They should now be less fragile then before.
  • Shuffle around path calculations to make them more logically grouped and closer to eventual use site(s).
  • Cleanup executable extension calculation with std::env::consts::EXE_EXTENSION.
  • Cleanup various dylib search path handling: renamed variables to better reflect their purpose, minimized mutability scope of said variables.
  • Prune useless env vars passed to both rustc and recipe binary commands.
  • Vastly improve the documentation for the setup of rmake.rs tests, including assumed bootstrap-provided build layouts, rmake.rs test layout, dylib search paths, intended purpose of passed env vars and the COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0 stage0 sysroot special handling.

This PR is best reviewed commit-by-commit.

Fixes #127920.

r? bootstrap (or Kobzol, or Mark, or T-compiler)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: dist-x86_64-linux
try-job: test-various
try-job: x86_64-mingw
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18

@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-compiletest Area: the compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs labels Jul 19, 2024
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 19, 2024
@jieyouxu

This comment was marked as duplicate.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 19, 2024
…r=<try>

Cleanup rmake.rs setup in compiletest

While debugging rmake.rs tests I realized that the rmake.rs setup itself in compiletest is very messy and confused. Now that I know some of the bootstrap steps and the rmake.rs tests themselves better, I realized there are cleanups that are possible:

- Rework how `source_root` and `build_root` are calculated. They should now be less fragile then before.
- Shuffle around path calculations to make them more logically grouped and closer to eventual use site(s).
- Cleanup executable extension calculation with `std::env::consts::EXE_EXTENSION`.
- Cleanup various dylib search path handling: renamed variables to better reflect their purpose, minimized mutability scope of said variables.
- Prune useless env vars passed to both `rustc` and recipe binary commands.
- Vastly improve the documentation for the setup of rmake.rs tests, including assumed bootstrap-provided build layouts, rmake.rs test layout, dylib search paths, intended purpose of passed env vars and the `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0` stage0 sysroot special handling.

r? bootstrap (or Kobzol, or Mark, or T-compiler)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: dist-x86_64-linux
try-job: test-various
try-job: x86_64-mingw
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
@bors

This comment was marked as outdated.

@jieyouxu
Copy link
Member Author

@rustbot author

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 19, 2024
@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as outdated.

@rust-cloud-vms rust-cloud-vms bot force-pushed the compiletest-rmake-cleanup branch 2 times, most recently from 8b8e154 to c3bcec2 Compare July 19, 2024 11:40
@jieyouxu

This comment was marked as outdated.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 19, 2024
…r=<try>

Cleanup rmake.rs setup in compiletest

While debugging rmake.rs tests I realized that the rmake.rs setup itself in compiletest is very messy and confused. Now that I know some of the bootstrap steps and the rmake.rs tests themselves better, I realized there are cleanups that are possible:

- Rework how `source_root` and `build_root` are calculated. They should now be less fragile then before.
- Shuffle around path calculations to make them more logically grouped and closer to eventual use site(s).
- Cleanup executable extension calculation with `std::env::consts::EXE_EXTENSION`.
- Cleanup various dylib search path handling: renamed variables to better reflect their purpose, minimized mutability scope of said variables.
- Prune useless env vars passed to both `rustc` and recipe binary commands.
- Vastly improve the documentation for the setup of rmake.rs tests, including assumed bootstrap-provided build layouts, rmake.rs test layout, dylib search paths, intended purpose of passed env vars and the `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0` stage0 sysroot special handling.

This PR is best reviewed commit-by-commit.

r? bootstrap (or Kobzol, or Mark, or T-compiler)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: dist-x86_64-linux
try-job: test-various
try-job: x86_64-mingw
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
@bors

This comment was marked as outdated.

@rust-log-analyzer

This comment was marked as outdated.

@bors

This comment was marked as outdated.

@rust-log-analyzer

This comment was marked as outdated.

@jieyouxu

This comment was marked as outdated.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 19, 2024
…r=<try>

Cleanup rmake.rs setup in compiletest

While debugging rmake.rs tests I realized that the rmake.rs setup itself in compiletest is very messy and confused. Now that I know some of the bootstrap steps and the rmake.rs tests themselves better, I realized there are cleanups that are possible:

- Rework how `source_root` and `build_root` are calculated. They should now be less fragile then before.
- Shuffle around path calculations to make them more logically grouped and closer to eventual use site(s).
- Cleanup executable extension calculation with `std::env::consts::EXE_EXTENSION`.
- Cleanup various dylib search path handling: renamed variables to better reflect their purpose, minimized mutability scope of said variables.
- Prune useless env vars passed to both `rustc` and recipe binary commands.
- Vastly improve the documentation for the setup of rmake.rs tests, including assumed bootstrap-provided build layouts, rmake.rs test layout, dylib search paths, intended purpose of passed env vars and the `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0` stage0 sysroot special handling.

This PR is best reviewed commit-by-commit.

r? bootstrap (or Kobzol, or Mark, or T-compiler)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: dist-x86_64-linux
try-job: test-various
try-job: x86_64-mingw
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
@bors

This comment was marked as outdated.

@rust-log-analyzer

This comment was marked as outdated.

@bors

This comment was marked as outdated.

@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 Jul 19, 2024
Copy link
Contributor

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uff, this code was really convoluted. It still is, but it's better, and documented now, so thanks for doing this! Looking forward to deleting the "v1" version of this code 😆

Left a few nits, you can r=me after taking a look at them.

src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
This is important for other tests that have various things like modes,
revisions and the like. These features are not supported in run-make
tests, so we don't need the double layering.
@jieyouxu
Copy link
Member Author

@bors try (trying again just to be safe)

@jieyouxu
Copy link
Member Author

@rustbot author

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 20, 2024
…r=<try>

Cleanup rmake.rs setup in compiletest

While debugging rmake.rs tests I realized that the rmake.rs setup itself in compiletest is very messy and confused. Now that I know some of the bootstrap steps and the rmake.rs tests themselves better, I realized there are cleanups that are possible:

- Rework how `source_root` and `build_root` are calculated. They should now be less fragile then before.
- Shuffle around path calculations to make them more logically grouped and closer to eventual use site(s).
- Cleanup executable extension calculation with `std::env::consts::EXE_EXTENSION`.
- Cleanup various dylib search path handling: renamed variables to better reflect their purpose, minimized mutability scope of said variables.
- Prune useless env vars passed to both `rustc` and recipe binary commands.
- Vastly improve the documentation for the setup of rmake.rs tests, including assumed bootstrap-provided build layouts, rmake.rs test layout, dylib search paths, intended purpose of passed env vars and the `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0` stage0 sysroot special handling.

This PR is best reviewed commit-by-commit.

Fixes rust-lang#127920.

r? bootstrap (or Kobzol, or Mark, or T-compiler)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: dist-x86_64-linux
try-job: test-various
try-job: x86_64-mingw
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
@bors
Copy link
Contributor

bors commented Jul 20, 2024

⌛ Trying commit a8463be with merge ee6c7a1...

@jieyouxu
Copy link
Member Author

jieyouxu commented Jul 20, 2024

Uff, this code was really convoluted. It still is, but it's better, and documented now, so thanks for doing this!

It's more like "Uff, this code was compiletest is really convoluted". I want to do some simplifications/cleanups/disentanglement some time soon. For example, runtest.rs is critical to our testing infra but it's this extremely convoluted 4000 lines file that I'm fairly sure nobody fully understands.

@bors
Copy link
Contributor

bors commented Jul 20, 2024

☀️ Try build successful - checks-actions
Build commit: ee6c7a1 (ee6c7a11c6bd92d55384c85473c3f80e052316a3)

@jieyouxu
Copy link
Member Author

@bors r=@Kobzol

@bors
Copy link
Contributor

bors commented Jul 20, 2024

📌 Commit a8463be 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 20, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#127720 ([`macro_metavar_expr_concat`] Allow `concat` in repetitions)
 - rust-lang#127734 (Windows: move BSD socket shims to netc)
 - rust-lang#127752 (Ignore allocation bytes in one more mir-opt test)
 - rust-lang#127839 (Fix git safe-directory path for docker images)
 - rust-lang#127867 (Add `wasm32-wasip2` to `build-manifest` tool)
 - rust-lang#127958 (Cleanup rmake.rs setup in compiletest)
 - rust-lang#127975 (Fix trait bounds display)
 - rust-lang#128005 (Remove _tls_used hack)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 21, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#127720 ([`macro_metavar_expr_concat`] Allow `concat` in repetitions)
 - rust-lang#127734 (Windows: move BSD socket shims to netc)
 - rust-lang#127752 (Ignore allocation bytes in one more mir-opt test)
 - rust-lang#127839 (Fix git safe-directory path for docker images)
 - rust-lang#127867 (Add `wasm32-wasip2` to `build-manifest` tool)
 - rust-lang#127958 (Cleanup rmake.rs setup in compiletest)
 - rust-lang#127975 (Fix trait bounds display)
 - rust-lang#128005 (Remove _tls_used hack)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ae28d5c into rust-lang:master Jul 21, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 21, 2024
Rollup merge of rust-lang#127958 - jieyouxu:compiletest-rmake-cleanup, r=Kobzol

Cleanup rmake.rs setup in compiletest

While debugging rmake.rs tests I realized that the rmake.rs setup itself in compiletest is very messy and confused. Now that I know some of the bootstrap steps and the rmake.rs tests themselves better, I realized there are cleanups that are possible:

- Rework how `source_root` and `build_root` are calculated. They should now be less fragile then before.
- Shuffle around path calculations to make them more logically grouped and closer to eventual use site(s).
- Cleanup executable extension calculation with `std::env::consts::EXE_EXTENSION`.
- Cleanup various dylib search path handling: renamed variables to better reflect their purpose, minimized mutability scope of said variables.
- Prune useless env vars passed to both `rustc` and recipe binary commands.
- Vastly improve the documentation for the setup of rmake.rs tests, including assumed bootstrap-provided build layouts, rmake.rs test layout, dylib search paths, intended purpose of passed env vars and the `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0` stage0 sysroot special handling.

This PR is best reviewed commit-by-commit.

Fixes rust-lang#127920.

r? bootstrap (or Kobzol, or Mark, or T-compiler)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: dist-x86_64-linux
try-job: test-various
try-job: x86_64-mingw
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
@jieyouxu jieyouxu deleted the compiletest-rmake-cleanup branch July 21, 2024 06:03
@cuviper cuviper modified the milestones: 1.81.0, 1.82.0 Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: the compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc 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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

run-make: revise rmake.rs setup in compiletest
6 participants