[Pkg-rust-maintainers] Build fails with "found two different crates with name `std`"

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Fri Feb 16 13:46:22 UTC 2018


Hi!

With Rust 1.24, we finally have a working Rust compiler for sparc64 that
can be used to fully build Rust natively as well as Cargo, Firefox and
Thunderbird.

Since I am a bit unpatient and couldn't wait for Ximin packaging version
1.24, I have quickly hacked together a 1.24 version of the Debian package
which I am testing now.

To test the compiler, I tried building the src:cargo Debian package which
unfortunately fails with the following error about the "std" crate being
installed twice:

    Compiling serde_ignored v0.0.4
      Running `rustc --crate-name semver debian/../vendor/semver-0.8.0/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="serde"' -C metadata=1e1513ad820647aa -C extra-filename=-1e151
3ad820647aa --out-dir /<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps --target sparc64-unknown-linux-gnu -L dependency=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps -L dependency=/<<PKGBUILDDIR>>/target/re
lease/deps --extern semver_parser=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps/libsemver_parser-953beb3adfc85e04.rlib --extern serde=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps/libserde-294aa357667cfd
45.rlib --cap-lints allow -C linker=sparc64-l
inux-gnu-gcc -C link-arg=-Wl,-z,relro -C linker=sparc64-linux-gnu-gcc -C link-arg=-Wl,-z,relro`
      Running `rustc --crate-name serde_json debian/../vendor/serde_json-1.0.9/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' -C metadata=55012c04b9eae0ec -C extra-filename=-55012c04b9eae0ec --out-dir /<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps --target sparc64-unknown-linux-gnu -L dependency=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps -L dependency=/<<PKGBUILDDIR>>/target/release/deps --extern itoa=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps/libitoa-03bceb7ca2f4ca62.rlib --extern serde=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps/libserde-294aa357667cfd45.rlib --extern num_traits=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps/libnum_traits-24fe277dd6c28cab.rlib --extern dtoa=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps/libdtoa-ab3e5793a4a0b2f9.rlib --cap-lints allow -C linker=sparc64-linux-gnu-gcc -C link-arg=-Wl,-z,relro -C linker=sparc64-linux-gnu-gcc -C link-arg=-Wl,-z,relro`
      Running `rustc --crate-name toml debian/../vendor/toml-0.4.5/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=e7008594a7f900d2 -C extra-filename=-e7008594a7f900d2 --out-dir /<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps --target sparc64-unknown-linux-gnu -L dependency=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps -L dependency=/<<PKGBUILDDIR>>/target/release/deps --extern serde=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps/libserde-294aa357667cfd45.rlib --cap-lints allow -C linker=sparc64-linux-gnu-gcc -C link-arg=-Wl,-z,relro -C linker=sparc64-linux-gnu-gcc -C link-arg=-Wl,-z,relro`
      Running `rustc --crate-name serde_ignored debian/../vendor/serde_ignored-0.0.4/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=15aad8e6e2bc90d6 -C extra-filename=-15aad8e6e2bc90d6 --out-dir /<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps --target sparc64-unknown-linux-gnu -L dependency=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps -L dependency=/<<PKGBUILDDIR>>/target/release/deps --extern serde=/<<PKGBUILDDIR>>/target/sparc64-unknown-linux-gnu/release/deps/libserde-294aa357667cfd45.rlib --cap-lints allow -C linker=sparc64-linux-gnu-gcc -C link-arg=-Wl,-z,relro -C linker=sparc64-linux-gnu-gcc -C link-arg=-Wl,-z,relro`
    Compiling serde_derive v1.0.27
      Running `rustc --crate-name serde_derive debian/../vendor/serde_derive-1.0.27/src/lib.rs --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C opt-level=3 --cfg 'feature="default"' -C metadata=5681fff4cb41ea4e -C extra-filename=-5681fff4cb41ea4e --out-dir /<<PKGBUILDDIR>>/target/release/deps -L dependency=/<<PKGBUILDDIR>>/target/release/deps --extern syn=/<<PKGBUILDDIR>>/target/release/deps/libsyn-c65b50d251943a1d.rlib --extern serde_derive_internals=/<<PKGBUILDDIR>>/target/release/deps/libserde_derive_internals-38ec8d0bf228f61c.rlib --extern quote=/<<PKGBUILDDIR>>/target/release/deps/libquote-29968ff2d9079157.rlib --cap-lints allow`
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.
   --> debian/../vendor/serde_derive-1.0.27/src/lib.rs:37:1
    |
37 | extern crate proc_macro;
    | ^^^^^^^^^^^^^^^^^^^^^^^^

error: Could not compile `serde_derive`.

Caused by:
   process didn't exit successfully: `rustc --crate-name serde_derive debian/../vendor/serde_derive-1.0.27/src/lib.rs --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C opt-level=3 --cfg feature="default" -C metadata=5681fff4cb41ea4e -C extra-filename=-5681fff4cb41ea4e --out-dir /<<PKGBUILDDIR>>/target/release/deps -L dependency=/<<PKGBUILDDIR>>/target/release/deps --extern syn=/<<PKGBUILDDIR>>/target/release/deps/libsyn-c65b50d251943a1d.rlib --extern serde_derive_internals=/<<PKGBUILDDIR>>/target/release/deps/libserde_derive_internals-38ec8d0bf228f61c.rlib --extern quote=/<<PKGBUILDDIR>>/target/release/deps/libquote-29968ff2d9079157.rlib --cap-lints allow` (exit code: 101)
warning: build failed, waiting for other jobs to finish...
error: build failed
make[1]: *** [debian/rules:64: override_dh_auto_build-arch] Error 101
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:35: build-arch] Error 2
dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit status 2

I have thoroughly checked the Debian packages I built and compared them with
the 1.23 versions of the package and couldn't find any obvious problems.

Doing a websearch on the issue reveals some problem reports in the past by others,
but there is never an obvious solution for the issue:

> https://github.com/m4b/bingrep/issues/8
> https://github.com/rust-lang/rust/issues/35636
> https://github.com/ANSSI-FR/Binacle/issues/3
> https://github.com/jwilm/alacritty/issues/676
> https://bugs.launchpad.net/ubuntu/+source/rustc/+bug/1676169

Anyone knows where the problem might be? Is Cargo too old?

Adrian

-- 
  .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
   `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


More information about the Pkg-rust-maintainers mailing list