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

ripgrep fails to build with MUSL on Linux since the nightly release on 2019-03-15 #59411

Closed
BurntSushi opened this issue Mar 25, 2019 · 30 comments · Fixed by #59886
Closed

ripgrep fails to build with MUSL on Linux since the nightly release on 2019-03-15 #59411

BurntSushi opened this issue Mar 25, 2019 · 30 comments · Fixed by #59886
Assignees
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@BurntSushi
Copy link
Member

The last successful build was with the Rust nightly released on 2019-03-14 (bc44841): https://travis-ci.org/BurntSushi/ripgrep/jobs/506631861

The first failing build was with the Rust nightly released on 2019-03-15 (52e8856): https://travis-ci.org/BurntSushi/ripgrep/jobs/507121811

There weren't any changes on my end. (Last commit to ripgrep master was 2019-03-03.)

Here's the pertinent error:

  = note: /usr/bin/ld: elf.o: access beyond end of merged section (3688)
          /usr/bin/ld: elf.o: access beyond end of merged section (2343)
          /usr/bin/ld: elf.o: access beyond end of merged section (2627)
          /usr/bin/ld: elf.o: access beyond end of merged section (3203)
          /usr/bin/ld: elf.o: access beyond end of merged section (2765)
          /usr/bin/ld: elf.o: access beyond end of merged section (1902)
          /usr/bin/ld: elf.o: access beyond end of merged section (3186)
          /usr/bin/ld: elf.o: access beyond end of merged section (3953)
          /usr/bin/ld: elf.o: access beyond end of merged section (2724)
          /usr/bin/ld: elf.o: access beyond end of merged section (3971)
          /usr/bin/ld: elf.o: access beyond end of merged section (3393)
          /usr/bin/ld: elf.o: access beyond end of merged section (3965)
          /usr/bin/ld: elf.o: access beyond end of merged section (2006)
          /usr/bin/ld: elf.o: access beyond end of merged section (3529)
          /usr/bin/ld: elf.o: access beyond end of merged section (2612)
          /usr/bin/ld: elf.o: access beyond end of merged section (2543)
          /usr/bin/ld: elf.o: access beyond end of merged section (3427)
          /usr/bin/ld: elf.o: access beyond end of merged section (2429)
          /usr/bin/ld: elf.o: access beyond end of merged section (3119)
          /usr/bin/ld: elf.o: access beyond end of merged section (2494)
          /usr/bin/ld: elf.o: access beyond end of merged section (2895)
          /usr/bin/ld: elf.o: access beyond end of merged section (3151)
          /usr/bin/ld: elf.o: access beyond end of merged section (3936)
          /usr/bin/ld: elf.o: access beyond end of merged section (3876)
          /usr/bin/ld: elf.o: access beyond end of merged section (2221)
          /usr/bin/ld: elf.o: access beyond end of merged section (4090)
          /usr/bin/ld: elf.o: access beyond end of merged section (3652)
          /usr/bin/ld: elf.o: access beyond end of merged section (3028)
          /usr/bin/ld: elf.o: access beyond end of merged section (2734)
          /usr/bin/ld: elf.o: access beyond end of merged section (3928)
          /usr/bin/ld: elf.o: access beyond end of merged section (2422)
          /usr/bin/ld: elf.o: access beyond end of merged section (2021)
          /usr/bin/ld: elf.o: access beyond end of merged section (4111)
          /usr/bin/ld: elf.o: access beyond end of merged section (1866)
          /usr/bin/ld: elf.o: access beyond end of merged section (1944)
          /usr/bin/ld: elf.o: access beyond end of merged section (2179)
          /usr/bin/ld: elf.o: access beyond end of merged section (2028)
          /usr/bin/ld: elf.o: access beyond end of merged section (3919)
          /usr/bin/ld: elf.o: access beyond end of merged section (2294)
          /usr/bin/ld: elf.o: access beyond end of merged section (2793)
          /usr/bin/ld: elf.o: access beyond end of merged section (2317)
          /usr/bin/ld: elf.o: access beyond end of merged section (2939)
          /usr/bin/ld: elf.o: access beyond end of merged section (2371)
          /usr/bin/ld: elf.o: access beyond end of merged section (2468)
          /usr/bin/ld: elf.o: access beyond end of merged section (4122)
          /usr/bin/ld: elf.o: access beyond end of merged section (3248)
          /usr/bin/ld: elf.o: access beyond end of merged section (4054)
          /usr/bin/ld: elf.o: access beyond end of merged section (3546)
          /usr/bin/ld: elf.o: access beyond end of merged section (1959)
          /usr/bin/ld: elf.o: access beyond end of merged section (3994)
          /usr/bin/ld: elf.o: access beyond end of merged section (1954)
          /usr/bin/ld: elf.o: access beyond end of merged section (4148)
          /usr/bin/ld: elf.o: access beyond end of merged section (4079)
          /usr/bin/ld: elf.o: access beyond end of merged section (3584)
          /usr/bin/ld: elf.o: access beyond end of merged section (2186)
          /usr/bin/ld: elf.o: access beyond end of merged section (2715)
          /usr/bin/ld: elf.o: access beyond end of merged section (3829)
          /usr/bin/ld: elf.o: access beyond end of merged section (3401)
          /usr/bin/ld: elf.o: access beyond end of merged section (3668)
          /usr/bin/ld: elf.o: access beyond end of merged section (3898)
          /usr/bin/ld: elf.o: access beyond end of merged section (1926)
          /usr/bin/ld: elf.o: access beyond end of merged section (2049)
          /usr/bin/ld: elf.o: access beyond end of merged section (2271)
          /usr/bin/ld: elf.o: access beyond end of merged section (3297)
          /usr/bin/ld: elf.o: access beyond end of merged section (3539)
          /usr/bin/ld: elf.o: access beyond end of merged section (3615)
          /usr/bin/ld: elf.o: access beyond end of merged section (3195)
          /usr/bin/ld: elf.o: access beyond end of merged section (2824)
          /usr/bin/ld: elf.o: access beyond end of merged section (1988)
          /usr/bin/ld: elf.o: access beyond end of merged section (2460)
          /usr/bin/ld: elf.o: access beyond end of merged section (3257)
          /usr/bin/ld: elf.o: access beyond end of merged section (3570)
          /usr/bin/ld: elf.o: access beyond end of merged section (2968)
          /usr/bin/ld: elf.o: access beyond end of merged section (2255)
          /usr/bin/ld: elf.o: access beyond end of merged section (2041)
          /usr/bin/ld: elf.o: access beyond end of merged section (2857)
          /usr/bin/ld: elf.o: access beyond end of merged section (4098)
          /usr/bin/ld: elf.o: access beyond end of merged section (1977)
          /usr/bin/ld: elf.o: access beyond end of merged section (4127)
          /usr/bin/ld: elf.o: access beyond end of merged section (3240)
          /usr/bin/ld: elf.o: access beyond end of merged section (2603)
          /usr/bin/ld: elf.o: access beyond end of merged section (2618)
          /usr/bin/ld: elf.o: access beyond end of merged section (3625)
          /usr/bin/ld: elf.o: access beyond end of merged section (3652)
          /usr/bin/ld: elf.o: access beyond end of merged section (4061)
          /usr/bin/ld: elf.o: access beyond end of merged section (3041)
          /usr/bin/ld: elf.o: access beyond end of merged section (3660)
          /usr/bin/ld: elf.o: access beyond end of merged section (2396)
          /usr/bin/ld: elf.o: access beyond end of merged section (3332)
          /usr/bin/ld: elf.o: access beyond end of merged section (2988)
          /usr/bin/ld: elf.o: access beyond end of merged section (1996)
          /usr/bin/ld: elf.o: access beyond end of merged section (2382)
          /usr/bin/ld: elf.o: access beyond end of merged section (3866)
          /usr/bin/ld: elf.o: access beyond end of merged section (2124)
          /usr/bin/ld: elf.o: access beyond end of merged section (3051)
          /usr/bin/ld: elf.o: access beyond end of merged section (3041)
          /usr/bin/ld: elf.o: access beyond end of merged section (3232)
          /usr/bin/ld: elf.o: access beyond end of merged section (2124)
          /usr/bin/ld: elf.o: access beyond end of merged section (2583)
          /usr/bin/ld: elf.o: access beyond end of merged section (4273)
          /usr/bin/ld: elf.o: access beyond end of merged section (3036)
          /usr/bin/ld: elf.o: access beyond end of merged section (2124)
          /usr/bin/ld: elf.o: access beyond end of merged section (4003)
          /usr/bin/ld: elf.o: access beyond end of merged section (3478)
          /usr/bin/ld: elf.o: access beyond end of merged section (3158)
          /usr/bin/ld: elf.o: access beyond end of merged section (3320)
          /usr/bin/ld: elf.o: access beyond end of merged section (4148)
          /usr/bin/ld: elf.o: access beyond end of merged section (2203)
          /usr/bin/ld: elf.o: access beyond end of merged section (3883)
          /usr/bin/ld: elf.o: access beyond end of merged section (3501)
          /usr/bin/ld: elf.o: access beyond end of merged section (3320)
          /usr/bin/ld: elf.o: access beyond end of merged section (4148)
          /usr/bin/ld: elf.o: access beyond end of merged section (2203)
          /usr/bin/ld: elf.o: access beyond end of merged section (4203)
          /usr/bin/ld: elf.o: access beyond end of merged section (1888)
          /usr/bin/ld: elf.o: access beyond end of merged section (2228)
          /usr/bin/ld: elf.o: access beyond end of merged section (2124)
          /usr/bin/ld: elf.o: access beyond end of merged section (2197)
          /usr/bin/ld: elf.o: access beyond end of merged section (4251)
          /usr/bin/ld: elf.o: access beyond end of merged section (4203)
          /usr/bin/ld: elf.o: access beyond end of merged section (2203)
          /usr/bin/ld: elf.o: access beyond end of merged section (3320)
          /usr/bin/ld: elf.o: access beyond end of merged section (4148)
          /usr/bin/ld: elf.o: access beyond end of merged section (2203)
          /usr/bin/ld: elf.o: access beyond end of merged section (3909)
          /usr/bin/ld: elf.o: access beyond end of merged section (3062)
          /usr/bin/ld: elf.o: access beyond end of merged section (2265)
          /usr/bin/ld: elf.o: access beyond end of merged section (3221)
          /usr/bin/ld: elf.o: access beyond end of merged section (2801)
          /usr/bin/ld: elf.o: access beyond end of merged section (2067)
          /usr/bin/ld: elf.o: access beyond end of merged section (3284)
          /usr/bin/ld: elf.o: access beyond end of merged section (3978)
          /usr/bin/ld: elf.o: access beyond end of merged section (3016)
          /usr/bin/ld: elf.o: access beyond end of merged section (2404)
          /usr/bin/ld: elf.o: access beyond end of merged section (4135)
          /usr/bin/ld: elf.o: access beyond end of merged section (2774)
          /usr/bin/ld: elf.o: access beyond end of merged section (2325)
          /usr/bin/ld: elf.o: access beyond end of merged section (2302)
          /usr/bin/ld: elf.o: access beyond end of merged section (3845)
          /usr/bin/ld: elf.o: access beyond end of merged section (4068)
          /usr/bin/ld: elf.o: access beyond end of merged section (2952)
          /usr/bin/ld: elf.o: access beyond end of merged section (4021)
          /usr/bin/ld: elf.o: access beyond end of merged section (2162)
          /usr/bin/ld: elf.o: access beyond end of merged section (3354)
          /usr/bin/ld: elf.o: access beyond end of merged section (2012)
          /usr/bin/ld: elf.o: access beyond end of merged section (3683)
          /usr/bin/ld: elf.o: access beyond end of merged section (2963)
          /usr/bin/ld: elf.o: access beyond end of merged section (2963)
          /usr/bin/ld: elf.o: access beyond end of merged section (2460)
          /usr/bin/ld: elf.o: access beyond end of merged section (3041)
          /usr/bin/ld: elf.o: access beyond end of merged section (3067)
          /usr/bin/ld: elf.o: access beyond end of merged section (3441)
          /usr/bin/ld: elf.o: access beyond end of merged section (2073)
          /usr/bin/ld: elf.o: access beyond end of merged section (3461)
          /usr/bin/ld: elf.o: access beyond end of merged section (2531)
          /usr/bin/ld: /home/travis/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace_sys-76fed535951a06b4.rlib(elf.o)(.debug_info+0x1af8): reloc against `.text.elf_add': error 2
          /usr/bin/ld: final link failed: Nonrepresentable section on output
          collect2: error: ld returned 1 exit status

Unfortunately, I can't seem to reproduce this on my local system. One possible difference between my local system (Archlinux) and the Ubuntu CI on Travis is that Ubuntu might be using an older version of musl-gcc via the musl-tools package. I have musl 1.1.21 locally. According to the logs in the link above, CI is using musl 0.9.15 (for both the last successful build and the first failing build).

@jonas-schievink jonas-schievink added A-linkage Area: linking into static, shared libraries and binaries I-nominated regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Mar 25, 2019
@svenstaro
Copy link

Exactly the same problem with exactly the same setup here: https://travis-ci.org/svenstaro/miniserve/jobs/510971585

@svenstaro
Copy link

Works fine with dist: xenial: https://travis-ci.org/svenstaro/miniserve/builds/511554891

@jannic
Copy link
Contributor

jannic commented Mar 26, 2019

I get the same error message for cargo +nightly run --target=x86_64-unknown-linux-musl on a new hello-world project (as generated by cargo new).
This is on debian jessie. (Don't ask. Need to build for old servers...)
Reproducible locally, so if I can help debugging this, please tell me where to look.

@jannic
Copy link
Contributor

jannic commented Mar 26, 2019

It looks like it depends on the version of binutils: With 2.28-5 from debian/stretch I can build the binary successfully, with 2.25-5+deb8u1 from debian/jessie I get the mentioned error.

@mati865
Copy link
Contributor

mati865 commented Mar 27, 2019

I was afraid something like that can happen when tinkering around #58575 but I was able to compile ripgrep on Alpine (native musl host) and Ubuntu (with musl target).

I'll see if I can reproduce it.

sidenote: Ubuntu 14.04 becomes EOL next month.

@mati865
Copy link
Contributor

mati865 commented Mar 27, 2019

I was able to reproduce it in Ubuntu 14.04 container and verified that #59468 fixes it.

@BurntSushi
Copy link
Member Author

@mati865 Thank you!!

@mati865
Copy link
Contributor

mati865 commented Mar 27, 2019

Sorry for breaking it, when I was testing dozen of different distros I didn't even think of running it on distro with so old binutils.

@BurntSushi
Copy link
Member Author

Yeah unfortunately Ubuntu 14.04 is the default Linux VM on Travis. :-(

@pnkfelix
Copy link
Member

triage: P-high. driveby: approving PR #59468.

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels Mar 28, 2019
@pnkfelix pnkfelix self-assigned this Mar 28, 2019
@pnkfelix
Copy link
Member

triage: assigning self since I cannot assign @mati865

Centril added a commit to Centril/rust that referenced this issue Mar 29, 2019
BurntSushi added a commit to BurntSushi/ripgrep that referenced this issue Apr 3, 2019
Rust is having problems with trusty, in particular, see this bug I
filed: rust-lang/rust#59411

This was purpotedly fixed in
rust-lang/rust#59468,
but it appears the issue is still occurring.

This commit tries to update to Ubuntu 16.04 in the hope that it will fix
this problem.
@BurntSushi
Copy link
Member Author

Did this make it into a recent nightly? It looks like the 2018-04-02 nightly is still tripping over this bug: https://travis-ci.org/BurntSushi/ripgrep/jobs/515325113

(I'm seeing about switching to xenial.)

BurntSushi added a commit to BurntSushi/ripgrep that referenced this issue Apr 3, 2019
Rust is having problems with trusty, in particular, see this bug I
filed: rust-lang/rust#59411

This was purpotedly fixed in
rust-lang/rust#59468,
but it appears the issue is still occurring.

This commit tries to update to Ubuntu 16.04 in the hope that it will fix
this problem.
@mati865
Copy link
Contributor

mati865 commented Apr 3, 2019

Weird, I reproduced it locally and tested it before opening PR. I'll look into it today (CEST time).

@mati865
Copy link
Contributor

mati865 commented Apr 4, 2019

I can easily reproduce it installing toolchain with rustup but when I install freshly build toolchains using Dockerfiles I cannot reproduce it no matter how hard I try.

I'll try few ideas using builds from Rust and report here in a few days.

@mati865
Copy link
Contributor

mati865 commented Apr 5, 2019

The issue only manifests when building with src/ci/run.sh and DEPLOY is set to something, building with src/ci/run.sh without environment variables produces working libraries.

Technical informations:
There are 2 libbacktrace_sys-<hash>.rlib: one from stage1-rustc and another one from stage1-std.
Their sizes are interesting:

  • without DEPLOY (no errors):
    • stage1-rustc: 85,2 KiB
    • stage1-std: 85,3 KiB
  • with DEPLOY=1 (link errors):
    • stage1-rustc: 85,2 KiB
    • stage1-std: 397,4 KiB
      I'll try upgrading musl but I'm not convinced it will help.

After some digging I found this line to cause the problem:

RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL"

cc @alexcrichton can I ask you for some directions where I should look or how long those old platforms should be supported?

@alexcrichton
Copy link
Member

@mati865 we don't really have a hard-and-fast policy, but rather "we keep things working as long as it's reasonable". If it's not reasonable to keep supporting something then we can explicitly evaluate at that time if it feels right to drop.

@mati865
Copy link
Contributor

mati865 commented Apr 9, 2019

I've tried pushing -fPIC harder when building C toolchain, upgrading musl to 1.1.21, GCC to 6.5.0 and even downgrading binutils to 2.25.1 (long time ago backward compatibility broke when binutils were upgraded to 2.26).
Without success.

Disabling this makes libraries compatible with older buintuils:

let default = match &config.channel[..] {
"stable" | "beta" | "nightly" => true,
_ => false,
};
config.rust_debuginfo_lines = debuginfo_lines.unwrap_or(default);
config.rust_debuginfo_only_std = debuginfo_only_std.unwrap_or(default);
config.rust_debuginfo_tools = debuginfo_tools.unwrap_or(false);

Noticed one more thing, before #58575 there was single rust-std-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace_sys-<hash>.rlib sized 526,3 KiB.
After that PR there are two libbacktrace_sys-<hash>.rlib with sizes: 85,2 KiB and 397,4 KiB. The bigger one causes linking issues.

@alexcrichton
Copy link
Member

I'm pretty lost here myself so I don't think I can really provide much guidance. I don't even know if this is still an open or closed issue, or if we're looking to go beyond what's already in-tree. Could a summary be redone of what's currently happening?

@BurntSushi
Copy link
Member Author

It probably should be reopened. The short description is that musl builds are failing on Ubuntu Trusty, which is the default Linux environment on Travis.

@mati865
Copy link
Contributor

mati865 commented Apr 10, 2019

It still fails with errors from the first comment.

First time I tried to fix it with #59468 it worked on my machine but nightly builds were still broken.

Later I discovered it happens only on nightly and not on dev builds and narrowed it to those lines (this time reproduced the error with locally built compiler).

I've tried forcing -fPIC for building GCC and musl, upgrading musl to 1.1.21, GCC to 6.5.0 and even downgrading binutils to 2.25.1 (latest release that should be compatible with older binutils) but nothing helped.


Before #58575 (introduction of musl host toolchain) there was single rust-std-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace_sys-<hash>.rlib with size 526,3 KiB.

After #58575 there are two libbacktrace_sys-<hash>.rlib in rust-std-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib coming from different parts of Rust.
Their size differs whether debuginfo is enabled or not:

  • no debuginfo (aka dev build, no errors):

    • libbacktrace_sys-<hash>.rlib from stage1-rustc: 85,2 KiB
    • libbacktrace_sys-<hash>.rlib from stage1-std: 85,3 KiB
  • debuginfo (aka nightly build, link errors):

    • libbacktrace_sys-<hash>.rlib from stage1-rustc: 85,2 KiB
    • libbacktrace_sys-<hash>.rlib from stage1-std: 397,4 KiB - this one is causing issues

@alexcrichton
Copy link
Member

Ok so instead of

@alexcrichton alexcrichton reopened this Apr 10, 2019
@alexcrichton
Copy link
Member

er,

Ok instead of golfing versions for various tools, it looks like a "hello world" fails in 14.04 and succeeds in 16.04 (ubuntu). The main difference here is binutils that we're interested in, and it jumped from 2.19 to 2.23 in those two revisions. I wasn't able to quickly test any other versions of binutils, but reading the changelog turns up:

...
Changes in 2.23:

* Enable compressed debug section feature for x86/x86_64 pe-coff.
...

I suspect that's what's happening here where binutils in Ubuntu 14.04 didn't understand compressed debug sections but in Ubuntu 16.04 it does. Presumably at some point in our toolchain we're producing compressed debug sections either by accident or as part of some build script.

My guess is that either the upgraded version of gcc turns it on by default or musl does or something like that. We probably need to figure out where -Wl,--compress-debug-sections -Wl,none needs to be passed through CFLAGS (or maybe it's just doing that through CFLAGS)

@alexcrichton
Copy link
Member

It also looks like --nocompress-debug-sections may be the gcc flag to pass through. @mati865 can you test passing that to the musl toolchain build and see if it fixes the issue?

@mati865
Copy link
Contributor

mati865 commented Apr 10, 2019

😕
Ubuntu 14.04 uses binutils 2.24 and 16.04 uses binutils 2.26.


  • Enable compressed debug section feature for x86/x86_64 pe-coff.

Musl is ELF just like glibc, PE/COFF is for MinGW.

@alexcrichton
Copy link
Member

Ah oops I was looking at glibc versions rather than binutils versions. That being said I think it's ironically the same culprit:

Changes in 2.26:

...

* New command-line option for ELF targets to compress DWARF debug
  sections, --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi].

@mati865
Copy link
Contributor

mati865 commented Apr 10, 2019

As I said earlier I tried switching musl-toolchain.sh to use binutils 2.25.1 and I'm quite confident it was picked because I've got errors saying -Wa,-mrelax-relocations=no is invaild.
I'll try tomorrow if Rust didn't accidentally pick binutils from system instead of musl-toolchain but it seems unlikely.

You can ping me on Discord BTW.

@alexcrichton
Copy link
Member

@mati865 this isn't an aspect of binutils or such to build the toolchain, it has to do with the binaries we're producing using features that aren't supported by older toolchains. It doesn't matter what we build the musl toolchain with so much as how we build it.

Using nightly-2019-03-15 compiling hello world works, using 2019-03-16 fails. Inspecting gets us:

$ llvm-dwarfdump `rustc +nightly-2019-03-15 --print sysroot`/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace_sys-* > /dev/null
error: /home/alex/.rustup/toolchains/nightly-2019-03-15-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace_sys-c3c54ad8d35f7169.rlib(rust.metadata.bin): The end of the file was unexpectedly encountered

$ llvm-dwarfdump /home/alex/.rustup/toolchains/nightly-2019-03-16-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libbacktrace_sys-76fed535951a06b4.rlib > /dev/null
...
error: failed to decompress '.debug_ranges', zlib is not available
error: failed to decompress '.debug_line', zlib is not available
error: failed to decompress '.debug_str', zlib is not available
error: failed to decompress '.debug_info', zlib is not available
error: failed to decompress '.debug_abbrev', zlib is not available
error: failed to decompress '.debug_loc', zlib is not available
error: failed to decompress '.debug_aranges', zlib is not available
error: failed to decompress '.debug_ranges', zlib is not available
error: failed to decompress '.debug_line', zlib is not available
error: failed to decompress '.debug_str', zlib is not available
error: failed to decompress '.debug_info', zlib is not available
error: failed to decompress '.debug_abbrev', zlib is not available
error: failed to decompress '.debug_loc', zlib is not available
error: failed to decompress '.debug_ranges', zlib is not available
error: failed to decompress '.debug_line', zlib is not available
error: failed to decompress '.debug_str', zlib is not available
error: failed to decompress '.debug_info', zlib is not available
error: failed to decompress '.debug_abbrev', zlib is not available
error: failed to decompress '.debug_loc', zlib is not available
error: failed to decompress '.debug_aranges', zlib is not available
error: failed to decompress '.debug_line', zlib is not available
error: failed to decompress '.debug_str', zlib is not available
error: failed to decompress '.debug_info', zlib is not available
error: failed to decompress '.debug_abbrev', zlib is not available
error: failed to decompress '.debug_loc', zlib is not available
error: failed to decompress '.debug_aranges', zlib is not available
error: failed to decompress '.debug_ranges', zlib is not available
error: failed to decompress '.debug_line', zlib is not available
error: failed to decompress '.debug_str', zlib is not available
...

This seems highly likely to be related to compression of debuginfo at least, if not more aspects of the binaries.

@mati865
Copy link
Contributor

mati865 commented Apr 10, 2019

That looks clearer.

I assumed it would use binutils from musl-toolchain because we point Rust to use GCC from it:

CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \

I can try to point it to musl-toolchain binutils 2.25.1 or disable compression, whatever you like and open PR tomorrow (or reply here if it doesn't help).

@sfackler sfackler added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Apr 11, 2019
@sfackler
Copy link
Member

This has slipped to beta now I believe.

@mati865
Copy link
Contributor

mati865 commented Apr 11, 2019

/usr/local/bin/x86_64-linux-musl-gcc calls

/usr/local/bin/../lib/gcc/x86_64-linux-musl/6.3.0/../../../../x86_64-linux-musl/bin/as -v --64 -o /tmp/ccdt44wi.o /tmp/ccKflwB5.s
GNU assembler version 2.27 (x86_64-linux-musl) using BFD version (GNU Binutils) 2.27

so my downgrade to binutils 2.25.1 should have fixed this. Probably Rust's build systems at some point calls gcc to build musl libs.

Anyway disabling debug sections compression fixed the issue:

root@d49f02ca0f13:/foo# cargo build --target x86_64-unknown-linux-musl 
   Compiling foo v0.1.0 (/foo)
    Finished dev [unoptimized + debuginfo] target(s) in 0.25s
root@d49f02ca0f13:/foo# target/x86_64-unknown-linux-musl/debug/foo 
Hello, world!
root@d49f02ca0f13:/foo# cargo build --target x86_64-unknown-linux-musl --release
   Compiling foo v0.1.0 (/foo)
    Finished release [optimized] target(s) in 0.17s

@alexcrichton thank you for help!

bors added a commit that referenced this issue Apr 12, 2019
musl: do not compress debug section

This should be beta nominated.

Fixes #59411 (this time for real).

Test with `DEPLOY=1 ./src/ci/docker/run.sh dist-x86_64-musl`, without `DEPLOY=1` libs are built without debuginfo.

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants