-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Spurious multiple crate version warning when using --extern #17186
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
Comments
bkoropoff
added a commit
to bkoropoff/rust
that referenced
this issue
Sep 12, 2014
When checking for an existing crate, compare against the `crate_metadata::name` field, which is the crate name which was requested during resolution, rather than the result of the `crate_metadata::name()` method, which is the crate name within the crate metadata, as these may not match when using the --extern option to `rustc`. This fixes spurious "multiple crate version" warnings under the following scenario: - The crate `foo`, is referenced multiple times - `--extern foo=./path/to/libbar.rlib` is specified to rustc - The internal crate name of `libbar.rlib` is not `foo` The behavior surrounding `Context::should_match_name` and the comments in `loader.rs` both lead me to believe that this scenario is intended to work. Fixes rust-lang#17186
bkoropoff
added a commit
to bkoropoff/rust
that referenced
this issue
Sep 13, 2014
bors
added a commit
that referenced
this issue
Sep 14, 2014
…ichton When checking for an existing crate, compare against the `crate_metadata::name` field, which is the crate name which was requested during resolution, rather than the result of the `crate_metadata::name()` method, which is the crate name within the crate metadata, as these may not match when using the --extern option to `rustc`. This fixes spurious "multiple crate version" warnings under the following scenario: - The crate `foo`, is referenced multiple times - `--extern foo=./path/to/libbar.rlib` is specified to rustc - The internal crate name of `libbar.rlib` is not `foo` The behavior surrounding `Context::should_match_name` and the comments in `loader.rs` both lead me to believe that this scenario is intended to work. Fixes #17186
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test Case
lib.rs
test.rs
Build
Output
Analysis
Use of
#[phase(plugin, link)]
causes the crate to be resolved twice. Looking at debug output, a bug is causing the two resolutions to load the same crate twice with separate cnums. I believe I have identified a fix and will be submitting a PR shortly.The text was updated successfully, but these errors were encountered: