Bug 227130 - lang/rust: Update to 1.25
Summary: lang/rust: Update to 1.25
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: FreeBSD Rust Team
URL: https://reviews.freebsd.org/D14921
Keywords: needs-qa
Depends on:
Blocks: 226955
  Show dependency treegraph
 
Reported: 2018-03-31 09:54 UTC by Kubilay Kocak
Modified: 2018-04-16 21:38 UTC (History)
7 users (show)

See Also:
riggs: maintainer-feedback+
koobs: merge-quarterly?


Attachments
update to 1.25.0 (27.84 KB, patch)
2018-04-01 05:19 UTC, Charlie Li
riggs: maintainer-approval-
Details | Diff
ssl=base testport log (802.14 KB, text/plain)
2018-04-01 08:36 UTC, Charlie Li
no flags Details
12-CURRENT build log (61.05 KB, text/plain)
2018-04-01 22:53 UTC, Charlie Li
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kubilay Kocak freebsd_committer freebsd_triage 2018-03-31 09:54:43 UTC
Tracking issue for the rust 1.25 release.

The change needs to be MFH'd, per @jbeich who asks (via email):

Firefox 61 scheduled on 2018-06-26 [1] will require [2] Rust 1.25 to build.
If 2018Q2 will be stuck with Rust 1.24.1 I won't be able to MFH Firefox
61 on release day. Once 2018Q3 branches some users may delay upgrade for
a few weeks due to inherent instability when a /quarterly branch is created.

Can you add "MFH: 2018Q2" to commit message when landing Rust 1.25 update?


[1] https://wiki.mozilla.org/RapidRelease/Calendar
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1450078
    https://wiki.mozilla.org/Rust_Update_Policy_for_Firefox
Comment 1 Thomas Zander freebsd_committer freebsd_triage 2018-03-31 10:02:14 UTC
Will see that rust 1.25 gets MFH'ed in time for firefox 61
Comment 2 Charlie Li freebsd_committer freebsd_triage 2018-04-01 05:19:01 UTC
Created attachment 192023 [details]
update to 1.25.0

First attempt at an update, primarily to help address bug 226955. Other than the issue covered there (with a further patch destined in that PR), this builds fine. I'm using the beta bootstraps instead of the recommended previous stable bootstraps as they are still susceptible to the cryptic build error bdrewery@ pointed out in [1]; using the beta bootstraps allowed for removing the ABI patch logic.

Note: distinfo only has the amd64 bootstraps for now.

[1] https://github.com/rust-lang/rust/pull/49023#issuecomment-373128703
Comment 3 Charlie Li freebsd_committer freebsd_triage 2018-04-01 05:36:49 UTC
(In reply to Charlie Li from comment #2)
"builds fine" meaning succeeds up until the openssl-sys crate when ssl=libressl-devel. As I alluded to in bug 226955, said crate is still on a version present in at least rust 1.24, so any other value of ssl= should in theory build successfully, which includes passing testport.
Comment 4 Charlie Li freebsd_committer freebsd_triage 2018-04-01 08:36:21 UTC
Created attachment 192041 [details]
ssl=base testport log
Comment 5 Jan Beich freebsd_committer freebsd_triage 2018-04-01 10:32:44 UTC
Comment on attachment 192023 [details]
update to 1.25.0

> diff --git lang/rust/files/patch-src_binaryen_CMakeLists.txt lang/rust/files/patch-src_binaryen_CMakeLists.txt
> deleted file mode 100644
> index 88f374664024..000000000000
> --- lang/rust/files/patch-src_binaryen_CMakeLists.txt
> +++ /dev/null
> @@ -1,60 +0,0 @@
> -https://github.com/WebAssembly/binaryen/commit/07f6dfbf0d89
> -https://github.com/WebAssembly/binaryen/commit/d9692277357b

Only fixed in binaryen, not in Rust. Can you restore the file?

> diff --git lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs
> deleted file mode 100644
> index 2f2b3ccc423b..000000000000
> --- lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -Return struct like OpenBSD, see src/librustc_trans/cabi_x86.rs
> -
> ---- src/librustc_back/target/freebsd_base.rs.orig	2017-11-22 21:33:00 UTC
> -+++ src/librustc_back/target/freebsd_base.rs
> -@@ -31,6 +31,8 @@ pub fn opts() -> TargetOptions {
> -         target_family: Some("unix".to_string()),
> -         linker_is_gnu: true,
> -         has_rpath: true,
> -+        is_like_openbsd: true,

abi_return_struct_as_int is not in Rust 1.25. Can you restore is_like_openbsd?
Comment 6 Thomas Zander freebsd_committer freebsd_triage 2018-04-01 10:36:38 UTC
I am in the middle of consolidating. Will upload my patch set to phabricator. Give an hour or so
Comment 7 Thomas Zander freebsd_committer freebsd_triage 2018-04-01 12:14:26 UTC
Upstream announcement:
https://blog.rust-lang.org/2018/03/29/Rust-1.25.html
Comment 8 Thomas Zander freebsd_committer freebsd_triage 2018-04-01 12:16:31 UTC
(In reply to Thomas Zander from comment #7)

Patch in phabricator tested on 11/stable amd64. 10.4R comes next. aarch64 is TBD.
Comment 9 Thomas Zander freebsd_committer freebsd_triage 2018-04-01 12:17:19 UTC
Comment on attachment 192023 [details]
update to 1.25.0

Updated version of the patch moved to phabricator:
https://reviews.freebsd.org/D14921
Comment 10 Thomas Zander freebsd_committer freebsd_triage 2018-04-01 14:02:21 UTC
(In reply to Thomas Zander from comment #8)

Build on 10.4 i386 looks good too.
Comment 11 Charlie Li freebsd_committer freebsd_triage 2018-04-01 22:53:31 UTC
Created attachment 192083 [details]
12-CURRENT build log

Build crashed using review D14921. Will try again and mark attachment obsolete if this was only a fluke.
Comment 12 Bryan Drewery freebsd_committer freebsd_triage 2018-04-02 17:15:01 UTC
(In reply to Charlie Li from comment #11)
> Created attachment 192083 [details]
> 12-CURRENT build log
> 
> Build crashed using review D14921. Will try again and mark attachment
> obsolete if this was only a fluke.

Define crashed please? The log is truncated. Did you get a panic?
Comment 13 Charlie Li freebsd_committer freebsd_triage 2018-04-02 17:19:49 UTC
(In reply to Bryan Drewery from comment #12)
> The log is truncated.

I didn't realise bugzilla would do that, especially since the file was under the 1000 KiB limit. Here's the relevant portion, starting from immediately after LLVM finishes installing:

gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/llvm/build'
cargo:root=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/llvm
	finished in 223.686
      < Llvm { target: "x86_64-unknown-freebsd", emscripten: false }
Building stage0 codegen artifacts (x86_64-unknown-freebsd -> x86_64-unknown-freebsd, llvm)
running: "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "--release" "--frozen" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_trans/Cargo.toml" "--features" " jemalloc" "--message-format" "json"
   Compiling libc v0.2.39
   Compiling cfg-if v0.1.2
   Compiling rustc_trans v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_trans)
   Compiling cmake v0.1.29
   Compiling num_cpus v1.8.0
   Compiling tempdir v0.3.5
   Compiling filetime v0.1.15
   Compiling build_helper v0.1.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/build_helper)
   Compiling rustc_binaryen v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_binaryen)
   Compiling rustc_llvm v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_llvm)
    Finished release [optimized] target(s) in 232.75 secs
updating "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/.tmp.stamp" as "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/librustc_trans-a44a47c41a7a8444.so" changed
    < CodegenBackend { compiler: Compiler { stage: 0, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd", backend: "llvm" }
Assembling stage1 compiler (x86_64-unknown-freebsd)
    > Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
    < Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
    c Libdir { compiler: Compiler { stage: 0, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
    > Libdir { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
      c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
    < Libdir { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
    c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
  < Assemble { target_compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
  > Rustc { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
    > Test { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
      > Std { target: "x86_64-unknown-freebsd", compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
        > StartupObjects { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
        < StartupObjects { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
Building stage1 std artifacts (x86_64-unknown-freebsd -> x86_64-unknown-freebsd)
        c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
Dirty - /wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-std
        c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
        c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
        c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
running: "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "--release" "--frozen" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libstd/Cargo.toml" "--message-format" "json"
error: process didn't exit successfully: `/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/bootstrap/debug/rustc -vV` (signal: 11, SIGSEGV: invalid memory reference)
--- stdout
rustc 1.25.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-freebsd
release: 1.25.0

thread 'main' panicked at 'command did not execute successfully: "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "--release" "--frozen" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', bootstrap/compile.rs:1060:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Traceback (most recent call last):
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/x.py", line 20, in <module>
    bootstrap.main()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/bootstrap/bootstrap.py", line 763, in main
    bootstrap()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/bootstrap/bootstrap.py", line 754, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.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.25.0-src/build/bootstrap/debug/bootstrap build --verbose --config ./config.toml --jobs 4
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust
Comment 15 Bryan Drewery freebsd_committer freebsd_triage 2018-04-02 19:07:27 UTC
(In reply to Bryan Drewery from comment #14)
> Try https://people.freebsd.org/~bdrewery/patches/rust-125.diff

Passes for me on amd64 FreeBSD-12/head.
Comment 16 Charlie Li freebsd_committer freebsd_triage 2018-04-02 22:33:04 UTC
(In reply to Bryan Drewery from comment #14)
This patch causes either other processes or the build (in poudriere) on my machine to get killed for "out of swap space", but when actually monitoring the swap usage, the numbers don't even approach 50% usage, plus no apparent indication of runaway memory usage of any kind. Example of when the system chooses to kill rustc:

updating "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-test/x86_64-unknown-freebsd/release/.libtest.stamp" as "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-test/x86_64-unknown-freebsd/release/deps/libtest-a82a27a8b82dbd80.so" changed
      c Assemble { target_compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
      > TestLink { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target_compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
Copying stage1 test from stage1 (x86_64-unknown-freebsd -> x86_64-unknown-freebsd / x86_64-unknown-freebsd)
        c Libdir { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
        > CleanTools { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd", mode: Libtest }
Dirty - /wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-tools
        < CleanTools { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd", mode: Libtest }
      < TestLink { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target_compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
    < Test { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" }, target: "x86_64-unknown-freebsd" }
    c Assemble { target_compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
    c Std { target: "x86_64-unknown-freebsd", compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
Building stage1 compiler artifacts (x86_64-unknown-freebsd -> x86_64-unknown-freebsd)
Dirty - /wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc
    c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
    c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
    c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
    c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
    c Sysroot { compiler: Compiler { stage: 1, host: "x86_64-unknown-freebsd" } }
running: "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "--release" "--frozen" "--features" " jemalloc" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/rustc/Cargo.toml" "--message-format" "json"
   Compiling rustc-serialize v0.3.24
   Compiling serialize v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libserialize)
   Compiling rustc_driver v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_driver)
   Compiling ar v0.3.1
   Compiling arena v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libarena)
   Compiling fmt_macros v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libfmt_macros)
   Compiling rustc_platform_intrinsics v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_platform_intrinsics)
   Compiling bitflags v1.0.1
   Compiling stable_deref_trait v1.0.0
   Compiling rustc v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc)
   Compiling byteorder v1.2.1
   Compiling rustc_incremental v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_incremental)
   Compiling libc v0.2.39
   Compiling cc v1.0.4
   Compiling lazy_static v0.2.11
   Compiling rustc_back v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_back)
   Compiling graphviz v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libgraphviz)
   Compiling cfg-if v0.1.2
   Compiling rustc-demangle v0.1.5
   Compiling smallvec v0.6.0
   Compiling syntax v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libsyntax)
   Compiling rustc_metadata v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_metadata)
   Compiling unicode-width v0.1.4
   Compiling rustc_cratesio_shim v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_cratesio_shim)
   Compiling owning_ref v0.3.3
   Compiling rand v0.3.20
   Compiling jobserver v0.1.9
   Compiling log_settings v0.1.1
   Compiling rls-span v0.4.0
   Compiling log v0.4.1
   Compiling miniz-sys v0.1.10
   Compiling backtrace-sys v0.1.16
   Compiling rustc_apfloat v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_apfloat)
   Compiling rls-data v0.15.0
   Compiling log v0.3.9
   Compiling parking_lot_core v0.2.9
   Compiling env_logger v0.4.3
   Compiling flate2 v1.0.1
   Compiling parking_lot v0.5.3
   Compiling rustc_data_structures v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_data_structures)
   Compiling backtrace v0.3.5
   Compiling syntax_pos v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libsyntax_pos)
   Compiling rustc_errors v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_errors)
   Compiling rustc_const_math v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/librustc_const_math)
   Compiling proc_macro v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libproc_macro)
   Compiling syntax_ext v0.0.0 (file:///wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/libsyntax_ext)
error: Could not compile `rustc`.

Caused by:
  process didn't exit successfully: `/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/bootstrap/debug/rustc --crate-name rustc librustc/lib.rs --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=76c8ebab465abe82 -C extra-filename=-76c8ebab465abe82 --out-dir /wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -L dependency=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps -L dependency=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/release/deps --extern rustc_errors=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/librustc_errors-60c6611063a4d140.so --extern serialize=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libserialize-e7044d6b5dbcb0e9.so --extern serialize=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libserialize-e7044d6b5dbcb0e9.rlib --extern arena=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libarena-6a220aa571aeab9a.so --extern rustc_back=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/librustc_back-527d1f33d3f12941.so --extern log=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/liblog-8ff70a91fe2b5bc1.rlib --extern backtrace=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libbacktrace-67db5cbd24329dd6.rlib --extern bitflags=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libbitflags-927b3256811c6bce.rlib --extern byteorder=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libbyteorder-ad409fe84b02b3ef.rlib --extern rustc_data_structures=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/librustc_data_structures-11e028d6128cd579.so --extern rustc_const_math=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/librustc_const_math-0d06d3da7e907fe2.so --extern flate2=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libflate2-8e11dfe9aac7aacb.rlib --extern graphviz=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libgraphviz-3445d3dcca68ab80.so --extern rustc_apfloat=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/librustc_apfloat-69dc227e3a8c202d.rlib --extern syntax_pos=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libsyntax_pos-07c884fb136971ea.so --extern jobserver=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libjobserver-d6fda7379e6d4aa4.rlib --extern fmt_macros=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libfmt_macros-550ecdcf9c6a8fbb.so --extern syntax=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/deps/libsyntax-cd2b3365f5cbdbf2.so -L native=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/build/backtrace-sys-d1911a6b0bd90021/out/.libs -L native=/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage1-rustc/x86_64-unknown-freebsd/release/build/miniz-sys-a865c9622ac6cc29/out` (signal: 9, SIGKILL: kill)
thread 'main' panicked at 'command did not execute successfully: "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "--release" "--frozen" "--features" " jemalloc" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', bootstrap/compile.rs:1060:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Traceback (most recent call last):
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/x.py", line 20, in <module>
    bootstrap.main()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/bootstrap/bootstrap.py", line 763, in main
    bootstrap()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.0-src/src/bootstrap/bootstrap.py", line 754, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.25.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.25.0-src/build/bootstrap/debug/bootstrap build --verbose --config ./config.toml --jobs 4
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust

So far, only my obsoleted patch, which is merely a reformulated lang/rust-nightly from 20180328 (current version in ports), manages to build successfully, including passing testport.
Comment 17 Bryan Drewery freebsd_committer freebsd_triage 2018-04-02 23:04:16 UTC
(In reply to Charlie Li from comment #16)
> (In reply to Bryan Drewery from comment #14)
> This patch causes either other processes or the build (in poudriere) on my
> machine to get killed for "out of swap space", but when actually monitoring
> the swap usage, the numbers don't even approach 50% usage, plus no apparent
> indication of runaway memory usage of any kind. Example of when the system
> chooses to kill rustc:

So add more swap or reduce MAKE_JOBS_NUMBER in make.conf.  Rust is more aggressive
with using multiple CPU in the build now.
Comment 18 Charlie Li freebsd_committer freebsd_triage 2018-04-02 23:17:19 UTC
(In reply to Bryan Drewery from comment #17)
This was from testport, so rust is the only item building. Furthermore, PARALLEL_JOBS is already reduced to 3 (ncpu - 1 on my machine). Still does not explain why my patch didn't have this problem.
Comment 19 Bryan Drewery freebsd_committer freebsd_triage 2018-04-02 23:24:53 UTC
(In reply to Charlie Li from comment #18)
> (In reply to Bryan Drewery from comment #17)
> This was from testport, so rust is the only item building. Furthermore,
> PARALLEL_JOBS is already reduced to 3 (ncpu - 1 on my machine). Still does
> not explain why my patch didn't have this problem.

testport allows MAKE_JOBS to use all CPUS, it is not related to PARALLEL_JOBS.
You would need to set MAKE_JOBS_NUMBER=3 in make.conf too.

I don't know about your patch but it was wrong. You removed the bootstrap patching
which is still needed on head.  You bumped the bootstrap date to a newer one which
resolves the problem but why not build with the bootstrap it expects rather
than a newer one?  While it fixes one thing it may break another subtly.

files/patch-src_librustc__back_target_freebsd__base.rs is still partially needed as only 1 of the changes were upstreamed for 1.25.  The 'is_like_openbsd' is still needed.

The binaryen patch is still needed as it is still used in 1.25.
Comment 20 Charlie Li freebsd_committer freebsd_triage 2018-04-02 23:47:15 UTC
(In reply to Bryan Drewery from comment #17)
> So add more swap
That's not happening period. Also makes no sense considering that (at further investigation) swap usage plateaus at 30%, even at the process kill point.
Comment 21 Bryan Drewery freebsd_committer freebsd_triage 2018-04-02 23:54:00 UTC
(In reply to Charlie Li from comment #20)
> (In reply to Bryan Drewery from comment #17)
> > So add more swap
> That's not happening period. Also makes no sense considering that (at
> further investigation) swap usage plateaus at 30%, even at the process kill
> point.

If you're on head or 11-STABLE it's kind of a known problem right now
that things are swapping too much. https://lists.freebsd.org/pipermail/freebsd-current/2018-March/068753.html
Comment 22 Charlie Li freebsd_committer freebsd_triage 2018-04-09 18:39:35 UTC
Comment on attachment 192083 [details]
12-CURRENT build log

It turns out that the bogus OOM kill was caused by base r331732; I have since updated past base r331879 which fixes the problem. Thus, bdrewery@'s patch as-is builds successfully and passes testport on my machine now.
Comment 23 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2018-04-10 06:54:49 UTC
Hi!

I tested bdrewery's patch successfully on 10.4 amd64 and i386 with `poudriere testport`. It's HEAD amd64's turn now.

Meanwhile, I will prepare the bootstraps for aarch64.

Thank you for preparing the patch!
Comment 24 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2018-04-10 21:36:24 UTC
The aarch64 bootstraps were uploaded to `LOCAL/dumbbell`. bdrewery, could you please update the `distinfo` in your patch and possibly commit it?
Comment 25 commit-hook freebsd_committer freebsd_triage 2018-04-16 21:36:20 UTC
A commit references this bug:

Author: bdrewery
Date: Mon Apr 16 21:35:26 UTC 2018
New revision: 467538
URL: https://svnweb.freebsd.org/changeset/ports/467538

Log:
  Update to 1.25.0.

  - The ABI patch is no longer needed on head due to fixes being upstreamed
    to use the pre-ino64 symbols.  The ABI patch is still needed for the
    bootstrap but should be removable for 1.26.0 if it uses beta 2018-03-18.

  PR:		227130 [based on]
  Tested by:	dumbbell, Charlie Li
  Submitted by:	riggs [based on]
  Differential Revision:	https://reviews.freebsd.org/D14921 [based on]

Changes:
  head/lang/rust/Makefile
  head/lang/rust/distinfo
  head/lang/rust/files/extra-patch-abi
  head/lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs
Comment 26 commit-hook freebsd_committer freebsd_triage 2018-04-16 21:38:24 UTC
A commit references this bug:

Author: bdrewery
Date: Mon Apr 16 21:37:22 UTC 2018
New revision: 467539
URL: https://svnweb.freebsd.org/changeset/ports/467539

Log:
  MFH: r467538

  Update to 1.25.0.

  - The ABI patch is no longer needed on head due to fixes being upstreamed
    to use the pre-ino64 symbols.  The ABI patch is still needed for the
    bootstrap but should be removable for 1.26.0 if it uses beta 2018-03-18.

  PR:		227130 [based on]
  Tested by:	dumbbell, Charlie Li
  Submitted by:	riggs [based on]
  Differential Revision:	https://reviews.freebsd.org/D14921 [based on]

  Approved by:	portmgr (implicit)

Changes:
_U  branches/2018Q2/
  branches/2018Q2/lang/rust/Makefile
  branches/2018Q2/lang/rust/distinfo
  branches/2018Q2/lang/rust/files/extra-patch-abi
  branches/2018Q2/lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs