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

[regression] [1.24] extern crate proc_macro: found two different crates with name std that are not distinguished by differing -C metadata #48319

Closed
ignatenkobrain opened this issue Feb 18, 2018 · 18 comments
Labels
C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ignatenkobrain
Copy link

serde_derive, pest_derive, structopt-derive, synstructure started to fail after 1.24 update.

+ cd failure-0.1.1
+ /usr/bin/cargo build --release -j6
   Compiling cfg-if v0.1.2
   Compiling quote v0.3.15
   Compiling libc v0.2.36
   Compiling rustc-demangle v0.1.5
   Compiling unicode-xid v0.1.0
   Compiling cc v1.0.4
     Running `/usr/bin/rustc --crate-name cfg_if /usr/share/cargo/registry/cfg-if-0.1.2/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=e27bb8a7fefcdf94 -C extra-filename=-e27bb8a7fefcdf94 --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
     Running `/usr/bin/rustc --crate-name quote /usr/share/cargo/registry/quote-0.3.15/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=55dfbf3bfa6cd08c -C extra-filename=-55dfbf3bfa6cd08c --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
     Running `/usr/bin/rustc --crate-name libc /usr/share/cargo/registry/libc-0.2.36/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=9907f5ff826b6a75 -C extra-filename=-9907f5ff826b6a75 --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
     Running `/usr/bin/rustc --crate-name rustc_demangle /usr/share/cargo/registry/rustc-demangle-0.1.5/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=c14b1a6750703d97 -C extra-filename=-c14b1a6750703d97 --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
     Running `/usr/bin/rustc --crate-name unicode_xid /usr/share/cargo/registry/unicode-xid-0.1.0/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' -C metadata=8f9d4fd36400d3ec -C extra-filename=-8f9d4fd36400d3ec --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
     Running `/usr/bin/rustc --crate-name cc /usr/share/cargo/registry/cc-1.0.4/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=553124dc5d259bf2 -C extra-filename=-553124dc5d259bf2 --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
   Compiling synom v0.11.3
     Running `/usr/bin/rustc --crate-name synom /usr/share/cargo/registry/synom-0.11.3/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=c40335ae69374335 -C extra-filename=-c40335ae69374335 --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --extern unicode_xid=/builddir/build/BUILD/failure-0.1.1/target/release/deps/libunicode_xid-8f9d4fd36400d3ec.rlib --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
   Compiling syn v0.11.11
     Running `/usr/bin/rustc --crate-name syn /usr/share/cargo/registry/syn-0.11.11/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="quote"' --cfg 'feature="synom"' --cfg 'feature="unicode-xid"' --cfg 'feature="visit"' -C metadata=2006602e6858073d -C extra-filename=-2006602e6858073d --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --extern synom=/builddir/build/BUILD/failure-0.1.1/target/release/deps/libsynom-c40335ae69374335.rlib --extern unicode_xid=/builddir/build/BUILD/failure-0.1.1/target/release/deps/libunicode_xid-8f9d4fd36400d3ec.rlib --extern quote=/builddir/build/BUILD/failure-0.1.1/target/release/deps/libquote-55dfbf3bfa6cd08c.rlib --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
   Compiling backtrace-sys v0.1.16
     Running `/usr/bin/rustc --crate-name build_script_build /usr/share/cargo/registry/backtrace-sys-0.1.16/build.rs --crate-type bin --emit=dep-info,link -C opt-level=3 -C metadata=02984a2118605c11 -C extra-filename=-02984a2118605c11 --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/build/backtrace-sys-02984a2118605c11 -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --extern cc=/builddir/build/BUILD/failure-0.1.1/target/release/deps/libcc-553124dc5d259bf2.rlib --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
     Running `/builddir/build/BUILD/failure-0.1.1/target/release/build/backtrace-sys-02984a2118605c11/build-script-build`
   Compiling synstructure v0.6.1
     Running `/usr/bin/rustc --crate-name synstructure /usr/share/cargo/registry/synstructure-0.6.1/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=1baf72944f677bad -C extra-filename=-1baf72944f677bad --out-dir /builddir/build/BUILD/failure-0.1.1/target/release/deps -L dependency=/builddir/build/BUILD/failure-0.1.1/target/release/deps --extern quote=/builddir/build/BUILD/failure-0.1.1/target/release/deps/libquote-55dfbf3bfa6cd08c.rlib --extern syn=/builddir/build/BUILD/failure-0.1.1/target/release/deps/libsyn-2006602e6858073d.rlib --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
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.
   --> /usr/share/cargo/registry/synstructure-0.6.1/src/lib.rs:137:1
    |
137 | extern crate proc_macro;
    | ^^^^^^^^^^^^^^^^^^^^^^^^
error: Could not compile `synstructure`.

With 1.23 everything was fine.

@Mark-Simulacrum Mark-Simulacrum added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. C-bug Category: This is a bug. labels Feb 18, 2018
@eclipseo
Copy link

I hit this bug when building Firefox Nightly with Rust 1.24 / Cargo 0.24

 3:08.54    Compiling proc-macro2 v0.2.2
 3:08.54      Running `/usr/bin/rustc --crate-name proc_macro2 /builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/third_party/rust/proc-macro2/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=2 -C codegen-units=1 -C metadata=9b6cee4c8396e152 -C extra-filename=-9b6cee4c8396e152 --out-dir /builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/objdir/toolkit/library/release/deps -C linker=/builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/build/cargo-linker -L dependency=/builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/objdir/toolkit/library/release/deps --extern unicode_xid=/builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/objdir/toolkit/library/release/deps/libunicode_xid-7cd3826576421223.rlib --cap-lints allow`
 3:08.72 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.
 3:08.72   --> /builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/third_party/rust/proc-macro2/src/lib.rs:27:1
 3:08.72    |
 3:08.72 27 | extern crate proc_macro;
 3:08.72    | ^^^^^^^^^^^^^^^^^^^^^^^^
 3:08.73 
 3:08.96 error: Could not compile `proc-macro2`.
 3:08.96 
 3:08.96 Caused by:
 3:08.97   process didn't exit successfully: `/usr/bin/rustc --crate-name proc_macro2 /builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/third_party/rust/proc-macro2/src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=2 -C codegen-units=1 -C metadata=9b6cee4c8396e152 -C extra-filename=-9b6cee4c8396e152 --out-dir /builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/objdir/toolkit/library/release/deps -C linker=/builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/build/cargo-linker -L dependency=/builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/objdir/toolkit/library/release/deps --extern unicode_xid=/builddir/build/BUILD/gecko-dev-6afe06056604b90382860b521273ea13677dc140/objdir/toolkit/library/release/deps/libunicode_xid-7cd3826576421223.rlib --cap-lints allow` (exit code: 101)```

@Mark-Simulacrum
Copy link
Member

I cannot reproduce.

$ ./cargo-curl failure 0.1.1
$ cd failure-0.1.1/
failure-0.1.1$ cargo +stable build --release
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling cc v1.0.4
   Compiling cfg-if v0.1.2
   Compiling unicode-xid v0.0.4
   Compiling quote v0.3.15
   Compiling rustc-demangle v0.1.6
   Compiling libc v0.2.36
   Compiling synom v0.11.3
   Compiling syn v0.11.11
   Compiling backtrace-sys v0.1.16
   Compiling synstructure v0.6.1
   Compiling failure_derive v0.1.1
   Compiling backtrace v0.3.5
   Compiling failure v0.1.1 (...)
    Finished release [optimized] target(s) in 11.60 secs
failure-0.1.1$ cargo +stable build --release
    Finished release [optimized] target(s) in 0.0 secs
failure-0.1.1$ touch src/lib.rs
failure-0.1.1$ cargo +stable build --release
   Compiling failure v0.1.1 (...)
    Finished release [optimized] target(s) in 0.36 secs

@eclipseo
Copy link

So I can't reproduce with a local rust 1.24 installed with rustup, but I can reproduce with system-wide rust 1.24 installed from the distro.

@cuviper
Copy link
Member

cuviper commented Feb 19, 2018

I'm looking at this from Fedora's side, to see if I can figure out what's different...

xref: https://bugzilla.redhat.com/show_bug.cgi?id=1546541

@eclipseo
Copy link

eclipseo commented Feb 19, 2018

Rust 1.24-beta is working with no issue.

@cuviper
Copy link
Member

cuviper commented Feb 19, 2018

I think this is from an unfortunate interaction from Fedora using --enable-full-bootstrap for #47469, and some lib-path hacking we're doing to reduce duplication. We currently replace every rustlib/$target/lib/libfoo.so with a symlink to /usr/lib64/libfoo.so. In a non-full-bootstrap build, those really are identical since we don't repeat stage2 builds. But with full-bootstrap, they're actually different, and the metadata will show this due to --cfg stage2.

I can reproduce this in an upstream build on master, using full-bootstrap and doing the same symlink hack on the installed binaries. I think we're ending up with a stage2 rustlib/.../libstd.rlib, next to rustlib/.../libstd.so symlinked to stage1's lib/libstd.so. And it only fails for proc-macro crates because those do link to the shared library, while still looking at the rlib too, whereas most builds only look at the rlib.

I'm not sure why this was OK in 1.23 though. I think I can fix this in our packaging, if only by backporting the fixes so we don't need full-bootstrap anymore. But I'm not sure whether there's a true lingering bug here or not...

@infinity0
Copy link
Contributor

Another person reproduced this with (his version of) Debian rustc 1.24. Setting full-bootstrap = false works around the issue. I didn't dig into the cause but we do a similar symlinking thing in Debian that cuviper describes above for Fedora.

I'd say that intuitively the hashes should remain the same whether full-bootstrap is true or false. Ensuring that builds are bit-for-bit reproducible (#34902) would solve this, but perhaps a weaker solution is also feasible.

(Originally we needed full-bootstrap = true to work around #45317, but it seems this is no longer necessary.)

@nikomatsakis nikomatsakis added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 22, 2018
@nikomatsakis
Copy link
Contributor

triage: P-medium

Seems bad -- but maybe it's a distro issue? I'm not really clear on what the problem is here.

@rust-highfive rust-highfive added the P-medium Medium priority label Feb 22, 2018
@cuviper
Copy link
Member

cuviper commented Feb 23, 2018

I tried some vanilla builds, just ./configure --enable-full-bootstrap and no other options. With 1.23, stage2/lib/libstd-*.so is bitwise identical to stage2/lib/rustlib/$TARGET/lib/libstd-*.so. With 1.24, they're different -- for instance, here's a comparison of symbols:

Diff of nm libstd-*.so
--- /dev/fd/63	2018-02-23 14:12:13.465200071 -0800
+++ /dev/fd/62	2018-02-23 14:12:13.465200071 -0800
@@ -1,4 +1,4 @@
-# nm lib/libstd-0baa2c971f4ccb5c.so
+# nm lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-0baa2c971f4ccb5c.so
 00000000003573f0 b a0
 000000000008e5de t abbrev_compare
                  U abort@@GLIBC_2.2.5
@@ -94,9 +94,9 @@
 0000000000357780 b bt2gctx_mtx
 000000000008f1a2 t build_address_map
 00000000000921d5 t build_dwarf_data
-0000000000106198 r byte_str.d.llvm.EEAD9042
+0000000000106198 r byte_str.d.llvm.36503DF5
+00000000001061a8 r byte_str.r.llvm.36503DF5
 000000000011cc90 r byte_str.r.llvm.923E2B5
-00000000001061a8 r byte_str.r.llvm.EEAD9042
 000000000009c8a0 T calloc
                  U chdir@@GLIBC_2.2.5
                  U chmod@@GLIBC_2.2.5
@@ -1992,8 +1992,8 @@
 0000000000120540 r str.K
 0000000000120bf0 r str.K
 00000000001213f0 r str.K
+000000000010619a r str.k.llvm.36503DF5
 000000000011da0a r str.k.llvm.CB56F056
-000000000010619a r str.k.llvm.EEAD9042
 000000000010619b r str.l
 0000000000106a01 r str.l
 00000000001086a8 r str.l
@@ -3446,7 +3446,7 @@
 0000000000054420 t _ZN3std4path10Components20parse_next_component17hff2f83da024cec04E
 00000000000545a0 t _ZN3std4path10Components25parse_next_component_back17h24cc113202b56701E
 0000000000053fd0 T _ZN3std4path10Components7as_path17h0d04b228bf76402dE
-0000000000053650 t _ZN3std4path10iter_after17h7fdca2ed6bc66e93E.llvm.EEAD9042
+0000000000053650 t _ZN3std4path10iter_after17h7fdca2ed6bc66e93E.llvm.36503DF5
 000000000006b950 T _ZN3std4path116_$LT$impl$u20$core..convert..From$LT$std..path..PathBuf$GT$$u20$for$u20$alloc..boxed..Box$LT$std..path..Path$GT$$GT$4from17hd780585e0c02eb23E
 000000000006b8d0 T _ZN3std4path128_$LT$impl$u20$core..convert..From$LT$$RF$$u27$a$u20$std..path..Path$GT$$u20$for$u20$alloc..boxed..Box$LT$std..path..Path$GT$$GT$4from17h7a26d38be7a35be6E
 0000000000053630 T _ZN3std4path12is_separator17h3548f102a3e1cff3E
@@ -4338,8 +4338,8 @@
 000000000005e1e0 t _ZN4core3ptr13drop_in_place17h541121f66d136e25E.llvm.BC25FA60
 000000000006eb20 t _ZN4core3ptr13drop_in_place17h555311008ccaee0fE
 000000000007d880 t _ZN4core3ptr13drop_in_place17h555311008ccaee0fE.llvm.25144215
+0000000000052ee0 t _ZN4core3ptr13drop_in_place17h555311008ccaee0fE.llvm.36503DF5
 000000000005e200 t _ZN4core3ptr13drop_in_place17h555311008ccaee0fE.llvm.BC25FA60
-0000000000052ee0 t _ZN4core3ptr13drop_in_place17h555311008ccaee0fE.llvm.EEAD9042
 0000000000081e80 t _ZN4core3ptr13drop_in_place17h56882bc0e94136f0E
 0000000000057e40 t _ZN4core3ptr13drop_in_place17h56896c36ac246072E
 00000000000452d0 t _ZN4core3ptr13drop_in_place17h56d1e78c07384cb0E
@@ -4405,6 +4405,7 @@
 00000000000454a0 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.19734A86
 000000000007d8d0 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.25144215
 00000000000688b0 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.32F9DFEF
+0000000000052f10 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.36503DF5
 00000000000649a0 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.396FC376
 000000000005ba50 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.6F4A0001
 000000000006ebe0 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.96456901
@@ -4413,7 +4414,6 @@
 0000000000086eb0 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.CE49F839
 0000000000077370 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.E9433D2E
 000000000004d300 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.EE5954C6
-0000000000052f10 t _ZN4core3ptr13drop_in_place17h84674d4557642b45E.llvm.EEAD9042
 0000000000057e70 t _ZN4core3ptr13drop_in_place17h8479cb6459d7dd11E
 000000000005a310 t _ZN4core3ptr13drop_in_place17h8479cb6459d7dd11E
 000000000005e2b0 t _ZN4core3ptr13drop_in_place17h8479cb6459d7dd11E
@@ -4647,7 +4647,7 @@
 00000000000f0340 T _ZN4core3str9Utf8Error9error_len17h4fa679c8f2b84c05E
 00000000000ff5e0 T _ZN4core4char14ParseCharError13__description17hba092e86a89c097bE
 0000000000052f80 t _ZN4core4iter8iterator8Iterator11partial_cmp17hc6415f945f50f37cE
-0000000000053150 t _ZN4core4iter8iterator8Iterator2eq17hc06fc3b18fb76179E.llvm.EEAD9042
+0000000000053150 t _ZN4core4iter8iterator8Iterator2eq17hc06fc3b18fb76179E.llvm.36503DF5
 0000000000103710 t _ZN4core4iter8iterator8Iterator3cmp17h40123d9ec9b83e4eE
 0000000000103760 t _ZN4core4iter8iterator8Iterator3cmp17h55d786bd0eb0cf41E
 0000000000053300 t _ZN4core4iter8iterator8Iterator3cmp17h7e8e76d7f12ea191E
@@ -5172,11 +5172,11 @@
 0000000000087e50 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E
 00000000000459c0 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E.llvm.19734A86
 0000000000068f70 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E.llvm.32F9DFEF
+00000000000535e0 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E.llvm.36503DF5
 00000000000652a0 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E.llvm.396FC376
 000000000004ebf0 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E.llvm.953AB2C5
 000000000005e8e0 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E.llvm.BC25FA60
 00000000000776f0 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E.llvm.E9433D2E
-00000000000535e0 t _ZN5alloc4heap8box_free17h3ab37f6f5b42fad7E.llvm.EEAD9042
 0000000000094ff0 t _ZN5alloc4heap8box_free17h4af7d14a0c769bffE.llvm.B71079D6
 00000000000459e0 t _ZN5alloc4heap8box_free17h53b024a4e4e02062E
 0000000000068f90 t _ZN5alloc4heap8box_free17h53b024a4e4e02062E.llvm.32F9DFEF
@@ -5189,11 +5189,11 @@
 0000000000087e80 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E
 00000000000459f0 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E.llvm.19734A86
 0000000000068fa0 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E.llvm.32F9DFEF
+0000000000053600 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E.llvm.36503DF5
 00000000000652c0 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E.llvm.396FC376
 000000000004ec10 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E.llvm.953AB2C5
 000000000005e900 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E.llvm.BC25FA60
 0000000000077710 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E.llvm.E9433D2E
-0000000000053600 t _ZN5alloc4heap8box_free17h5bad8505e91ef136E.llvm.EEAD9042
 00000000000652d0 t _ZN5alloc4heap8box_free17h73358ee24d154219E.llvm.396FC376
 0000000000068fb0 t _ZN5alloc4heap8box_free17h7cbcd63d1df247c9E.llvm.32F9DFEF
 0000000000045a00 t _ZN5alloc4heap8box_free17h8bfa4772367c0693E

Let me know if there's a better way I should compare these. There must be something more in the metadata that causes rustc to notice they're different, but I'm not sure how to look at that.

So the distro bug was in assuming it was safe to "deduplicate" these libraries with a symlink. The upstream bug may be the fact that these aren't actually identical -- if that's indeed supposed to be the case.

@Mark-Simulacrum
Copy link
Member

If we're enabling full bootstrap I think this is a reproducible builds issue, rather than anything else, possibly a regression. Without full bootstrap, we kind of guarantee that these are equivalent - it's not a guarantee, but in practice must be the case today at least symbol-wise since proc macros won't work otherwise.

@nikomatsakis
Copy link
Contributor

(@michaelwoerister -- can you weigh in on what @cuviper said?)

@infinity0
Copy link
Contributor

@cuviper if you upload those two files somewhere, and the corresponding rlibs if you have them, I can run diffoscope on them which runs more than just nm.

@michaelwoerister
Copy link
Member

ThinLTO seems not to be entirely deterministic and it is generally not recommended to compile dist artifacts with ThinLTO, I'd say. @alexcrichton would know more about what libraries in the build folder are supposed to be the same.

@alexcrichton
Copy link
Member

I personally haven't ever run into a case where ThinLTO is nondeterministic yet, although that doesn't mean it's deterministic!

It is true, yes, that stage1/stage2 artifacts should be identical, and if they're not that's indeed worrying! (although I don't know where that would come up...)

@pnkfelix
Copy link
Member

pnkfelix commented Mar 1, 2018

triage: leaving as P-medium and unassigned, for now.

@Mark-Simulacrum
Copy link
Member

@cuviper Could you comment if this is still an issue for distros? (Going through to triage rustbuild bugs currently)

@cuviper
Copy link
Member

cuviper commented Aug 19, 2019

It hasn't been an issue for me because I stopped using --enable-full-bootstrap. I'll try to take a look whether the suspected differences still exist in stage1/stage2 libraries.

@cuviper
Copy link
Member

cuviper commented Aug 20, 2019

I see no difference in stage1/2 libraries with --enable-full-bootstrap anymore, identical to the last bit. The original issue doesn't reproduce either.

@cuviper cuviper closed this as completed Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

10 participants