rust-lang / rust-lang/rustup

Placing llvm-tools installed via rustup onto the PATH

Open
#3,397 3 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Problem you are trying to solve

I have been working with the llvm-tools-preview component (in this case llvm-profdata).

These executables seem to be installed into an atypical bin directory inside the toolchain directory:

# location of llvm-profdata
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata

# location of rustc
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc

This means that for whatever combination of OS / target / toolchain I am running, I need to deduce the correct path to llvm-profdata myself. See for example https://github.com/pydantic/pydantic-core/blob/5c696e5ab32f323753f6c4da0000f4475225673c/.github/workflows/ci.yml#L471

Solution you'd like

It would be nice to have a supported way in rustup to run llvm-profdata for the target toolchain. Maybe rustup run could add this bin directory onto the PATH, so that e.g. rustup run stable llvm-profdata just works.

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the rustup run command and how it selects a target toolchain, then inspect how the toolchain's bin directories are exposed. Check the llvm-tools-preview layout described in the issue and add coverage for invoking llvm-profdata through rustup run; done means the command works without manually constructing a target-specific path.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.