Bug 225994 - lang/rust - update bootstrap to 1.23
Summary: lang/rust - update bootstrap to 1.23
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD Rust Team
Depends on: 225582
Blocks: 225899
  Show dependency treegraph
Reported: 2018-02-17 21:31 UTC by Don Lewis
Modified: 2018-02-20 11:05 UTC (History)
2 users (show)

See Also:
dumbbell: maintainer-feedback+


Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer 2018-02-17 21:31:50 UTC
There is a bug in the gmake jobserver implmentation that can cause it do deadlock when it is configured to use pselect(), which it is on FreeBSD.  The upstream fix is to make the jobserver pipe descriptor non-blocking.  Unfortunately the jobserver implementation in rust was not updated for compatibility until version 1.23.  With the patch to gmake to fix the deadlock problem, the rust bootstrap fails like this:

   Compiling rls-data v0.12.0
   Compiling syntax_pos v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.23.0-src/src/libsyntax_pos)
error: failed to acquire jobserver token

Caused by:
  Resource temporarily unavailable (os error 35)
thread 'main' panicked at 'command did not execute successfully: "/wrkdirs/usr/ports/lang/rust/work/rustc-1.23.0-src/build/x86_64-unknown-freebsd/stage0/bi
n/cargo" "build" "--target" "x86_64-unknown-freebsd" "--release" "--frozen" "--features" " jemalloc llvm" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/w
ork/rustc-1.23.0-src/src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', src/bootstrap/compile.rs:882:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Traceback (most recent call last):
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.23.0-src/x.py", line 20, in <module>
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.23.0-src/src/bootstrap/bootstrap.py", line 758, in main
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.23.0-src/src/bootstrap/bootstrap.py", line 749, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.23.0-src/src/bootstrap/bootstrap.py", line 148, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /wrkdirs/usr/ports/lang/rust/work/rustc-1.23.0-src/build/bootstrap/debug/bootstrap build --verbose --config ./config.toml --jo
bs 8
*** Error code 1
Comment 1 Jean-Sébastien Pédron freebsd_committer 2018-02-19 22:01:22 UTC

I just update lang/rust to 1.24.0. It uses Rust 1.23.0 to bootstrap. Is it enough to fix the problem?

I don't know if it's related, but the upstream bootstraps for amd64 and i386 hang early in the compilation of Rust. This is the case for several versions. The current workaround is to create new bootstraps out of the existing FreeBSD packages. I don't know if it's the case for the aarch64 bootstrap because I cross-compile it on amd64 but I don't have a aarch64 poudriere host.
Comment 2 Don Lewis freebsd_committer 2018-02-20 02:13:40 UTC
Yes, I was able to build the updated rust with the gmake jobserver bugfix patch.
Comment 3 Jean-Sébastien Pédron freebsd_committer 2018-02-20 09:23:39 UTC
Great! Should we close this PR?

Thank you for reporting the issue!