Navigation Menu

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

Add context to some fs errors. #8232

Merged
merged 1 commit into from May 12, 2020
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented May 11, 2020

This adds some extra context to most fs operations that indicates some more detail (particularly the path). It can be frustrating when cargo says something generic like "Access is denied." without printing a path or information about what it is doing.

Addresses #8211, where it adds extra context to the message.

@rust-highfive
Copy link

r? @Eh2406

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 11, 2020
@alexcrichton
Copy link
Member

Definitely sounds like a good idea to me, thanks! Was this found by basically grepping for use std::fs and replacing all uses with the paths module? I'm mostly just curious, we'd ideally have a lint or something like that but that feels way overkill.

@ehuss
Copy link
Contributor Author

ehuss commented May 11, 2020

Yea, I just searched for various things. A check would be nice, but would be tricky I think, because there are still valid usages of std::fs, File, and Path methods. I think we'll just need to be careful during reviews to make sure every usage of ? (in any circumstance) has sufficient context.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented May 12, 2020

📌 Commit ce86e86 has been approved by alexcrichton

@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 May 12, 2020
@bors
Copy link
Collaborator

bors commented May 12, 2020

⌛ Testing commit ce86e86 with merge 058baec...

@bors
Copy link
Collaborator

bors commented May 12, 2020

☀️ Test successful - checks-azure
Approved by: alexcrichton
Pushing 058baec to master...

@bors bors merged commit 058baec into rust-lang:master May 12, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2020
Update cargo

9 commits in cb06cb2696df2567ce06d1a39b1b40612a29f853..500b2bd01c958f5a33b6aa3f080bea015877b83c
2020-05-08 21:57:44 +0000 to 2020-05-18 17:12:54 +0000
- Handle LTO with an rlib/cdylib crate type (rust-lang/cargo#8254)
- Gracefully handle errors during a build. (rust-lang/cargo#8247)
- Update `im-rc` to 15.0.0 (rust-lang/cargo#8255)
- Fix `cargo update` with unused patch. (rust-lang/cargo#8243)
- Rephrased error message for disallowed sections in virtual workspace (rust-lang/cargo#8200)
- Ignore broken console output in some situations. (rust-lang/cargo#8236)
- Expand error message to explain that a string was found (rust-lang/cargo#8235)
- Add context to some fs errors. (rust-lang/cargo#8232)
- Move SipHasher to an isolated module. (rust-lang/cargo#8233)
@ehuss ehuss added this to the 1.45.0 milestone Feb 6, 2022
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants