Page MenuHomeFreeBSD

lang/rust: Update to 1.55.0
ClosedPublic

Authored by tobik on Sep 7 2021, 11:58 AM.
Tags
None
Referenced Files
F106126133: D31872.diff
Wed, Dec 25, 8:07 PM
Unknown Object (File)
Thu, Dec 19, 4:17 PM
Unknown Object (File)
Wed, Nov 27, 2:19 PM
Unknown Object (File)
Nov 23 2024, 3:36 PM
Unknown Object (File)
Nov 22 2024, 5:54 AM
Unknown Object (File)
Nov 19 2024, 9:55 PM
Unknown Object (File)
Nov 19 2024, 12:13 PM
Unknown Object (File)
Nov 19 2024, 12:12 PM
Subscribers

Details

Summary

Scheduled to be released on 2021-09-09.

https://internals.rust-lang.org/t/rust-1-55-0-pre-release-testing/15292
https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1550-2021-09-09

  • Set codegen-units=1 per PR 256099
  • Add hack to skip cargo update on git sources as a step towards solving PR 256581
  • Add patch from D31568
Test Plan

13.0 amd64 Poudriere build ok
13.0 powerpc Poudriere build ok
13.0 powerpc64le Poudriere build ok

ref11-i386 ok
ref12-amd64 ok
ref12-ppc64 ok
ref13-aarch64 ok
ref13-ppc64 in progress
ref14-amd64 ??

Exp-run: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258337

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 41439
Build 38328: arc lint + arc unit

Event Timeline

tobik held this revision as a draft.
tobik published this revision for review.Sep 7 2021, 12:07 PM
tobik edited the summary of this revision. (Show Details)
tobik edited the test plan for this revision. (Show Details)
  • Unbreak CARGO_USE_GIT* consumers

Can you update patch-src_llvm-project_compiler-rt_lib_builtins_cpu__model.c with what will probably be committed upstream : https://reviews.llvm.org/D109330 . I've put the updated file on freefall.
In lang/rust-bootstrap: we can remove the llvm90 dep for aarch64 with the following patch:

--- a/lang/rust-bootstrap/Makefile
+++ b/lang/rust-bootstrap/Makefile
@@ -34,7 +35,6 @@ FLAVORS=      aarch64 amd64 armv6 armv7 i386 powerpc64_elfv1 powerpc64_elfv2 \
 FLAVOR?=       ${FLAVORS:[1]}
 
 aarch64_PKGNAMEPREFIX=         aarch64-
-aarch64_BUILD_DEPENDS=         llvm90>0:devel/llvm90
 amd64_PKGNAMEPREFIX=           amd64-
 armv6_PKGNAMEPREFIX=           armv6-
 armv7_PKGNAMEPREFIX=           armv7-
@@ -52,10 +52,6 @@ USE_GCC=     9:build
 .endif
 # for openssl-src crate
 USE_PERL5=     build
-.if ${FLAVOR} == aarch64
-CC=            clang90
-CXX=           clang++90
-.endif
 PATCHDIR=      ${.CURDIR}/../rust/files
 # rustc stashes intermediary files in TMPDIR (default /tmp) which
 # might cause issues for users that for some reason space limit
@@ -114,6 +110,7 @@ _RUST_LLVM_TARGET_powerpc=          PowerPC
 _RUST_LLVM_TRIPLE=                     ${_RUST_LLVM_TRIPLE_${FLAVOR}:U${_RUST_TARGET}}
 _RUST_LLVM_TRIPLE_armv6=               armv6-gnueabihf-freebsd
 _RUST_LLVM_TRIPLE_armv7=               armv7-gnueabihf-freebsd
+_RUST_LLVM_TRIPLE_aarch64=             aarch64-unknown-freebsd12.0
 _RUST_LLVM_TRIPLE_powerpc=             powerpc-unknown-freebsd13.0 # secure-plt
 
 .include <bsd.port.pre.mk>

Thanks!

www/deno/Makefile
467

FYI, Cargo has an (unstable) --out-dir option we hopefully can set in the future which lets us configure the directory for the final build artifacts. Then we don't need to do stuff like this to find them.

https://doc.rust-lang.org/cargo/commands/cargo-build.html#output-options
https://github.com/rust-lang/cargo/issues/6790

pkubaj requested changes to this revision.Sep 10 2021, 11:26 AM
pkubaj added a subscriber: pkubaj.

Fails to build on powerpc:

=>> Status   lang/rust | rust-1.55.0: build
=======================<phase: build          >============================
===>  Building for rust-1.55.0
rustup not detected: [Errno 2] No such file or directory: 'rustc'
falling back to auto-detect
running: /wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/cargo build --manifest-path /wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/Cargo.toml --verbose --frozen
Traceback (most recent call last):
  File "x.py", line 27, in <module>
    bootstrap.main()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/bootstrap.py", line 1209, in main
    bootstrap(help_triggered)
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/bootstrap.py", line 1180, in bootstrap
    build.build_bootstrap()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/bootstrap.py", line 936, in build_bootstrap
    run(args, env=env, verbose=self.verbose)
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/bootstrap.py", line 153, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/cargo build --manifest-path /wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/Cargo.toml --verbose --frozen
*** Error code 1
This revision now requires changes to proceed.Sep 10 2021, 11:26 AM

Fails to build on powerpc:

=>> Status   lang/rust | rust-1.55.0: build
=======================<phase: build          >============================
===>  Building for rust-1.55.0
rustup not detected: [Errno 2] No such file or directory: 'rustc'
falling back to auto-detect
running: /wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/cargo build --manifest-path /wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/Cargo.toml --verbose --frozen
Traceback (most recent call last):
  File "x.py", line 27, in <module>
    bootstrap.main()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/bootstrap.py", line 1209, in main
    bootstrap(help_triggered)
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/bootstrap.py", line 1180, in bootstrap
    build.build_bootstrap()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/bootstrap.py", line 936, in build_bootstrap
    run(args, env=env, verbose=self.verbose)
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/bootstrap.py", line 153, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/cargo build --manifest-path /wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/src/bootstrap/Cargo.toml --verbose --frozen
*** Error code 1

Any idea what could be broken?

The bootstrap compiler passes a simple smoke test for me (in a ppc jail in a qemu-system-ppc64 vm; all on FreeBSD 13.0-RELEASE). I can build and run a simple hello panic program. Does this work for you?

Yes.

root@powerpc-130-rust:~ # vi hello.rs
root@powerpc-130-rust:~ # /wrkdirs/usr/ports/lang/rust/work/bootstrap/bin/rustc hello.rs
root@powerpc-130-rust:~ # ./hello
Hello World!

I noticed that cargo segfaults:

root@powerpc-130-rust:~ # ls /wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/cargo.core
/wrkdirs/usr/ports/lang/rust/work/rustc-1.55.0-src/cargo.core

pid 61878 (cargo), jid 239, uid 0: exited on signal 11 (core dumped)

This is probably the reason why build fails.

  • lang/rust-bootstrap: Use devel/freebsd-sysroot
  • lang/rust: Bump powerpc bootstrap to 1.55

I was able to reproduce the cargo crash on powerpc but not sure why
it happens. Anyway bumping the powerpc bootstrap to a new 1.55 one
let's the build go further, but the qemu vm is too slow to let it
finish completely. Can you check if a full build works now?

Ok on powerpc, still have powerpc64le to test on.

Can you change the armv6/7 target triple to this please:

--- a/lang/rust-bootstrap/Makefile
+++ b/lang/rust-bootstrap/Makefile
@@ -112,8 +112,8 @@ _RUST_LLVM_TARGET_powerpc64_elfv2=  PowerPC
 _RUST_LLVM_TARGET_powerpc64le=         PowerPC
 _RUST_LLVM_TARGET_powerpc=             PowerPC
 _RUST_LLVM_TRIPLE=                     ${_RUST_LLVM_TRIPLE_${FLAVOR}:U${_RUST_TARGET}}
-_RUST_LLVM_TRIPLE_armv6=               armv6-gnueabihf-freebsd
-_RUST_LLVM_TRIPLE_armv7=               armv7-gnueabihf-freebsd
+_RUST_LLVM_TRIPLE_armv6=               armv6-unknown-freebsd12.2-gnueabihf
+_RUST_LLVM_TRIPLE_armv7=               armv7-unknown-freebsd12.2-gnueabihf
 _RUST_LLVM_TRIPLE_powerpc=             powerpc-unknown-freebsd13.0 # secure-plt
 
 .include <bsd.port.pre.mk>

Can you change the armv6/7 target triple to this please:

Done in fca27568df76

pkubaj edited the test plan for this revision. (Show Details)

@mikael Should I update the armv7 bootstrap with the new ones from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257419#c25 ?

Yes, and the armv6 one please (same location). Thanks a lot!

  • Use mikael's new armv* bootstraps
This revision was not accepted when it landed; it landed in state Needs Review.Sep 19 2021, 9:16 AM
This revision was automatically updated to reflect the committed changes.