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

make tidy trips over Emacs lockfile with opaque message #38417

Closed
zackmdavis opened this issue Dec 16, 2016 · 2 comments
Closed

make tidy trips over Emacs lockfile with opaque message #38417

zackmdavis opened this issue Dec 16, 2016 · 2 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@zackmdavis
Copy link
Member

Emacs drops a broken symlink in a file's directory to indicate that the file has unsaved changes. When scanning Rust source files for features, the rustc development tidy tool will fail if such a lockfile exists in the source tree, with (this part being the actual bug, being that a dirty tree should fail tidy) a message that doesn't make it clear what happened:

thread 'main' panicked at 'File::open(file) failed with No such file or directory (os error 2)', /home/zmd/Code/rust/src/tools/tidy/src/features.rs:71

(The novice compiler developer wonders: what file?)

I think this is likely too obscure to be worth doing anything about, but somehow managed to fall slightly over my subjective threshold of "worth filing an Issue for"; sorry if I'm miscalibrated in this matter.

@bluss
Copy link
Member

bluss commented Dec 17, 2016

It looks like the t!() macro has a two parameter case for reporting path errors, which means it could be fixed by just using t!(File::open(&file), &file)

@bluss bluss added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Dec 17, 2016
@zackmdavis
Copy link
Member Author

thread 'main' panicked at 'File::open(&file) failed on /home/zmd/Code/rust/src/librustc/infer/.#mod.rs with No such file or directory (os error 2)', /home/zmd/Code/rust/src/tools/tidy/src/features.rs:71

Yes, that's a bit better; thanks! 💖 (trivial PR to follow)

zackmdavis added a commit to zackmdavis/rust that referenced this issue Dec 17, 2016
This tiny patch merely applies @bluss's suggestion for how to get a more
informative error message when the feature check can't open a file, a
matter that had briefly annoyed the present author, leading to the
filing of rust-lang#38417.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Dec 18, 2016
…cro_nicety, r=bluss

tidy features: use 2-parameter form of internal try macro for open err

This tiny patch merely applies @bluss's suggestion for how to get a more
informative error message when the feature check can't open a file, a
matter that had briefly annoyed the present author, leading to the
filing of rust-lang#38417.

Resolves rust-lang#38417.
sanxiyn added a commit to sanxiyn/rust that referenced this issue Dec 19, 2016
…cro_nicety, r=bluss

tidy features: use 2-parameter form of internal try macro for open err

This tiny patch merely applies @bluss's suggestion for how to get a more
informative error message when the feature check can't open a file, a
matter that had briefly annoyed the present author, leading to the
filing of rust-lang#38417.

Resolves rust-lang#38417.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

2 participants