rustc: Ignore fs::canonicalize errors in metadata#74915
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 30, 2020
Merged
rustc: Ignore fs::canonicalize errors in metadata#74915bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
Member
|
It looks like rust/src/librustc_metadata/creader.rs Line 239 in 584e83d rust/src/librustc_session/filesearch.rs Line 127 in 584e83d I didn't look at tools or bootstrap but those probably have more cases like this as well. r=me if you don't want to fix those in this PR though! |
This commit updates the metadata location logic to ignore errors when calling `fs::canonicalize`. Canonicalization was added historically so multiple `-L` paths to the same directory don't print errors about multiple candidates (since rustc can deduplicate same-named paths), but canonicalization doesn't work on all filesystems. Cargo, for example, always uses this sort of fallback where it will opportunitistically try to canonicalize but fall back to using the input path if it otherwise doesn't work. If rustc is run on a filesystem that doesn't support canonicalization then the effect of this change will be that `-L` paths which logically point to the same directory will cause errors, but that's a rare enough occurrence it shouldn't cause much issue in practice. Otherwise rustc doesn't work at all today on those sorts of filesystem where canonicalization isn't supported!
92e1101 to
cd8bdb5
Compare
Member
Author
|
Ah good catch! I've gone ahead and fixed those too. @bors: r=Mark-Simulacrum |
Collaborator
|
📌 Commit cd8bdb5 has been approved by |
Contributor
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 30, 2020
…arth Rollup of 9 pull requests Successful merges: - rust-lang#74751 (Clean up E0730 explanation) - rust-lang#74782 (Don't use "weak count" around Weak::from_raw_ptr) - rust-lang#74835 (Clean up E0734 explanation) - rust-lang#74871 (Enable docs on dist-x86_64-musl) - rust-lang#74905 (Avoid bool-like naming) - rust-lang#74907 (Clean up E0740 explanation) - rust-lang#74915 (rustc: Ignore fs::canonicalize errors in metadata) - rust-lang#74934 (Improve diagnostics when constant pattern is too generic) - rust-lang#74951 (Cherry-pick the release notes for 1.45.1) Failed merges: r? @ghost
This was referenced Jul 28, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit updates the metadata location logic to ignore errors when
calling
fs::canonicalize. Canonicalization was added historically somultiple
-Lpaths to the same directory don't print errors aboutmultiple candidates (since rustc can deduplicate same-named paths), but
canonicalization doesn't work on all filesystems. Cargo, for example,
always uses this sort of fallback where it will opportunitistically try
to canonicalize but fall back to using the input path if it otherwise
doesn't work.
If rustc is run on a filesystem that doesn't support canonicalization
then the effect of this change will be that
-Lpaths which logicallypoint to the same directory will cause errors, but that's a rare enough
occurrence it shouldn't cause much issue in practice. Otherwise rustc
doesn't work at all today on those sorts of filesystem where
canonicalization isn't supported!