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

Musl host toolchain #58575

Merged
merged 13 commits into from
Mar 15, 2019
Merged

Musl host toolchain #58575

merged 13 commits into from
Mar 15, 2019

Conversation

mati865
Copy link
Contributor

@mati865 mati865 commented Feb 19, 2019

Based on #55163 and #57359
Depends on #55566

CC #57439

How it works

Tested compiler made by dist on glibc and musl based distributions and verified binaries it produces:

  • Ubuntu (glibc) - installed it as a target for host toolchain and observed no regressions for static (default) linking, dynamic linking apparently requires musl build libgcc so I didn't test it.
  • Alpine (musl) - installed as the host toolchain, by default it links statically (executables are portable and work on glibc distributions) but with -C target-feature=-crt-static Rust flag it links dynamically (executables require musl built libraries).

What's debatable

It should be decided whether this toolchain should link dynamically or statically when using it on musl distribution. I believe the distributions would prefer dynamic linking but it'd be misleading because $ARCH-unknown-linux-musl target links statically on the other hosts.
Another problem is using RUSTFLAGS='-C target-feature=-crt-static' for dynamic builds which is really uncomfortable.

To address both issues I suggest leaving $ARCH-unknown-linux-musl static for both host and cross target and introducing "alias triple" $ARCH-unknown-linux-dynmusl. It'd be the same as $ARCH-unknown-linux-musl (and use the same libraries to avoid duplication) but it'd link dynamically.

### Why it's still WIP (help wanted)

I'm having a hard time getting all tests to pass and I'd appreciate help.

Non-verbose error:

Testing proc_macro stage1 (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
error[E0463]: can't find crate for `std`

error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
[RUSTC-TIMING] proc_macro test:true 0.529
[RUSTC-TIMING] proc_macro test:false 0.530
error: Could not compile `proc_macro`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `proc_macro`.

To learn more, run the command again with --verbose.


command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-musl" "-j" "16" "--release" "--locked" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "proc_macro" "--"
expected success, got: exit code: 101


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --host x86_64-unknown-linux-musl --target x86_64-unknown-linux-musl

Verbose error:

Testing proc_macro stage1 (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
     Running `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=09ddd3ecc930ab63 -C extra-filename=-09ddd3ecc930ab63 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static`
     Running `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --emit=dep-info,link -C opt-level=2 --test -C metadata=a564d363930469c8 -C extra-filename=-a564d363930469c8 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static`
error[E0463]: can't find crate for `std`
error[E0463]: can't find crate for `std`


error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
[RUSTC-TIMING] proc_macro test:false 0.248
error: Could not compile `proc_macro`.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=09ddd3ecc930ab63 -C extra-filename=-09ddd3ecc930ab63 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] proc_macro test:true 0.248
error: Could not compile `proc_macro`.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --emit=dep-info,link -C opt-level=2 --test -C metadata=a564d363930469c8 -C extra-filename=-a564d363930469c8 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static` (exit code: 1)


command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-musl" "-j" "16" "--release" "--locked" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "--verbose" "-p" "proc_macro" "--"
expected success, got: exit code: 101


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --host x86_64-unknown-linux-musl --target x86_64-unknown-linux-musl

Whole tests non-verbose output: rust-tests.log

I think the error is because build system (correctly?) tries to use obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps which is empty but obj/build/x86_64-unknown-linux-gnu/stage1-test/x86_64-unknown-linux-musl/release/deps contains required libs.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 19, 2019
@alexcrichton
Copy link
Member

I'm gonna unsubscribe myself from this for now (sorry I don't have time to help debug this), but you can cc me back in when it's ready for review.

@mati865
Copy link
Contributor Author

mati865 commented Feb 19, 2019

No problem, could you ping somebody who you think could help with the tests?

@mati865 mati865 marked this pull request as ready for review February 28, 2019 17:46
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-musl of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:1112fb90:start=1551376132628337909,finish=1551376206664970894,duration=74036632985
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=dist-x86_64-musl
---
[00:01:32] Step 5/11 : RUN bash musl-toolchain.sh x86_64-linux-musl && rm -rf build
[00:01:32]  ---> Running in cfdc351003ce
[00:01:32] + TARGET=x86_64-linux-musl
[00:01:32] + ARCH=x86_64
[00:01:32] + OUTPUT=/usr/local
[00:01:32] + shift
[00:01:32] + git clone https://github.com/richfelker/musl-cross-make -b v0.9.7
[00:01:32] Cloning into 'musl-cross-make'...
[00:01:32] Note: checking out 'b85e29c00d35c8c8c196d6713505b837816ad47f'.
[00:01:32] 
[00:01:32] You are in 'detached HEAD' state. You can look around, make experimental
[00:01:32] changes and commit them, and you can discard any commits you make in this
[00:01:32] state without impacting any branches by performing another checkout.
[00:01:32] 
[00:01:32] If you want to create a new branch to retain commits you create, you may
[00:01:32] do so (now or later) by using -b with the checkout command again. Example:
[00:01:32] 
[00:01:32]   git checkout -b <new-branch-name>
[00:01:33] + cd musl-cross-make
[00:01:33] ++ nproc
[00:01:33] + hide_output make -j4 TARGET=x86_64-linux-musl
[00:01:33] + set +x
---
[00:10:33] Thu Feb 28 18:00:49 UTC 2019 - building ...
[00:11:03] Thu Feb 28 18:01:19 UTC 2019 - building ...
[00:11:33] Thu Feb 28 18:01:49 UTC 2019 - building ...
[00:12:03] Thu Feb 28 18:02:19 UTC 2019 - building ...
[00:12:17] musl-toolchain.sh: line 3:    20 Terminated              bash -c "while true; do sleep 30; echo \$(date) - building ...; done"
[00:12:17] + hide_output make install TARGET=x86_64-linux-musl OUTPUT=/usr/local
[00:12:32] /build
[00:12:32] musl-toolchain.sh: line 3:  6304 Terminated              bash -c "while true; do sleep 30; echo \$(date) - building ...; done"
[00:12:32] + cd -
[00:12:32] + cd -
[00:12:32] + ln -s /usr/local/x86_64-linux-musl/lib/libc.so /lib/ld-musl-x86_64.so.1
[00:12:32] + echo /usr/local/x86_64-linux-musl/lib
[00:12:32] + export CC=x86_64-linux-musl-gcc
[00:12:32] + CC=x86_64-linux-musl-gcc
[00:12:32] + export CXX=x86_64-linux-musl-g++
[00:12:32] + CXX=x86_64-linux-musl-g++
[00:12:32] + '[' '!' -d libunwind-release_70 ']'
[00:12:32] + curl -L https://github.com/llvm-mirror/llvm/archive/release_70.tar.gz
[00:12:32] + tar xzf -
[00:12:32]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
---
[00:15:39] Step 8/11 : ENV RUST_CONFIGURE_ARGS       --musl-root-x86_64=/usr/local/x86_64-linux-musl       --enable-extended       --disable-docs
[00:15:39]  ---> Running in b6e8aadbdd9f
[00:15:39] Removing intermediate container b6e8aadbdd9f
[00:15:39]  ---> c52c70957def
[00:15:39] Step 9/11 : ENV HOSTS=x86_64-unknown-linux-musl     CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc     CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++
[00:15:39] Removing intermediate container 4a166936692b
[00:15:39]  ---> dab3ca49e7f4
[00:15:39]  ---> dab3ca49e7f4
[00:15:39] Step 10/11 : ENV RUSTFLAGS="-C target-feature=-crt-static"
[00:15:39] Removing intermediate container 0f2a3d9a43e0
[00:15:39]  ---> eacc49aac209
[00:15:39] Step 11/11 : ENV SCRIPT       python2.7 ../x.py test --host $HOSTS --target $HOSTS &&       python2.7 ../x.py dist --host $HOSTS --target $HOSTS
[00:15:39]  ---> Running in 32b1d3ee1b15
[00:15:39]  ---> Running in 32b1d3ee1b15
[00:15:39] Removing intermediate container 32b1d3ee1b15
[00:15:39]  ---> bc2a6cc7f0d0
[00:15:39] Successfully built bc2a6cc7f0d0
[00:15:39] Successfully tagged rust-ci:latest
[00:15:39] Built container sha256:bc2a6cc7f0d0fd7caccbe1df84786cae3dee0e0137014f9340bb943a1dd2c7ca
[00:15:39] Uploading finished image to s3://rust-lang-ci-sccache2/docker/fd3426e13b5752ae462db71e06d5b48945a4ba81170afb8377771e78b27939ac4e9cf4cf1a6079d885d0e41b8cb27e1d6b2c067dccae190830ff6799b32ece21
[00:22:04] upload failed: - to s3://rust-lang-ci-sccache2/docker/fd3426e13b5752ae462db71e06d5b48945a4ba81170afb8377771e78b27939ac4e9cf4cf1a6079d885d0e41b8cb27e1d6b2c067dccae190830ff6799b32ece21 Unable to locate credentials

[00:22:04] travis_time:end:1545ec80:start=1551376240281674137,finish=1551377539948824997,duration=1299667150860
[CI_JOB_NAME=dist-x86_64-musl]
[00:22:04] [CI_JOB_NAME=dist-x86_64-musl]
---

[01:09:55] travis_fold:start:llvm
travis_time:start:llvm
Building LLVM for x86_64-unknown-linux-musl
[01:09:55] running: "cmake" "/checkout/src/llvm-project/llvm" "-DLLVM_ENABLE_ASSERTIONS=OFF" "-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64;Mips;PowerPC;SystemZ;MSP430;Sparc;NVPTX;Hexagon" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly;RISCV" "-DLLVM_INCLUDE_EXAMPLES=OFF" "-DLLVM_INCLUDE_TESTS=OFF" "-DLLVM_INCLUDE_DOCS=OFF" "-DLLVM_INCLUDE_BENCHMARKS=OFF" "-DLLVM_ENABLE_ZLIB=OFF" "-DWITH_POLLY=OFF" "-DLLVM_ENABLE_TERMINFO=OFF" "-DLLVM_ENABLE_LIBEDIT=OFF" "-DLLVM_PARALLEL_COMPILE_JOBS=4" "-DLLVM_TARGET_ARCH=x86_64" "-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-musl" "-DLLVM_OCAML_INSTALL_PATH=usr/lib/ocaml" "-DLLVM_ENABLE_LIBXML2=OFF" "-DCMAKE_CROSSCOMPILING=True" "-DLLVM_TABLEGEN=/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-tblgen" "-DLLVM_NATIVE_BUILD=/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build" "-DPYTHON_EXECUTABLE=/usr/bin/python2.7" "-DCMAKE_C_COMPILER_LAUNCHER=sccache" "-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" "-DCMAKE_C_COMPILER=x86_64-linux-musl-gcc" "-DCMAKE_CXX_COMPILER=x86_64-linux-musl-g++" "-DCMAKE_C_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64 -static" "-DCMAKE_CXX_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64 -static -static-libstdc++" "-DCMAKE_INSTALL_PREFIX=/checkout/obj/build/x86_64-unknown-linux-musl/llvm" "-DCMAKE_BUILD_TYPE=Release"
[01:09:55] -- The CXX compiler identification is GNU 6.3.0
[01:09:55] -- The ASM compiler identification is GNU
[01:09:55] -- Found assembler: /usr/local/bin/x86_64-linux-musl-gcc
[01:09:55] -- Check for working C compiler: /usr/local/bin/x86_64-linux-musl-gcc
---
[01:48:28] [ 73%] Building CXX object lib/Target/Mips/CMakeFiles/LLVMMipsCodeGen.dir/MipsInstructionSelector.cpp.o
[01:48:33] [ 73%] Building CXX object lib/Target/PowerPC/CMakeFiles/LLVMPowerPCCodeGen.dir/PPCMIPeephole.cpp.o
[01:48:33] [ 73%] Building CXX object lib/Target/SystemZ/CMakeFiles/LLVMSystemZCodeGen.dir/SystemZISelDAGToDAG.cpp.o
[01:48:33] [ 73%] Building CXX object lib/Target/SystemZ/CMakeFiles/LLVMSystemZCodeGen.dir/SystemZISelLowering.cpp.o
[01:48:40] /checkout/src/llvm-project/llvm/lib/Target/Mips/MipsInstructionSelector.cpp: In member function 'virtual bool {anonymous}::MipsInstructionSelector::select(llvm::MachineInstr&, llvm::CodeGenCoverage&) const':
[01:48:40] /checkout/src/llvm-project/llvm/lib/Target/Mips/MipsInstructionSelector.cpp:296:16: warning: types may not be defined in a for-range-declaration
[01:48:40]      for (const struct Instr &Instruction : Instructions) {
[01:48:40] [ 73%] Building CXX object lib/Target/Mips/CMakeFiles/LLVMMipsCodeGen.dir/MipsISelDAGToDAG.cpp.o
[01:48:42] [ 73%] Building CXX object lib/Target/PowerPC/CMakeFiles/LLVMPowerPCCodeGen.dir/PPCRegisterInfo.cpp.o
[01:48:44] [ 73%] Building CXX object lib/Target/SystemZ/CMakeFiles/LLVMSystemZCodeGen.dir/SystemZInstrInfo.cpp.o
[01:48:50] [ 73%] Building CXX object lib/Target/SystemZ/CMakeFiles/LLVMSystemZCodeGen.dir/SystemZLDCleanup.cpp.o
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
[02:39:21] 
[02:39:21] running 119 tests
[02:39:51] .iiiii..ii.....i..i...i..i.i..i.ii..ii....ii.ii....i..........iiii..........i...ii..ii.......ii.i.ii 100/119
[02:39:55] i.....iiiiii.....ii
[02:39:55] 
[02:39:55]  finished in 34.208
[02:39:55] travis_fold:end:test_debuginfo

---
[02:52:08]    Compiling arena v0.0.0 (/checkout/src/libarena)
[02:52:08]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[02:52:17]    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[02:53:38]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
The job exceeded the maximum time limit for jobs, and has been terminated.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@mati865
Copy link
Contributor Author

mati865 commented Feb 28, 2019

Retriggering Travis, hopefully the cache will kick in

@mati865 mati865 closed this Feb 28, 2019
@mati865 mati865 reopened this Feb 28, 2019
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-musl of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0064d5b0:start=1551387260051075933,finish=1551387374574220534,duration=114523144601
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=dist-x86_64-musl
---
[00:01:30] Step 5/11 : RUN bash musl-toolchain.sh x86_64-linux-musl && rm -rf build
[00:01:30]  ---> Running in 3b157bbe4579
[00:01:30] + TARGET=x86_64-linux-musl
[00:01:30] + ARCH=x86_64
[00:01:30] + OUTPUT=/usr/local
[00:01:30] + shift
[00:01:30] + git clone https://github.com/richfelker/musl-cross-make -b v0.9.7
[00:01:30] Cloning into 'musl-cross-make'...
[00:01:31] Note: checking out 'b85e29c00d35c8c8c196d6713505b837816ad47f'.
[00:01:31] 
[00:01:31] You are in 'detached HEAD' state. You can look around, make experimental
[00:01:31] changes and commit them, and you can discard any commits you make in this
[00:01:31] state without impacting any branches by performing another checkout.
[00:01:31] 
[00:01:31] If you want to create a new branch to retain commits you create, you may
[00:01:31] do so (now or later) by using -b with the checkout command again. Example:
[00:01:31] 
[00:01:31]   git checkout -b <new-branch-name>
[00:01:31] + cd musl-cross-make
[00:01:31] ++ nproc
[00:01:31] + hide_output make -j4 TARGET=x86_64-linux-musl
[00:01:31] + set +x
---
[00:11:01] Thu Feb 28 21:07:24 UTC 2019 - building ...
[00:11:31] Thu Feb 28 21:07:54 UTC 2019 - building ...
[00:12:01] Thu Feb 28 21:08:24 UTC 2019 - building ...
[00:12:31] Thu Feb 28 21:08:54 UTC 2019 - building ...
[00:12:46] musl-toolchain.sh: line 3:    20 Terminated              bash -c "while true; do sleep 30; echo \$(date) - building ...; done"
[00:12:46] + hide_output make install TARGET=x86_64-linux-musl OUTPUT=/usr/local
[00:13:02] musl-toolchain.sh: line 3:  6335 Terminated              bash -c "while true; do sleep 30; echo \$(date) - building ...; done"
[00:13:02] + cd -
[00:13:02] + cd -
[00:13:02] + ln -s /usr/local/x86_64-linux-musl/lib/libc.so /lib/ld-musl-x86_64.so.1
[00:13:02] + echo /usr/local/x86_64-linux-musl/lib
[00:13:02] + export CC=x86_64-linux-musl-gcc
[00:13:02] + CC=x86_64-linux-musl-gcc
[00:13:02] + export CXX=x86_64-linux-musl-g++
---
[00:16:08] Step 8/11 : ENV RUST_CONFIGURE_ARGS       --musl-root-x86_64=/usr/local/x86_64-linux-musl       --enable-extended       --disable-docs
[00:16:08]  ---> Running in 16c06372933a
[00:16:08] Removing intermediate container 16c06372933a
[00:16:08]  ---> 72c880bb6050
[00:16:08] Step 9/11 : ENV HOSTS=x86_64-unknown-linux-musl     CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc     CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++
[00:16:08] Removing intermediate container 527a8ce1c260
[00:16:08]  ---> dd25291d995b
[00:16:08]  ---> dd25291d995b
[00:16:08] Step 10/11 : ENV RUSTFLAGS="-C target-feature=-crt-static"
[00:16:09] Removing intermediate container f3ccde22bd6b
[00:16:09]  ---> 4677b33fb6fa
[00:16:09] Step 11/11 : ENV SCRIPT       python2.7 ../x.py test --host $HOSTS --target $HOSTS &&       python2.7 ../x.py dist --host $HOSTS --target $HOSTS
[00:16:09]  ---> Running in 2f651130caa5
[00:16:09]  ---> Running in 2f651130caa5
[00:16:09] Removing intermediate container 2f651130caa5
[00:16:09]  ---> d80873abf024
[00:16:09] Successfully built d80873abf024
[00:16:09] Successfully tagged rust-ci:latest
[00:16:09] Built container sha256:d80873abf02485ad5105db331547c4c0e7954494bdf6e1603eb891536d1bae8a
[00:16:09] Uploading finished image to s3://rust-lang-ci-sccache2/docker/fd3426e13b5752ae462db71e06d5b48945a4ba81170afb8377771e78b27939ac4e9cf4cf1a6079d885d0e41b8cb27e1d6b2c067dccae190830ff6799b32ece21
[00:22:35] upload failed: - to s3://rust-lang-ci-sccache2/docker/fd3426e13b5752ae462db71e06d5b48945a4ba81170afb8377771e78b27939ac4e9cf4cf1a6079d885d0e41b8cb27e1d6b2c067dccae190830ff6799b32ece21 Unable to locate credentials

[00:22:36] travis_time:end:1a517b4e:start=1551387408077792867,finish=1551388739196802559,duration=1331119009692
[CI_JOB_NAME=dist-x86_64-musl]
[00:22:36] [CI_JOB_NAME=dist-x86_64-musl]
---

[01:12:28] travis_fold:start:llvm
travis_time:start:llvm
Building LLVM for x86_64-unknown-linux-musl
[01:12:28] running: "cmake" "/checkout/src/llvm-project/llvm" "-DLLVM_ENABLE_ASSERTIONS=OFF" "-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64;Mips;PowerPC;SystemZ;MSP430;Sparc;NVPTX;Hexagon" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly;RISCV" "-DLLVM_INCLUDE_EXAMPLES=OFF" "-DLLVM_INCLUDE_TESTS=OFF" "-DLLVM_INCLUDE_DOCS=OFF" "-DLLVM_INCLUDE_BENCHMARKS=OFF" "-DLLVM_ENABLE_ZLIB=OFF" "-DWITH_POLLY=OFF" "-DLLVM_ENABLE_TERMINFO=OFF" "-DLLVM_ENABLE_LIBEDIT=OFF" "-DLLVM_PARALLEL_COMPILE_JOBS=4" "-DLLVM_TARGET_ARCH=x86_64" "-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-musl" "-DLLVM_OCAML_INSTALL_PATH=usr/lib/ocaml" "-DLLVM_ENABLE_LIBXML2=OFF" "-DCMAKE_CROSSCOMPILING=True" "-DLLVM_TABLEGEN=/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-tblgen" "-DLLVM_NATIVE_BUILD=/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build" "-DPYTHON_EXECUTABLE=/usr/bin/python2.7" "-DCMAKE_C_COMPILER_LAUNCHER=sccache" "-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" "-DCMAKE_C_COMPILER=x86_64-linux-musl-gcc" "-DCMAKE_CXX_COMPILER=x86_64-linux-musl-g++" "-DCMAKE_C_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64 -static" "-DCMAKE_CXX_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64 -static -static-libstdc++" "-DCMAKE_INSTALL_PREFIX=/checkout/obj/build/x86_64-unknown-linux-musl/llvm" "-DCMAKE_BUILD_TYPE=Release"
[01:12:28] -- The CXX compiler identification is GNU 6.3.0
[01:12:28] -- The ASM compiler identification is GNU
[01:12:28] -- Found assembler: /usr/local/bin/x86_64-linux-musl-gcc
[01:12:28] -- Check for working C compiler: /usr/local/bin/x86_64-linux-musl-gcc
---
[01:51:35] [ 71%] Linking CXX static library ../../../libLLVMPowerPCInfo.a
[01:51:36] [ 71%] Built target LLVMPowerPCInfo
[01:51:36] Scanning dependencies of target LLVMSystemZCodeGen
[01:51:36] [ 71%] Building CXX object lib/Target/SystemZ/CMakeFiles/LLVMSystemZCodeGen.dir/SystemZAsmPrinter.cpp.o
[01:51:37] /checkout/src/llvm-project/llvm/lib/Target/Mips/MipsInstructionSelector.cpp: In member function 'virtual bool {anonymous}::MipsInstructionSelector::select(llvm::MachineInstr&, llvm::CodeGenCoverage&) const':
[01:51:37] /checkout/src/llvm-project/llvm/lib/Target/Mips/MipsInstructionSelector.cpp:296:16: warning: types may not be defined in a for-range-declaration
[01:51:37]      for (const struct Instr &Instruction : Instructions) {
[01:51:37] [ 71%] Building CXX object lib/Target/Mips/CMakeFiles/LLVMMipsCodeGen.dir/MipsISelDAGToDAG.cpp.o
[01:51:38] [ 71%] Building CXX object lib/Target/PowerPC/MCTargetDesc/CMakeFiles/LLVMPowerPCDesc.dir/PPCMCExpr.cpp.o
[01:51:41] [ 71%] Building CXX object lib/Target/PowerPC/MCTargetDesc/CMakeFiles/LLVMPowerPCDesc.dir/PPCPredicates.cpp.o
[01:51:41] [ 71%] Building CXX object lib/Target/PowerPC/MCTargetDesc/CMakeFiles/LLVMPowerPCDesc.dir/PPCMachObjectWriter.cpp.o
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
[02:45:26] 
[02:45:26] running 119 tests
[02:45:57] .iiiii..ii.....i..i...i..i.i..i.ii..ii....ii.ii....i..........iiii..........i...ii..ii.......ii.i.ii 100/119
[02:46:02] i.....iiiiii.....ii
[02:46:02] 
[02:46:02]  finished in 35.441
[02:46:02] travis_fold:end:test_debuginfo

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@mati865
Copy link
Contributor Author

mati865 commented Mar 1, 2019

Okay caching is not going to work because CI configured like that doesn't have permission to upload the image.

I made clean build with latests bunch of hacks on my machine and after 1 hour all the tests passed.

@alexcrichton I'm not quite happy with this amount of hacks but that's what I had to do to make it pass the tests.

IMO keeping -musl link static and introducing 'alias' like -dynmusl would solve many of the issues with the tests and be less confusing. It would use the same sysroot and stuff but change link strategy to dynamic crt.

I'm open to anything the team decides.

src/bootstrap/test.rs Outdated Show resolved Hide resolved
@alexcrichton
Copy link
Member

@bors: delegate+ try

Let's try running this through try which should enable caching and also produce some artifacts for manual inspection. I wouldn't mind playing around with the compiler/target as well to make sure it all checks out.

(for now please refrain from r+'ing, I'm doing delegate+ so you should be able to run a try build as well)

IMO keeping -musl link static and introducing 'alias' like -dynmusl would solve many of the issues with the tests and be less confusing

I agree! I'm certainly not the only one with opinions here, however.

@bors
Copy link
Contributor

bors commented Mar 1, 2019

✌️ @mati865 can now approve this pull request

@bors
Copy link
Contributor

bors commented Mar 1, 2019

⌛ Trying commit e676f99 with merge b574688...

bors added a commit that referenced this pull request Mar 1, 2019
WIP Musl host toolchain

Based on #55163 and #57359
Depends on #55566

CC #57439

### How it works

Tested compiler made by `dist` on glibc and musl based distributions and verified binaries it produces:
* Ubuntu (glibc) - installed it as a target for host toolchain and observed no regressions for static (default) linking, dynamic linking apparently requires musl build libgcc so I didn't test it.
* Alpine (musl) - installed as the host toolchain, by default it links statically (executables are portable and work on glibc distributions) but with `-C target-feature=-crt-static` Rust flag it links dynamically (executables require musl built libraries).

### What's debatable

It should be decided whether this toolchain should link dynamically or statically when using it on musl distribution. I believe the distributions would prefer dynamic linking but it'd be misleading because `$ARCH-unknown-linux-musl` target links statically on the other hosts.
Another problem is using `RUSTFLAGS='-C target-feature=-crt-static'` for dynamic builds which is really uncomfortable.

To address both issues I suggest leaving `$ARCH-unknown-linux-musl` static for both host and cross target and introducing "alias triple" `$ARCH-unknown-linux-dynmusl`. It'd be the same as `$ARCH-unknown-linux-musl` (and use the same libraries to avoid duplication) but it'd link dynamically.

### Why it's still WIP (help wanted)

I'm having a hard time getting all tests to pass and I'd appreciate help.

Non-verbose error:
<details>

```
Testing proc_macro stage1 (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
error[E0463]: can't find crate for `std`

error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
[RUSTC-TIMING] proc_macro test:true 0.529
[RUSTC-TIMING] proc_macro test:false 0.530
error: Could not compile `proc_macro`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `proc_macro`.

To learn more, run the command again with --verbose.

command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-musl" "-j" "16" "--release" "--locked" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "proc_macro" "--"
expected success, got: exit code: 101

failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --host x86_64-unknown-linux-musl --target x86_64-unknown-linux-musl
```
</details>

Verbose error:
<details>

```
Testing proc_macro stage1 (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
     Running `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=09ddd3ecc930ab63 -C extra-filename=-09ddd3ecc930ab63 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static`
     Running `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --emit=dep-info,link -C opt-level=2 --test -C metadata=a564d363930469c8 -C extra-filename=-a564d363930469c8 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static`
error[E0463]: can't find crate for `std`
error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
[RUSTC-TIMING] proc_macro test:false 0.248
error: Could not compile `proc_macro`.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=09ddd3ecc930ab63 -C extra-filename=-09ddd3ecc930ab63 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] proc_macro test:true 0.248
error: Could not compile `proc_macro`.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --emit=dep-info,link -C opt-level=2 --test -C metadata=a564d363930469c8 -C extra-filename=-a564d363930469c8 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static` (exit code: 1)

command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-musl" "-j" "16" "--release" "--locked" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "--verbose" "-p" "proc_macro" "--"
expected success, got: exit code: 101

failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --host x86_64-unknown-linux-musl --target x86_64-unknown-linux-musl
```

</details>

Whole tests non-verbose output: [rust-tests.log](https://github.com/rust-lang/rust/files/2879945/rust-tests.log)

I think the error is because build system (correctly?) tries to use `obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps` which is empty but `obj/build/x86_64-unknown-linux-gnu/stage1-test/x86_64-unknown-linux-musl/release/deps` contains required libs.
src/bootstrap/test.rs Outdated Show resolved Hide resolved
src/ci/docker/dist-x86_64-musl/Dockerfile Outdated Show resolved Hide resolved
src/test/run-make-fulldeps/link-cfg/Makefile Outdated Show resolved Hide resolved
src/test/run-make-fulldeps/reproducible-build/Makefile Outdated Show resolved Hide resolved
src/test/run-make/rustc-macro-dep-files/Makefile Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/runtest.rs Outdated Show resolved Hide resolved
@mati865
Copy link
Contributor Author

mati865 commented Mar 1, 2019

Let's try running this through try which should enable caching and also produce some artifacts for manual inspection. I wouldn't mind playing around with the compiler/target as well to make sure it all checks out.

I have already tested artifacts from my local dist builds both as the dynamic host on Alpine
Linux (musl based distro) and as the static target on Ubuntu.
But it'd be nice if somebody else wanted to give it a try, not breaking existing musl is a priority.

(for now please refrain from r+'ing, I'm doing delegate+ so you should be able to run a try build as well)

Sure and thanks.

@bors
Copy link
Contributor

bors commented Mar 1, 2019

💔 Test failed - checks-travis

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 1, 2019
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-linux of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_fold:end:services

travis_fold:start:git.checkout
travis_time:start:203d8810
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[00:01:11] 
[00:01:11] Total download size: 4.9 M
[00:01:11] Downloading Packages:
[00:01:14] --------------------------------------------------------------------------------
[00:01:14] Total                                           1.6 MB/s | 4.9 MB     00:03     
[00:01:14] warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
[00:01:14] Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
[00:01:14] Running Transaction Test
[00:01:14] Finished Transaction Test
[00:01:14] Transaction Test Succeeded
[00:01:14] Running Transaction
---
[00:04:00] + hide_output make install
[00:04:00] + set +x
[00:04:22] shared.sh: line 1:   352 Terminated              bash -c "while true; do sleep 30; echo \$(date) - building ...; done"
[00:04:22] + cd ..
[00:04:22] + rm -rf openssl-1.0.2k
[00:04:22] ./build-openssl.sh: line 16:  4115 Terminated              bash -c "while true; do sleep 30; echo \$(date) - building ...; done"  (wd: /tmp/openssl-1.0.2k)
[00:04:22] + ln -nsf /etc/pki/tls/cert.pem /rustroot/ssl/
[00:04:23]  ---> 4b9f39ea6547
[00:04:23] Step 14/41 : COPY dist-x86_64-linux/build-curl.sh /tmp/
[00:04:23]  ---> 5a9ec6b1a99f
[00:04:23] Step 15/41 : RUN ./build-curl.sh
[00:04:23] Step 15/41 : RUN ./build-curl.sh
[00:04:23]  ---> Running in 72e292752b62
[00:04:24] + source shared.sh
[00:04:24] + VERSION=7.51.0
[00:04:24] + curl http://cool.haxx.se/download/curl-7.51.0.tar.bz2
[00:04:25]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[00:04:25]                                  Dload  Upload   Total   Spent    Left  Speed
[00:04:26] 
  0 2509k    0  6975    0     0   4560      0  0:09:23  0:00:01  0:09:22  4560
  0 2509k    0  6975    0     0   4560      0  0:09:23  0:00:01  0:09:22  4560
  7 2509k    7  200k    0     0    98k      0  0:00:25  0:00:02  0:00:23  389k
100 2509k  100 2509k    0     0   862k      0  0:00:02  0:00:02 --:--:-- 1813k
[00:04:27] + mkdir curl-build
[00:04:27] + cd curl-build
[00:04:27] + hide_output ../curl-7.51.0/configure --prefix=/rustroot --with-ssl=/rustroot --disable-sspi --disable-gopher --disable-smtp --disable-smb --disable-imap --disable-pop3 --disable-tftp --disable-telnet --disable-manual --disable-dict --disable-rtsp --disable-ldaps --disable-ldap
[00:04:52] + hide_output make -j10
[00:04:52] + set +x
[00:05:06] shared.sh: line 1:    15 Terminated              bash -c "while true; do sleep 30; echo \$(date) - building ...; done"
[00:05:06] ./build-curl.sh: line 29: 11530 Terminated              bash -c "while true; do sleep 30; echo \$(date) - building ...; done"
---
 98 67.8M   98 66.7M    0     0  1705k      0  0:00:40  0:00:40 --:--:--  774k
 99 67.8M   99 67.5M    0     0  1684k      0  0:00:41  0:00:41 --:--:--  811k
100 67.8M  100 67.8M    0     0  1680k      0  0:00:41  0:00:41 --:--:--  837k
[00:09:59] + cd gcc-5.5.0
[00:09:59] + sed -i 's|ftp://gcc\.gnu\.org/|http://gcc.gnu.org/|g' ./contrib/download_prerequisites
[00:09:59] --2019-03-01 20:27:52--  http://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2
[00:09:59] Resolving gcc.gnu.org... 209.132.180.131
[00:10:00] Connecting to gcc.gnu.org|209.132.180.131|:80... connected.
[00:10:00] HTTP request sent, awaiting response... 200 OK
---
[01:19:21]  ---> 2456b7b31a73
[01:19:21] Step 25/41 : RUN ./build-clang.sh
[01:19:21]  ---> Running in 3f224f90fa78
[01:19:21] + source shared.sh
[01:19:21] + LLVM=llvmorg-8.0.0-rc2
[01:19:21] + mkdir llvm-project
[01:19:21] + cd llvm-project
[01:19:21] + curl -L https://github.com/llvm/llvm-project/archive/llvmorg-8.0.0-rc2.tar.gz
[01:19:21] + tar xzf - --strip-components=1
[01:19:21]                                  Dload  Upload   Total   Spent    Left  Speed
[01:19:22] 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   136    0   136    0     0    569      0 --:--:-- --:--:-- --:--:--   653
---
[01:19:41] + cd clang-build
[01:19:41] + INC=/rustroot/include
[01:19:41] + INC=/rustroot/include:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed
[01:19:41] + INC=/rustroot/include:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed:/usr/include
[01:19:41] + hide_output cmake ../llvm -DCMAKE_C_COMPILER=/rustroot/bin/gcc -DCMAKE_CXX_COMPILER=/rustroot/bin/g++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/rustroot -DLLVM_TARGETS_TO_BUILD=X86 '-DLLVM_ENABLE_PROJECTS=clang;lld' -DC_INCLUDE_DIRS=/rustroot/include:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed:/usr/include
[01:20:11] Fri Mar 1 21:38:04 UTC 2019 - building ...
[01:20:22] + hide_output make -j10
[01:20:22] + set +x
[01:20:52] Fri Mar 1 21:38:45 UTC 2019 - building ...
---
[02:45:56]  ---> 1e10c3d27f70
[02:45:56] Step 32/41 : RUN ./build-perl.sh
[02:45:56]  ---> Running in f9f2c21ef3d0
[02:45:56] + source shared.sh
[02:45:56] + curl https://www.cpan.org/src/5.0/perl-5.28.0.tar.gz
[02:45:56]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[02:45:56]                                  Dload  Upload   Total   Spent    Left  Speed
[02:45:57] 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 17.0M  100 17.0M    0     0  14.4M      0  0:00:01  0:00:01 --:--:-- 15.4M
[02:45:57] + cd perl-5.28.0
[02:45:57] + CC=gcc
[02:45:57] + CFLAGS='-I /rustroot/include -fgnu89-inline'
[02:45:57] + hide_output ./configure.gnu
[02:45:57] + set +x
[02:46:27] Fri Mar 1 23:04:20 UTC 2019 - building ...
[02:46:41] + hide_output make -j10
---
[02:56:29]    Compiling arena v0.0.0 (/checkout/src/libarena)
[02:56:29]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[02:56:34]    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[02:57:41]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
The job exceeded the maximum time limit for jobs, and has been terminated.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 1, 2019
@mati865
Copy link
Contributor Author

mati865 commented Mar 1, 2019

Let's see if it can finish in time with the cache.

@bors try

@mati865
Copy link
Contributor Author

mati865 commented Mar 1, 2019

@bors try

It didn't notice previous comment?

@ids1024
Copy link
Contributor

ids1024 commented Mar 2, 2019

It didn't notice previous comment?

I think bors only responds to commands like that from authorized users.

Homu will only listen to official reviewers that it is configured to listen to.

https://buildbot2.rust-lang.org/homu/

@mati865
Copy link
Contributor Author

mati865 commented Mar 2, 2019

@ids1024 I don't quite understand, shouldn't delegate+ give me permission for try builds?
#58575 (comment)

@ids1024
Copy link
Contributor

ids1024 commented Mar 2, 2019

Ah right. Perhaps it should be retry rather than try since you're trying to re-run a build that already failed (due to timeout)?

@mati865
Copy link
Contributor Author

mati865 commented Mar 2, 2019

@bors retry

It shouldn't matter and bors should reply anything. Let's see if it works now.

@malbarbo
Copy link
Contributor

@mati865 thanks for working on this. It would be great if the manifest could be change to include x86_64-unknown-linux-musl as host.

@mati865
Copy link
Contributor Author

mati865 commented Mar 15, 2019

@malbarbo oh I didn't know about this, thanks for letting know.

@alexcrichton sorry for troubling you again but adding it to the manifest is the only thing left to make it available via rustup?

@alexcrichton
Copy link
Member

I'm not sure if that's all that's needed, but it's at least required!

@mati865
Copy link
Contributor Author

mati865 commented Mar 15, 2019

Okay, is there any way to test it locally?

@alexcrichton
Copy link
Member

There is, yeah, but it's not really documented or easy to set up. It should be fine to send a PR with an update to the manifest builder and then we can test it on the manifests once merged.

@mati865
Copy link
Contributor Author

mati865 commented May 7, 2019

@XAMPPRocky I think this should be mentioned in 1.35.0 Release Notes, many users were waiting years for it.

@XAMPPRocky
Copy link
Member

@mati865 Can you explain how this change affects stable users?

@mati865
Copy link
Contributor Author

mati865 commented May 8, 2019

@XAMPPRocky before this PR there was no way to use official Rust packages on musl based distributions (like Alpine Linux, Void Linux musl variant and others). The only way to use Rust there was to install package via distribution package manager (which often had issues because of older unpatched LLVM).

This change is now it beta and 1.35.0 will be the first native stable version to work on those distributions. It also makes porting Rust to other musl distros easier because they can use native compiler for bootstrapping instead of cross compiling.
There is no official Rustup available for musl yet (unofficial packages are available) but tarballs are better than nothing.

@jnbr
Copy link

jnbr commented May 26, 2019

Thanks for the work!

Unfortunately, it's not possible to build proc-macro crates with this toolchain:

error: cannot produce proc-macro for `serde_derive v1.0.81` as the target `x86_64-unknown-linux-musl` does not support these crate types

Any hint why this isn't supported would be very helpful.

@smaeul
Copy link
Contributor

smaeul commented May 26, 2019

@jnbr Because the musl targets were originally created with the (misguided) assumption that musl was only for cross-compiling static binaries. So these targets default to static linking, and that's not fixable because it would break backward compatibility. You'll need to turn that off to compile proc-macro crates:

RUSTFLAGS='-C target-feature=-crt-static'

@jnbr
Copy link

jnbr commented May 26, 2019

Thank you @smaeul. I wasn't aware that proc-macro requires dynamic linking.

@Keruspe
Copy link
Contributor

Keruspe commented May 27, 2019

Can't something be done about this default? It should at least be configurable at compile time I guess?

@mati865
Copy link
Contributor Author

mati865 commented May 27, 2019

@Keruspe default static linking cannot be changed because of backward compatibility. You can use environment variable posted above by smaeul or add it to your cargo configuration.

I have few ideas how to make it more convenient but I haven't got yet to test or discuss them with maintainers.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request May 31, 2019
Version 1.35.0 (2019-05-23)
==========================

Language
--------
- [`FnOnce`, `FnMut`, and the `Fn` traits are now implemented for `Box<FnOnce>`,
  `Box<FnMut>`, and `Box<Fn>` respectively.][59500]
- [You can now coerce closures into unsafe function pointers.][59580] e.g.
  ```rust
  unsafe fn call_unsafe(func: unsafe fn()) {
      func()
  }

  pub fn main() {
      unsafe { call_unsafe(|| {}); }
  }
  ```


Compiler
--------
- [Added the `armv6-unknown-freebsd-gnueabihf` and
  `armv7-unknown-freebsd-gnueabihf` targets.][58080]
- [Added the `wasm32-unknown-wasi` target.][59464]


Libraries
---------
- [`Thread` will now show its ID in `Debug` output.][59460]
- [`StdinLock`, `StdoutLock`, and `StderrLock` now implement `AsRawFd`.][59512]
- [`alloc::System` now implements `Default`.][59451]
- [Expanded `Debug` output (`{:#?}`) for structs now has a trailing comma on the
  last field.][59076]
- [`char::{ToLowercase, ToUppercase}` now
  implement `ExactSizeIterator`.][58778]
- [All `NonZero` numeric types now implement `FromStr`.][58717]
- [Removed the `Read` trait bounds
  on the `BufReader::{get_ref, get_mut, into_inner}` methods.][58423]
- [You can now call the `dbg!` macro without any parameters to print the file
  and line where it is called.][57847]
- [In place ASCII case conversions are now up to 4× faster.][59283]
  e.g. `str::make_ascii_lowercase`
- [`hash_map::{OccupiedEntry, VacantEntry}` now implement `Sync`
  and `Send`.][58369]

Stabilized APIs
---------------
- [`f32::copysign`]
- [`f64::copysign`]
- [`RefCell::replace_with`]
- [`RefCell::map_split`]
- [`ptr::hash`]
- [`Range::contains`]
- [`RangeFrom::contains`]
- [`RangeTo::contains`]
- [`RangeInclusive::contains`]
- [`RangeToInclusive::contains`]
- [`Option::copied`]

Cargo
-----
- [You can now set `cargo:rustc-cdylib-link-arg` at build time to pass custom
  linker arguments when building a `cdylib`.][cargo/6298] Its usage is highly
  platform specific.

Misc
----
- [The Rust toolchain is now available natively for musl based distros.][58575]

[59460]: rust-lang/rust#59460
[59464]: rust-lang/rust#59464
[59500]: rust-lang/rust#59500
[59512]: rust-lang/rust#59512
[59580]: rust-lang/rust#59580
[59283]: rust-lang/rust#59283
[59451]: rust-lang/rust#59451
[59076]: rust-lang/rust#59076
[58778]: rust-lang/rust#58778
[58717]: rust-lang/rust#58717
[58369]: rust-lang/rust#58369
[58423]: rust-lang/rust#58423
[58080]: rust-lang/rust#58080
[57847]: rust-lang/rust#57847
[58575]: rust-lang/rust#58575
[cargo/6298]: rust-lang/cargo#6298
[`f32::copysign`]: https://doc.rust-lang.org/stable/std/primitive.f32.html#method.copysign
[`f64::copysign`]: https://doc.rust-lang.org/stable/std/primitive.f64.html#method.copysign
[`RefCell::replace_with`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.replace_with
[`RefCell::map_split`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.map_split
[`ptr::hash`]: https://doc.rust-lang.org/stable/std/ptr/fn.hash.html
[`Range::contains`]: https://doc.rust-lang.org/std/ops/struct.Range.html#method.contains
[`RangeFrom::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeFrom.html#method.contains
[`RangeTo::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeTo.html#method.contains
[`RangeInclusive::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html#method.contains
[`RangeToInclusive::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeToInclusive.html#method.contains
[`Option::copied`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.copied
@nh2
Copy link

nh2 commented Dec 20, 2019

Because the musl targets were originally created with the (misguided) assumption that musl was only for cross-compiling static binaries.

Could rust add a newly-named target that uses musl normally?

This would save downstream users a lot of of headaches, for example Alpine has to patch it, adding their own target names with -alpine- inside, and for NixOS we now have the same problem.

Having a general normal musl target would save a lot of work overall, and reduce the chance of bugs and need for more specific documentation due to custom target names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.