Bug 235241 - lang/rust does not build on amd64 12.0 (bootstrap is for wrong version)
Summary: lang/rust does not build on amd64 12.0 (bootstrap is for wrong version)
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: FreeBSD Rust Team
Depends on:
Reported: 2019-01-27 11:53 UTC by pr
Modified: 2019-02-08 14:36 UTC (History)
2 users (show)

See Also:
tobik: maintainer-feedback+

rust-1.30 poudriere log on 12.0 RELEASE (45.70 KB, text/plain)
2019-01-30 17:47 UTC, pr
no flags Details
rust-1.32.0 poudriere log (84.76 KB, text/plain)
2019-02-08 14:36 UTC, Lorenzo Salvadore
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description pr 2019-01-27 11:53:47 UTC
lang/cargo does not build on 12.0 amd64. This is annoying since this prevents firefox from building.

How to reproduce:
cd /usr/ports/lang/rust && make

  extracting cargo-0.32.0-x86_64-unknown-freebsd/cargo/share/doc/cargo/LICENSE-APACHE
  extracting cargo-0.32.0-x86_64-unknown-freebsd/cargo/share/doc/cargo/LICENSE-MIT
  extracting cargo-0.32.0-x86_64-unknown-freebsd/cargo/share/doc/cargo/LICENSE-THIRD-PARTY
  extracting cargo-0.32.0-x86_64-unknown-freebsd/cargo/share/doc/cargo/README.md
  extracting cargo-0.32.0-x86_64-unknown-freebsd/cargo/manifest.in
  extracting cargo-0.32.0-x86_64-unknown-freebsd/cargo/etc/bash_completion.d/cargo
  extracting cargo-0.32.0-x86_64-unknown-freebsd/cargo/bin/cargo
  extracting cargo-0.32.0-x86_64-unknown-freebsd/cargo/share/zsh/site-functions/_cargo
running: /usr/ports/lang/rust/work/rustc-1.32.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo build --manifest-path /usr/ports/lang/rust/work/rustc-1.32.0-src/src/bootstrap/Cargo.toml --frozen
Traceback (most recent call last):
  File "/usr/ports/lang/rust/work/rustc-1.32.0-src/x.py", line 20, in <module>
  File "/usr/ports/lang/rust/work/rustc-1.32.0-src/src/bootstrap/bootstrap.py", line 853, in main  
  File "/usr/ports/lang/rust/work/rustc-1.32.0-src/src/bootstrap/bootstrap.py", line 824, in bootstrap
  File "/usr/ports/lang/rust/work/rustc-1.32.0-src/src/bootstrap/bootstrap.py", line 652, in build_bootstrap
    run(args, env=env, verbose=self.verbose)
  File "/usr/ports/lang/rust/work/rustc-1.32.0-src/src/bootstrap/bootstrap.py", line 151, in run   
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/ports/lang/rust/work/rustc-1.32.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo build --manifest-path /usr/ports/lang/rust/work/rustc-1.32.0-src/src/bootstrap/Cargo.toml --frozen
*** Error code 1

make[1]: stopped in /usr/ports/lang/rust
*** Error code 1

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


The error is not clear, so if you execute by hand the failing command you get some more info:
/usr/ports/lang/rust # /usr/ports/lang/rust/work/rustc-1.32.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo build --manifest-path /usr/ports/lang/rust/work/rustc-1.32.0-src/src/bootstrap/Cargo.toml --frozen
Bad system call (core dumped)

cargo bootstrap does not work, and with a reason: it's built for 10.3 when we are on 12.0 now, in fact:
:/usr/ports/lang/rust # file /usr/ports/lang/rust/work/rustc-1.32.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo
/usr/ports/lang/rust/work/rustc-1.32.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 10.3, FreeBSD-style, with debug_info, not stripped


Suggested action: either rebuild the bootstrap for 12.0 or have cargo be a port on its own that builds for the current OS version.
Comment 1 Tobias Kortkamp freebsd_committer 2019-01-27 12:13:54 UTC
Yeah, this is known.

> with a reason: it's built for 10.3 when we are on 12.0 now,

May I suggest that you just rebuilt your kernel with COMPAT_FREEBSD10 and
Comment 2 mikael.urankar 2019-01-27 12:29:22 UTC
freebsd 10.x is eol, why do we rely on something built for 10.x?
Comment 3 pr 2019-01-29 11:23:41 UTC
(In reply to Tobias Kortkamp from comment #1)
Hi Tobias,
thank you for your reply.

Compatibility is already there, my poudriere builder is running GENERIC:
options         COMPAT_FREEBSD9         # Compatible with FreeBSD9
options         COMPAT_FREEBSD10        # Compatible with FreeBSD10
options         COMPAT_FREEBSD11        # Compatible with FreeBSD11
options         SCSI_DELAY=5000         # Delay (in ms) before probing SCSI
So it's not a workaround but thanks for suggesting it.

Possible solution would be to bootstrap a new cargo on 12.0 and/or CURRENT.

The problem is that cargo needs itself to build, README.md reads:
cargo build --release
This is a chicken and egg problem, really.

BTW, I agree with #2. ;)
Comment 4 Tobias Kortkamp freebsd_committer 2019-01-30 16:33:56 UTC
Can you share the entire Poudriere build log?
Comment 5 pr 2019-01-30 17:47:41 UTC
Created attachment 201537 [details]
rust-1.30 poudriere log on 12.0 RELEASE
Comment 6 Jan Beich freebsd_committer 2019-01-31 00:24:32 UTC
Comment on attachment 201537 [details]
rust-1.30 poudriere log on 12.0 RELEASE

> KERNCONF=       PAR1

Doesn't look like GENERIC kernel.
Comment 7 Lorenzo Salvadore 2019-02-08 14:36:04 UTC
Created attachment 201840 [details]
rust-1.32.0 poudriere log

I have the same issue.

I tried with GENERIC kernel and it did not work for me either. The log I attach is for version 1.32.0 (should be latest), obtained with poudriere. No KERNCONF line appears: I think this is a confirmation that I really used GENERIC kernel.