You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Placing llvm-tools installed via rustup onto the PATH #3397
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
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.
I don't think we would start mucking with PATH again. See #3178.
If rustup which and rustup run, which exist to run arbitrary commands within a toolchain cannot find these binaries-in-odd-places, I think extending them to do so (safely, with root path escapes prevented etc) would be entirely reasonable.
Another approach - and this seems best to me, would be to put these files in the bin directory in the toolchain.
It would be very useful if we could rustup which llvm-link or perhaps rustup which --component llvm-tools llvm-link. If you agree this would be useful, do you have a preference on the two syntaxes, or pointers to where you think it should be implemented?
In our case, we want to use tools like llvm-link as part of a JIT/LTO handling IR, but it seems there is no programmatic way to obtain the paths.
Activity
bradjc commentedon Jul 21, 2023
This would be very helpful.
As another example, here is our workaround:
https://github.com/tock/tock/blob/f96c4ef49b25d696f2f54622bc604b32d0201cd2/boards/Makefile.common#L207
rbtcollins commentedon Aug 14, 2023
I don't think we would start mucking with PATH again. See #3178.
If
rustup whichandrustup run, which exist to run arbitrary commands within a toolchain cannot find these binaries-in-odd-places, I think extending them to do so (safely, with root path escapes prevented etc) would be entirely reasonable.Another approach - and this seems best to me, would be to put these files in the bin directory in the toolchain.
jedbrown commentedon Jul 30, 2025
It would be very useful if we could
rustup which llvm-linkor perhapsrustup which --component llvm-tools llvm-link. If you agree this would be useful, do you have a preference on the two syntaxes, or pointers to where you think it should be implemented?In our case, we want to use tools like
llvm-linkas part of a JIT/LTO handling IR, but it seems there is no programmatic way to obtain the paths.