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

Reorganize the run-make-support library #127760

Merged
merged 27 commits into from
Jul 17, 2024

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Jul 15, 2024

The run_make_support library has a kitchen sink lib.rs that make discovery/learning very difficult. Let's try to improve that by breaking up lib.rs into smaller more organized modules. This is a precursor to improving the documentation and learnability of the run_make_support library.

Changes

  • Breakup lib.rs into smaller modules according to functionality
  • Rename recursive_diff -> assert_dirs_are_equal
  • Rename one of the read_dir with callback interface as read_dir_entries
  • Coalesced fs-related stuff onto a fs module, re-exported to tests as rfs
  • Minor doc improvements / fixes in a few places (I have a follow-up documentation PR planned)

This PR is best reviewed commit-by-commit.

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

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

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 15, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Jul 15, 2024

I have ran ./x doc run-make-support locally, but let's also run some try jobs to be sure about other changes.
@bors try

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

Reorganize the `run-make-support` library

The `run_make_support` library has a kitchen sink `lib.rs` that make discovery/learning very difficult. Let's try to improve that by breaking up `lib.rs` into smaller more organized modules. This is a precursor to improving the documentation and learnability of the `run_make_support` library.

### Changes

- Breakup `lib.rs` into smaller modules according to functionality
- Rename `recursive_diff` -> `assert_recursive_eq`
- Minor doc improvements / fixes in a few places (I have a follow-up documentation PR planned)

This PR is best reviewed commit-by-commit.

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

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

bors commented Jul 15, 2024

⌛ Trying commit 4769fc9 with merge e8f1965...

@jieyouxu
Copy link
Member Author

@rustbot author (while waiting for try job to come back)

@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 15, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Jul 15, 2024

This will conflict (and is prone to conflicts) with other rmake.rs PRs that touch the support library.
@bors rollup=never p=1

@bors
Copy link
Contributor

bors commented Jul 15, 2024

☀️ Try build successful - checks-actions
Build commit: e8f1965 (e8f1965e243dd906e4b2561e47b263a887f5712f)

@jieyouxu
Copy link
Member Author

Try builds passed.
@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 Jul 15, 2024

/// Construct the binary (executable) name based on the target.
#[must_use]
pub fn bin_name(name: &str) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

(preexisting) this could use std::env::consts::EXE_EXTENSION

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing that out 👍, I'll address these in a follow-up PR. I want to keep this PR mostly just moving code around.


/// Construct the dynamic library extension based on the target.
#[must_use]
pub fn dynamic_lib_extension() -> &'static str {
Copy link
Member

Choose a reason for hiding this comment

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

(preexisting) this could be replaced with std::env::consts::DLL_EXTENSION

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.

Very nice cleanup! Left a few comments, pretty much all nits.

Btw https://github.com/tummychow/git-absorb might be useful if you want to make changes to so many commits.

src/tools/run-make-support/src/macros.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/env_checked.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/lib.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/path_helpers.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/fs_helpers.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/assertion_helpers.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/assertion_helpers.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/assertion_helpers.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/lib.rs Outdated Show resolved Hide resolved
@jieyouxu
Copy link
Member Author

Going to re-run try jobs (I think force push cancels them?)
@bors try

@bors
Copy link
Contributor

bors commented Jul 17, 2024

⌛ Trying commit d69cc1c with merge 1464be5...

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

Reorganize the `run-make-support` library

The `run_make_support` library has a kitchen sink `lib.rs` that make discovery/learning very difficult. Let's try to improve that by breaking up `lib.rs` into smaller more organized modules. This is a precursor to improving the documentation and learnability of the `run_make_support` library.

### Changes

- Breakup `lib.rs` into smaller modules according to functionality
- Rename `recursive_diff` -> `assert_recursive_eq`
- Minor doc improvements / fixes in a few places (I have a follow-up documentation PR planned)

This PR is best reviewed commit-by-commit.

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

try-job: x86_64-msvc
try-job: aarch64-apple
try-job: test-various
try-job: armhf-gnu
try-job: dist-x86_64-linux
@Kobzol
Copy link
Contributor

Kobzol commented Jul 17, 2024

I think force push cancels them?

It doesn't, we currently allow parallel try builds on PRs.

@bors
Copy link
Contributor

bors commented Jul 17, 2024

☀️ Try build successful - checks-actions
Build commit: 1464be5 (1464be56c803c09ec9575ff8db7d1a83020da727)

@jieyouxu
Copy link
Member Author

@bors r=@Kobzol

@bors
Copy link
Contributor

bors commented Jul 17, 2024

📌 Commit d69cc1c 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 17, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Jul 17, 2024

(RIP all the open run-make PRs)

@bors
Copy link
Contributor

bors commented Jul 17, 2024

⌛ Testing commit d69cc1c with merge f00f850...

@bors
Copy link
Contributor

bors commented Jul 17, 2024

☀️ Test successful - checks-actions
Approved by: Kobzol
Pushing f00f850 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 17, 2024
@bors bors merged commit f00f850 into rust-lang:master Jul 17, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 17, 2024
@jieyouxu jieyouxu deleted the rmake-support-reorganize branch July 17, 2024 18:21
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f00f850): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 769.855s -> 768.932s (-0.12%)
Artifact size: 328.79 MiB -> 328.74 MiB (-0.01%)

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 19, 2024
Cleanup dll/exe filename calculations in `run_make_support`

Use `std::env::consts` constants since now we have access to them (unlike in Makefiles!) ^^

cc `@bzEq` (this is one of the places in our test suites that tries to compute e.g. dylib extension; using `std::env::consts::DLL_EXTENSION` should correctly return `a` for AIX)

r? `@fmease` (thank you for the suggestion in rust-lang#127760 (comment), this also improves correctness for the support library!)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 19, 2024
…ease

Cleanup dll/exe filename calculations in `run_make_support`

Use `std::env::consts` constants since now we have access to them (unlike in Makefiles!) ^^

cc `@bzEq` (this is one of the places in our test suites that tries to compute e.g. dylib extension; using `std::env::consts::DLL_EXTENSION` should correctly return `a` for AIX)

r? `@fmease` (thank you for the suggestion in rust-lang#127760 (comment), this also improves correctness for the support library!)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 19, 2024
Rollup merge of rust-lang#127960 - jieyouxu:minor-rmake-cleanup, r=fmease

Cleanup dll/exe filename calculations in `run_make_support`

Use `std::env::consts` constants since now we have access to them (unlike in Makefiles!) ^^

cc `@bzEq` (this is one of the places in our test suites that tries to compute e.g. dylib extension; using `std::env::consts::DLL_EXTENSION` should correctly return `a` for AIX)

r? `@fmease` (thank you for the suggestion in rust-lang#127760 (comment), this also improves correctness for the support library!)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jul 20, 2024
Cleanup dll/exe filename calculations in `run_make_support`

Use `std::env::consts` constants since now we have access to them (unlike in Makefiles!) ^^

cc `@bzEq` (this is one of the places in our test suites that tries to compute e.g. dylib extension; using `std::env::consts::DLL_EXTENSION` should correctly return `a` for AIX)

r? `@fmease` (thank you for the suggestion in rust-lang/rust#127760 (comment), this also improves correctness for the support library!)

try-job: aarch64-apple
try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants