-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustc mistakes non-rust crates for candidates #13010
Comments
rustc seems to be using a fairly imprecise heuristic for finding candidate crates. Apparently this used to work. |
The problem is probably that this file name format "foo-bar-baz" is the same as our "libfoo-hash-version". rustc could first check that "hash" contains the right set of characters, but could also open the files and read the metadata before deciding they are real candidates. |
Oh dear it should definitely be finding metadata before emitting any errors. |
Previously, any library of the pattern `lib<name>-<hash>-<version>.so` was >considered a candidate (rightly so) for loading a crate. Sets are generated for each unique `<hash>`, and then from these sets a candidate is selected. If a set contained more than one element, then it immediately generated an error saying that multiple copies of the same dylib were found. This is incorrect because each candidate needs to be validated to actually contain a rust library (valid metadata). This commit alters the logic to filter each set of candidates for a hash to only libraries which are actually rust libraries. This means that if multiple false positives are found with the right name pattern, they're all ignored. Closes #13010
Thank you! I'll test it later. |
Do not unconditionally succeed RUSTC_WRAPPER checks when run by build scripts rust-analyzer's RUSTC_WRAPPER unconditionally succeeds `cargo check` invocations tripping up build scripts using `cargo check` to probe for successful compilations. To prevent this from happening the RUSTC_WRAPPER now checks if it's run from a build script by looking for the `CARGO_CFG_TARGET_ARCH` env var that cargo sets only when running build scripts.
…backslash, r=blyxyas doc_markdown: detect escaped `` ` `` when checking unmatched ``` changelog: [`doc_markdown`]: correctly detect backslash-escaped `` ` `` ```
I'm trying to build an application that depends on a crate called cairo.
rustc cairo.rs/examples/example1.rs -L ~/.homebrew/lib -L .
But instead of it finding the right crate, I get two unrelated libraries that it cannot disambiguate (since they are from the 'real' cairo, not my wrapper) https://gist.github.com/jensnockert/221ef976bcae3a1f13ff
The text was updated successfully, but these errors were encountered: