Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust 1.81.0 buildable with LLVM 17.x? #131291

Closed
he32 opened this issue Oct 5, 2024 · 10 comments
Closed

rust 1.81.0 buildable with LLVM 17.x? #131291

he32 opened this issue Oct 5, 2024 · 10 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@he32
Copy link
Contributor

he32 commented Oct 5, 2024

This is perhaps more of a question or a "release management" issue, perhaps even "documenting the latter".

In my quest to continue to have rust buildable & installable in NetBSD's pkgsrc system, I've now come to rust 1.81.0.

The package has an option to either build with an external LLVM (and libunwind) or with the embedded version of at least LLVM
in the rust tarball.

When going from rust 1.80.1 to rust 1.81.0 I find that the rust compiler no longer builds with an external LLVM 17.x.

The last time a bump in the requirement for an external LLVM happened was in the 1.79.0 release.

My question is whether someone missed bumping the requirement in the rust release notes for 1.81.0, or whether
the errors I'm seeing while trying to use an external LLVM are of my own or "our own" doing. The errors start with

[ 29%] Building CXX object COFF/CMakeFiles/lldCOFF.dir/CallGraphSort.cpp.o
[ 30%] Building CXX object MachO/CMakeFiles/lldMachO.dir/Arch/ARM64Common.cpp.o
In file included from /usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/src/llvm-project/lld/wasm/Driver.cpp:141:
/usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/build/x86_64-unknown-netbsd/lld/build/wasm/Options.inc:44:122: error: macro "OPTION" requires 13 arguments, but only 12 given
   44 | OPTION(prefix_0, llvm::StringLiteral("<input>"), INPUT, Input, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
      |                                                                                                                          ^
/usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/src/llvm-project/lld/wasm/Driver.cpp:134: note: macro "OPTION" defined here
  134 | #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS,         \
      | 

For some reason the build appears to want to build LLD.

Did someone not test building with an external LLVM 17.x? Does rust now from 1.81.0 in fact need an external LLVM >= 18?

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 5, 2024
@DianQK
Copy link
Member

DianQK commented Oct 5, 2024

#130487 drop LLVM 17 at Rust 1.83.0. It looks like your logs are building the LLVM bundled with Rust?

@he32
Copy link
Contributor Author

he32 commented Oct 5, 2024

#130487 drop LLVM 17 at Rust 1.83.0. It looks like your logs are building the LLVM bundled with Rust?

Actually no, as I said, it's trying to build LLD (I don't know why). The percentage progress starts with

-- Build files have been written to: /usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/build/x86_64-unknown-netbsd/lld/build
running: cd "/usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/build/x86_64-unknown-netbsd/lld/build" && DESTDIR="" "cmake" "--build" "." "--target" "install" "--config" "Release" "--" "-j" "20"
[  0%] Built target intrinsics_gen
[  3%] Building Options.inc...
[  3%] Building Options.inc...

@he32
Copy link
Contributor Author

he32 commented Oct 5, 2024

And ... the build phases it has started are:

: {110} egrep '^Build' list.01
Building bootstrap
Building stage0 library artifacts (x86_64-unknown-netbsd)
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-netbsd)
Building LLD for x86_64-unknown-netbsd
: {111} 

@DianQK
Copy link
Member

DianQK commented Oct 5, 2024

Ah, I guess it's #124129. You can disable lld.

@DianQK
Copy link
Member

DianQK commented Oct 5, 2024

IIUC, after #126282, you just need to set the channel to stable.
cc @lqd

@he32
Copy link
Contributor Author

he32 commented Oct 5, 2024

Ah, I guess it's #124129. You can disable lld.

That would explain it, I'm pursuing that hint.

@lqd
Copy link
Member

lqd commented Oct 5, 2024

Yes, just set rust.lld=false if you don’t want to build lld. If you’re using an external llvm, not building dev/nightly, not building for x64 linux and so on, it should already be disabled though. In case not, setting it explicitly will disable it for sure.

edit: ah you’re probably using the dist profile, lld is enabled there.

@saethlin saethlin added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 5, 2024
@lqd lqd removed the C-bug Category: This is a bug. label Oct 5, 2024
@he32
Copy link
Contributor Author

he32 commented Oct 5, 2024 via email

@lqd
Copy link
Member

lqd commented Oct 5, 2024

#126701 enabled lld on the dist profile

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this issue Oct 5, 2024
The external LLVM may be older (e.g. 17) than the internal LLD (now
18.x together with the rest of the embedded LLVM), ref.
rust-lang/rust#131291
@he32
Copy link
Contributor Author

he32 commented Oct 6, 2024

OK, that worked around the issue for the package.
Again, many thanks for the quick hints which led me on the correct path.

@he32 he32 closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants