rustc (1.16.0+dfsg1-1~exp1ubuntu1) gives an error when compiling with std

Bug #1676169 reported by Maarten Fonville
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
rustc (Debian)
New
Undecided
Unassigned
rustc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

In the older versions of rust/cargo, I did not have this issue, but since upgrading to rustc (1.16.0+dfsg1-1~exp1ubuntu1) I get this error for my project:

error[E0523]: found two different crates with name `std` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two.
  --> /home/maarten/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-0.9.11/src/lib.rs:13:1
   |
13 | extern crate proc_macro;
   | ^^^^^^^^^^^^^^^^^^^^^^^^

error: Could not compile `serde_derive`.

Revision history for this message
Maarten Fonville (maarten-fonville) wrote :

Apparently it is caused by the upgrade from rustc 1.15 to 1.16, not by cargo

affects: cargo (Ubuntu) → rustc (Ubuntu)
description: updated
summary: - cargo (0.17.0-0ubuntu1) gives an error when compiling with std
+ rustc (1.16.0+dfsg1-1~exp1ubuntu1) gives an error when compiling with
+ std
Revision history for this message
Maarten Fonville (maarten-fonville) wrote :

The same applies to Debian upstream 1.16.0+dfsg1-1

Revision history for this message
Ximin Luo (infinity0) wrote :

Can you give us exact commands to reproduce it? The example in the original post looks like you're running cargo, not rustc directly. Does it still occur if you move ~/.cargo away somewhere else?

Revision history for this message
Maarten Fonville (maarten-fonville) wrote :

It happens when compiling this project: https://github.com/plietar/librespot

I tried with .cargo purged and such.
Also have tried with full updated dependencies. Always the same problem since the new rustc.

The command that is executed by cargo is:

`rustc --crate-name serde_derive /home/maarten/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.1/src/lib.rs --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C metadata=92c8521f8ef14726 -C extra-filename=-92c8521f8ef14726 --out-dir /home/maarten/Development/librespot/target/release/deps -L dependency=/home/maarten/Development/librespot/target/release/deps --extern serde_derive_internals=/home/maarten/Development/librespot/target/release/deps/libserde_derive_internals-47dabf8e52afea0a.rlib --extern quote=/home/maarten/Development/librespot/target/release/deps/libquote-f9e1361d1ff1643c.rlib --extern syn=/home/maarten/Development/librespot/target/release/deps/libsyn-0d80866437d33434.rlib --cap-lints allow`

Revision history for this message
Maarten Fonville (maarten-fonville) wrote :

I can add that rustc 1.17.0+dfsg2-1 from Debian experimental has this issue resolved

Revision history for this message
Ximin Luo (infinity0) wrote :

Thanks for the update. Unfortunately it will be a while before I can upload 1.17.0 to Debian unstable because we have some extra test failures: https://buildd.debian.org/status/package.php?p=rustc&suite=experimental

The most important ones are armhf with a SIGILL from LLVM and ppc64el also with a "Undefined temporary symbol" from LLVM, the others can just be patched out temporarily and reported upstream. Any help would be appreciated, I don't have much spare time for rustc at the moment.

Revision history for this message
Maarten Fonville (maarten-fonville) wrote :

Thanks for sharing, unfortunately I am not able to help. I have literally zero experience with rust itself, just using it for that librespot project as end-user.

To at least make your 'experimental'-branch efforts available for the Ubuntu users I created a launchpad git-import+buildrecipe task to automatically build your latest development efforts in an Ubuntu PPA: https://launchpad.net/~maarten-fonville/+archive/ubuntu/rust/+packages

Revision history for this message
Ximin Luo (infinity0) wrote :

I was the same not too long ago. :) Anyway, if anyone wants to help, the first step is to figure out the differences between Debian unstable's LLVM 3.9 and the version of LLVM that rust was using for 1.17.0, then see if any of these might be responsible for the armhf and ppc64el failures - similar to what I did in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842956.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in rustc (Ubuntu):
status: New → Confirmed
Revision history for this message
ais523 (ais523) wrote :

Same issue is happening to me. Here are minimal steps to reproduce:

Create an empty directory containing a single file "main.rs", containing the following single line:

extern crate arena;

Then, with that directory as the current directory, run:

rustc main.rs

The error is "error[E0523]: found two different crates with name `std` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two.". The use of "arena" here is not critical; any stable, public crate that's part of the standard library will do (e.g. for the original reporter, it happened with "proc_macro").

Revision history for this message
Ximin Luo (infinity0) wrote :

Can you try it with 1.18.0+dfsg1-4 from Debian unstable?

Revision history for this message
ais523 (ais523) wrote :

This bug appears to have been fixed in Ubuntu Zesty by a recent update:

Confirmed still buggy in: 1.16.0+dfsg1-1~exp1ubuntu1
Confirmed not buggy in: 1.17.0+dfsg2-8~ubuntu0.17.04.1

I'm subscribed to -backports but not -proposed. As such, updating from -backports is likely to fix the issue for anyone else who has it.

Olivier Tilloy (osomon)
Changed in rustc (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.