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

run-make-support: add wrapper for fs operations #125736

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

Oneirical
Copy link
Contributor

@Oneirical Oneirical commented May 29, 2024

Suggested by #125728.

The point of this wrapper is to stop silent fails caused by forgetting to unwrap fs functions. However, functions like fs::read which return something and get stored in a variable should cause a failure on their own if they are not unwrapped (as the Result will be stored in the variable, and something will be done on that Result that should have been done to its contents). Is it still pertinent to wrap fs::read_to_string, fs::metadata and so on?

Closes: #125728

try-job: x86_64-msvc
try-job: i686-mingw

@rustbot
Copy link
Collaborator

rustbot commented May 29, 2024

r? @jieyouxu

rustbot has assigned @jieyouxu.
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 the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 29, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 29, 2024

The run-make-support library was changed

cc @jieyouxu

Some changes occurred in run-make tests.

cc @jieyouxu

@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the run-make-file-management branch from 05c396f to ef50eda Compare May 29, 2024 19:56
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the run-make-file-management branch 2 times, most recently from 6d89045 to 5405489 Compare May 29, 2024 20:56
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the run-make-file-management branch from 5405489 to 285ddae Compare May 29, 2024 21:06
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented May 30, 2024

☔ The latest upstream changes (presumably #125744) made this pull request unmergeable. Please resolve the merge conflicts.

@Oneirical Oneirical force-pushed the run-make-file-management branch from 285ddae to 413d8b1 Compare May 30, 2024 14:29
@Oneirical Oneirical marked this pull request as draft May 30, 2024 14:49
@Oneirical Oneirical force-pushed the run-make-file-management branch 2 times, most recently from 6940dae to 249fd58 Compare May 30, 2024 14:58
@Oneirical Oneirical marked this pull request as ready for review May 30, 2024 14:59
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical marked this pull request as draft May 30, 2024 16:53
@Oneirical Oneirical force-pushed the run-make-file-management branch from 249fd58 to 2c0f892 Compare May 30, 2024 16:58
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the run-make-file-management branch from 2c0f892 to 14ea2a5 Compare May 30, 2024 19:15
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Good changes, I think tests are less busy to read without all the .unwrap()s.

src/tools/run-make-support/src/cc.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/fs.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/fs.rs Outdated Show resolved Hide resolved
@Oneirical Oneirical force-pushed the run-make-file-management branch from 14ea2a5 to e551456 Compare May 31, 2024 13:55
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the run-make-file-management branch from e551456 to 9404d9e Compare May 31, 2024 14:56
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the run-make-file-management branch from 9404d9e to 1094107 Compare May 31, 2024 16:46
@Kobzol
Copy link
Contributor

Kobzol commented Jun 11, 2024

#125752 was merged, so this needs a rebase.

@jieyouxu
Copy link
Member

@rustbot author (no longer blocked)

@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-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jun 11, 2024
@Oneirical Oneirical force-pushed the run-make-file-management branch from 7503379 to 5995c7f Compare June 11, 2024 13:47
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Just one small problem with an intra-doc link, r=me after fixing that because it might fail in CI when ./x doc src/tools/run-make-support and after PR CI is green.

src/tools/run-make-support/src/fs_wrapper.rs Outdated Show resolved Hide resolved
@Oneirical Oneirical force-pushed the run-make-file-management branch from 5995c7f to c84afee Compare June 11, 2024 13:53
@jieyouxu
Copy link
Member

The current rollup contains some rmake.rs that uses std::fs, but we should land this PR ASAP to prevent more bitrotting or conflicts (I will fixup the rolled up tests after this PR).

@jieyouxu
Copy link
Member

@bors r+ rollup=never p=1 (some other run-make PRs are blocked on this)

@bors
Copy link
Contributor

bors commented Jun 11, 2024

📌 Commit c84afee has been approved by jieyouxu

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 Jun 11, 2024
@bors
Copy link
Contributor

bors commented Jun 11, 2024

⌛ Testing commit c84afee with merge 3ea5e23...

@bors
Copy link
Contributor

bors commented Jun 11, 2024

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing 3ea5e23 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 11, 2024
@bors bors merged commit 3ea5e23 into rust-lang:master Jun 11, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 11, 2024
@Oneirical Oneirical deleted the run-make-file-management branch June 11, 2024 18:19
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3ea5e23): 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)

Results (primary 3.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.3% [3.3%, 3.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.3% [3.3%, 3.3%] 1

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: 679.328s -> 676.994s (-0.34%)
Artifact size: 320.10 MiB -> 320.03 MiB (-0.02%)

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 18, 2024
Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Guaranteed to fail CI until rust-lang#125736 gets merged. Will require addition of `fs_wrapper::set_permissions` in the associated module.

try-job: x86_64-msvc
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 19, 2024
Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Guaranteed to fail CI until rust-lang#125736 gets merged. Will require addition of `fs_wrapper::set_permissions` in the associated module.

try-job: x86_64-msvc
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 19, 2024
…youxu

Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Guaranteed to fail CI until rust-lang#125736 gets merged. Will require addition of `fs_wrapper::set_permissions` in the associated module.

try-job: x86_64-msvc
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 19, 2024
…youxu

Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Guaranteed to fail CI until rust-lang#125736 gets merged. Will require addition of `fs_wrapper::set_permissions` in the associated module.

try-job: x86_64-msvc
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 19, 2024
…youxu

Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Guaranteed to fail CI until rust-lang#125736 gets merged. Will require addition of `fs_wrapper::set_permissions` in the associated module.

try-job: x86_64-msvc
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 20, 2024
…youxu

Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Guaranteed to fail CI until rust-lang#125736 gets merged. Will require addition of `fs_wrapper::set_permissions` in the associated module.

try-job: x86_64-msvc
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 20, 2024
Rollup merge of rust-lang#126095 - Oneirical:final-testination, r=jieyouxu

Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Guaranteed to fail CI until rust-lang#125736 gets merged. Will require addition of `fs_wrapper::set_permissions` in the associated module.

try-job: x86_64-msvc
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 A-testsuite Area: The testsuite used to check the correctness of rustc 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. 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-support: add helpers for fs operations
7 participants