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

Rustdoc fails with info about symbol names #32532

Closed
alexcrichton opened this Issue Mar 27, 2016 · 15 comments

Comments

Projects
None yet
5 participants
@alexcrichton
Copy link
Member

alexcrichton commented Mar 27, 2016

A bunch of my nightly builds are now generating the error:

error: the current crate is indistinguishable from one of its dependencies: it has the same crate-name libc and was compiled with the same -C metadata arguments. This will result in symbol conflicts between the two. [E0519]

This is likely due to the revamp of symbol names, but it's also unfortunately a regression on nightly. I think what's happening here is that Cargo isn't passing -C metadata to rustdoc (because it can't) and then the crates.io libc crate is conflicting with the in-tree libc crate.

cc @nikomatsakis

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Mar 27, 2016

Ah, and an example of a failing build

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Mar 28, 2016

I'm hitting this too.

brson added a commit to rust-lang/rustup.rs that referenced this issue Mar 28, 2016

brson added a commit to rust-lang/rustup.rs that referenced this issue Mar 28, 2016

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 28, 2016

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 28, 2016

@brson specifically with libc, or with other crate names?

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 28, 2016

So I'm trying to figure out if the right answer here is that we should just be passing in metadata to rustdoc? Seems plausible.

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Mar 28, 2016

Hm, in rustdoc we actually don't care about symbol name conflict, so we could indicate that to the crate loader?

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Mar 28, 2016

The analysis of the underlying reason by @alexcrichton seems plausible to me, by the way.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 28, 2016

Hm, in rustdoc we actually don't care about symbol name conflict, so we could indicate that to the crate loader?

Maybe, but it seems sloppy to me -- I mean, why don't we care? The signatures might well be different, for example, so it might well matter. In any case, I'm trying to understand what is leading us to get this conflict still (I haven't reproduced it yet -- what target do I need to use?).

The analysis of the underlying reason by @alexcrichton seems plausible to me, by the way.

I feel like I'm still missing something. From what I can tell, the error comes when generating docs for the libc crate -- so why is it accessing crates.io anyway? And doesn't crates.io give metadata when building? (Do we tell rustdoc where to find all dependencies the same way we tell rustc? I would expect so...but maybe it's falling back to some other behavior and scraping things off the file system?)

Perhaps part of it is that I am a bit removed from the details of how a lot of this lower level stuff works.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 28, 2016

ok, I see now that this error is not when bootstrapping.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 28, 2016

Further investigation reveals that somehow we do not seem to be supplying -C metadata except for tests. Oops. That will presumably fix this conflict, though not in the best possible way -- because now the makefile libc will have a disambiguator, so the rustdoc version would have a disambiguator of just "" and everybody is happy.

That said, it seems to me that rustdoc should take a -C metadata argument -- presumably it should take the same arguments as rustc, since it basically invokes rustc.

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Mar 28, 2016

Cargo isn't passing -C metadata to rustdoc (because it can't)

@alexcrichton Can you elaborate on that?

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Mar 28, 2016

I believe this is fixed in #32560, explained here: #32560 (comment).

To elaborate on the lack of metadata, rustdoc simply doesn't accept -C flags, so that's why it's not being passed :)

bors added a commit that referenced this issue Mar 28, 2016

Auto merge of #32560 - alexcrichton:metadata-for-our-crates, r=nikoma…
…tsakis

mk: Add `-C metadata` for compiling crates we ship

This should re-enable all external builds of crates with the same name. Right
now Cargo doesn't pass `-C metadata` for the top-level library being compiled,
so if that library is called `libc`, for example, then it won't be able to link
to the standard library which *also* has a `libc` library compiled without `-C
metadata`. This can result in naming conflicts which need to be resolved.

By passing `-C metadata` to the in-tree crates we ship it should add some extra
salt to all symbol names to ensure that they don't collide.

Closes #32532

@bors bors closed this in #32560 Mar 28, 2016

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 29, 2016

@alexcrichton did you actually check whether this is fixed? I wonder if it's worth trying to allow rustdoc to accept -C metadata -- I guess so long as it doesn't matter, it doesn't matter.

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Mar 29, 2016

Nah I was hoping to test with today's nightly, but that's blocked on #32568. I'm pretty confident that the change would fix this, however.

@paukul

This comment has been minimized.

Copy link

paukul commented Mar 30, 2016

FYI rustc 1.9.0-nightly (b678600 2016-03-29) fixed this issue for me

mattico added a commit to mattico/rustup.rs that referenced this issue May 12, 2017

Re-enable doc uploading on travis
rust-lang/rust#32532 is fixed, so this might work now. Let's find out.

bors added a commit to rust-lang/rustup.rs that referenced this issue May 18, 2017

Auto merge of #1115 - mattico:try-travis-doc-fixme, r=Diggsey
Re-enable doc uploading on travis

rust-lang/rust#32532 is fixed, so this might work now. Let's find out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.