Skip to content

rust 1.81.0 buildable with LLVM 17.x? #131291

Closed

Description

@he32

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?

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 5, 2024
  2. dianqk commented on Oct 5, 2024

    @dianqk
    Member

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

  3. he32 commented on Oct 5, 2024

    @he32
    ContributorAuthor

    #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...
    
  4. he32 commented on Oct 5, 2024

    @he32
    ContributorAuthor

    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} 
    
  5. dianqk commented on Oct 5, 2024

    @dianqk
    Member

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

  6. dianqk commented on Oct 5, 2024

    @dianqk
    Member

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

  7. he32 commented on Oct 5, 2024

    @he32
    ContributorAuthor

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

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

  8. lqd commented on Oct 5, 2024

    @lqd
    Member

    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.

  9. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    C-bugCategory: This is a bug.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 5, 2024
  10. removed
    C-bugCategory: This is a bug.
    on Oct 5, 2024
  11. he32 commented on Oct 5, 2024

    @he32
    ContributorAuthor
  12. lqd commented on Oct 5, 2024

    @lqd
    Member

    #126701 enabled lld on the dist profile

  13. he32 commented on Oct 6, 2024

    @he32
    ContributorAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions