Skip to content

download-ci-llvm does not include llvm-tblgen #86890

Closed

Description

@jyn514

In particular, this means you have to rebuild llvm for the host when cross-compiling.

I tried this code: x build --host i686-unknown-linux-gnu.

I expected to see this happen: The compiler builds successfully.

Instead, this happened:

-- Build files have been written to: /home/joshua/rustc3/build/i686-unknown-linux-gnu/llvm/build
running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--" "-j" "8"
ninja: error: '/home/joshua/rustc3/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-tblgen', needed by 'include/llvm/IR/Attributes.inc', missing and no known rule to make it
thread 'main' panicked at '
command did not execute successfully, got: exit status: 1

build script failed, must exit now', /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.44/src/lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
	finished in 8.264 seconds
failed to run: /home/joshua/rustc3/build/bootstrap/debug/bootstrap build --host i686-unknown-linux-gnu
Build completed unsuccessfully in 0:00:09

I think there's a secondary bug which is that x.py hard-codes llvm instead of ci-llvm/. But that seems easier to fix.

Meta

rustc --version --verbose:

<version>
Backtrace

<backtrace>

Activity

  1. added
    C-bugCategory: This is a bug.
    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to Rust
    A-crossArea: Cross compilation
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Jul 5, 2021
  2. jyn514 commented on Mar 29, 2022

    @jyn514
    MemberAuthor

    Mentoring instructions:

    1. Find where in src/bootstrap it generates the rust-dev component (I think I might be RustDev in dist.rs?)
    2. Add llvm-tblgen to the binaries that are copied
    3. Open a PR and ask someone to run @bors try, which will generate CI artifacts.
    4. Checkout the merge commit from the try build locally and confirm that x build --host i686-unknown-linux-gnu works successfully (or if you're not on Linux, some other platform that's binary compatible).
  3. jyn514 commented on Mar 29, 2022

    @jyn514
    MemberAuthor

    @rustbot label: +E-mentor

  4. added
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Mar 29, 2022
  5. bjorn3 commented on Mar 30, 2022

    @bjorn3
    Member

    Add llvm-tblgen to the binaries that are copied

    Make sure to only copy it if it exists. It doesn't get build if the llvm backend isn't enabled.

  6. cuviper commented on Oct 7, 2022

    @cuviper
    Member

    Make sure to only copy it if it exists. It doesn't get build if the llvm backend isn't enabled.

    It looks like RustDev unconditionally copies llvm binaries right now, so I think llvm-tblgen should be no different.

    rust/src/bootstrap/dist.rs

    Lines 2020 to 2033 in 43c22af

    for bin in &[
    "llvm-config",
    "llvm-ar",
    "llvm-objdump",
    "llvm-profdata",
    "llvm-bcanalyzer",
    "llvm-cov",
    "llvm-dwp",
    "llvm-nm",
    "llvm-dwarfdump",
    "llvm-dis",
    ] {
    tarball.add_file(src_bindir.join(exe(bin, target)), "bin", 0o755);
    }

  7. added 3 commits that reference this issue on Oct 8, 2022
    87e219a
    439a053
    854af44
  8. added a commit that references this issue on Oct 9, 2022
    21c6a0e
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

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-crossArea: Cross compilationC-bugCategory: This is a bug.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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