Page MenuHomeFreeBSD

lang/rust-nightly: Upgrade to 1.12.0
ClosedPublic

Authored by dumbbell on Jul 21 2016, 6:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 29 2024, 1:25 AM
Unknown Object (File)
Nov 25 2024, 4:26 PM
Unknown Object (File)
Oct 19 2024, 11:01 PM
Unknown Object (File)
Oct 19 2024, 9:42 PM
Unknown Object (File)
Oct 2 2024, 9:45 AM
Unknown Object (File)
Sep 21 2024, 10:36 AM
Unknown Object (File)
Sep 17 2024, 11:16 PM
Unknown Object (File)
Sep 16 2024, 12:34 AM
Subscribers

Details

Summary

Upstream now uses a new way to fetch a bootstrap compiler: we should no
longer have trouble as we had with snapshots before.

There is a new patch for mk/rt.mk because the internal built LLVM uses
"freebsd" instead of "linux" in a directory name now. I wonder what to
do for DragonFlyBSD if this port is available.

Diff Detail

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

Event Timeline

dumbbell retitled this revision from to lang/rust-nightly: Upgrade to 1.12.0.
dumbbell updated this object.
dumbbell edited the test plan for this revision. (Show Details)
dumbbell added reviewers: asomers, jbeich, koobs, riggs, will.
asomers requested changes to this revision.Jul 22 2016, 3:23 AM
asomers edited edge metadata.

The build fails because it can't find distinfo for the bootstrap compiler. The bootstrap compiler's distinfo _is_ in the lang/rust/distinfo file. Is there a way to specify a master distinfo file as well as a master Makefile?

# make
===>  License APACHE20  MIT accepted by the user
===>  Found saved configuration for rust-nightly-1.12.0.20160717
===>   rust-nightly-1.12.0.20160717 depends on file: /usr/local/sbin/pkg - found
=> rustc-1.9.0-x86_64-unknown-freebsd.tar.gz is not in /usr/ports/lang/rust-nightly/distinfo.
=> Either /usr/ports/lang/rust-nightly/distinfo is out of date, or
=> rustc-1.9.0-x86_64-unknown-freebsd.tar.gz is spelled incorrectly.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/rust-nightly
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust-nightly
lang/rust-nightly/Makefile
33–35

I think this comment is out of date. There is no lang/rust/FIXME.

This revision now requires changes to proceed.Jul 22 2016, 3:23 AM

The build fails because it can't find distinfo for the bootstrap compiler. The bootstrap compiler's distinfo _is_ in the lang/rust/distinfo file. Is there a way to specify a master distinfo file as well as a master Makefile?

lang/rust hunk is missing. Look for RUST_BOOT_VERSION and replace = with ?=.

lang/rust-nightly/Makefile
33–35

See FIXME comment around CONFLICTS_BUILD in lang/rust/Makefile. I thought it was obvious that master variables are defined in a Makefile.

dumbbell edited edge metadata.

Include change to lang/rust/Makefile

While here, improve the comment about CONFLICTS_* variables.

@asomers: Sorry, @jbeich is right, I forgot to include the change to lang/rust/Makefile in the review...

jbeich requested changes to this revision.Jul 22 2016, 11:23 PM
jbeich edited edge metadata.

poudriere bulk -t fails. If in doubt look at lang/rust/pkg-plist for fixes.

====> Running Q/A tests (stage-qa)
[...]
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: lib/rustlib/manifest-rust-docs
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: %%DOCSDIR%%/COPYRIGHT
Error: Missing: %%DOCSDIR%%/LICENSE-APACHE
Error: Missing: %%DOCSDIR%%/LICENSE-MIT
Error: Missing: %%DOCSDIR%%/README.md
===> Error: Plist issues found.
*** Error code 1
lang/rust-nightly/Makefile
12–13

Don't forget to remove this line.

33–35

Try to avoid += or ?= unless necessary.

lang/rust-nightly/files/patch-mk_rt.mk
11

mk/rt.mk has:
# $(1) is the target triple

Looking at the list of targets under mk/cfg/ directory the following version may work better.

COMPRT_DIR_$(1) := $$(word 3, $$(subst -, , $(1)))

Alternatively, update past ee6011fc71e0 and drop the patch.

lang/rust-nightly/pkg-plist
104

Just drop all @dir lines unless make restage check-plist complains about empty directories.

This revision now requires changes to proceed.Jul 22 2016, 11:23 PM

FYI, mk/rt.mk was completely rewritten by change ee6011fc71e02485f2dffcc25be64631c2008775 on 16-July. Your patch won't apply, the build fails, and I haven't figured out how to fix it yet.

https://github.com/rust-lang/rust/commit/ee6011fc71e02485f2dffcc25be64631c2008775

dumbbell edited edge metadata.
dumbbell marked 4 inline comments as done.

Address @jbeich comments

  • Remove the BROKEN flag
  • Use = instead of += when the latter is not needed
  • Improve patch to mk/rt.mk
  • Fix pkg-plist

@asomers: I confirm I get the following build failure too and couldn't figure out a solution:

'cc' -O2 -pipe  -isystem /usr/local/include -fstack-protector -fno-strict-aliasing -fno-builtin -fvisibility=hidden -fomit-frame-pointer -ffreestanding  -O2 -g -fPIC -I/usr/local/include -O2 -pipe  -isystem /usr/local/include -fstack-protector -fno-strict-aliasing -c -o x86_64-unknown-freebsd/rt/compiler-rt/x86_64/floatdidf.o /wrkdirs/usr/ports/lang/rust-nightly/work/rust-ad264f7/src/compiler-rt/lib/builtins/x86_64/floatdidf.c
cpp: warning: argument unused during compilation: '-E'
/wrkdirs/usr/ports/lang/rust-nightly/work/rust-ad264f7/src/compiler-rt/lib/builtins/gcc_personality_v0.c:14:10: fatal error: 'unwind.h' file not found
#include <unwind.h>
         ^
1 error generated.
'cc' -O2 -pipe  -isystem /usr/local/include -fstack-protector -fno-strict-aliasing -fno-builtin -fvisibility=hidden -fomit-frame-pointer -ffreestanding  -O2 -g -fPIC -I/usr/local/include -O2 -pipe  -isystem /usr/local/include -fstack-protector -fno-strict-aliasing -c -o x86_64-unknown-freebsd/rt/compiler-rt/x86_64/floatdisf.o /wrkdirs/usr/ports/lang/rust-nightly/work/rust-ad264f7/src/compiler-rt/lib/builtins/x86_64/floatdisf.c
gmake[1]: *** [/wrkdirs/usr/ports/lang/rust-nightly/work/rust-ad264f7/mk/rt.mk:700: x86_64-unknown-freebsd/rt/compiler-rt/gcc_personality_v0.o] Error 1
gmake[1]: *** Waiting for unfinished jobs....

So I didn't udpate the port further and went with @jbeich suggestion of improving the patch to mk/rt.mk.

jbeich edited edge metadata.
jbeich added a subscriber: dim.

Looks good but fix minor regression when landing.

As for missing <unwind.h> @dim may remember the details why we have it only for C++ but not C with base Clang.

$ find /usr/src -name unwind.h
/usr/src/contrib/llvm/projects/libunwind/include/unwind.h
/usr/src/contrib/llvm/tools/clang/lib/Headers/unwind.h
/usr/src/contrib/libcxxrt/unwind.h
/usr/src/contrib/libexecinfo/unwind.h
/usr/src/include/unwind.h

$ find /usr/include -name unwind.h
/usr/include/c++/v1/unwind.h

$ pkg info -l llvm38 | fgrep unwind.h
        /usr/local/llvm38/lib/clang/3.8.0/include/unwind.h
lang/rust-nightly/files/patch-mk_main.mk
8

Why do you need to expand %%LOCALBASE%%? It's already handled by post-patch in lang/rust.

lang/rust-nightly/files/patch-mk_main.mk
8

Oups, sorry, it was changed by make makepatch and I forgot to remove that change... Thanks!

dumbbell edited edge metadata.

Do not expand %%LOCALBASE%% in patch-mk_main.mk

jbeich edited edge metadata.
riggs edited edge metadata.

Sorry for not getting a chance to start this review before today. Looks good, go ahead!

Looks good but fix minor regression when landing.

As for missing <unwind.h> @dim may remember the details why we have it only for C++ but not C with base Clang.

$ find /usr/src -name unwind.h
/usr/src/contrib/llvm/projects/libunwind/include/unwind.h
/usr/src/contrib/llvm/tools/clang/lib/Headers/unwind.h
/usr/src/contrib/libcxxrt/unwind.h
/usr/src/contrib/libexecinfo/unwind.h
/usr/src/include/unwind.h

Actually, it's @emaste who is attempting to fix this, by importing LLVM's libunwind. However, we still don't have any unwind.h in /usr/include by default. The in-tree compiler-rt build uses the libcxxrt version of unwind.h, but this is only available in /usr/obj during a full buildworld...

Back when rust was still using cmake to build compiler-rt, it checked for the presence of unwind.h and if absent would not compile gcc_personality_v0.c. So the straightforward solution is to omit gcc_personality_v0.c from the post-cmake build. I committed that as https://github.com/rust-lang/rust/commit/8604c5494eed8d111757f23a874d9ce8ca673e2c .

This revision was automatically updated to reflect the committed changes.