[libclc] [libclc] use default paths with find_program when possible (PR #105969)

Harald van Dijk via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 06:53:36 PDT 2024


hvdijk wrote:

> > Apologies, but I'm having a bit of trouble understanding the scenario that this PR addresses.
> 
> Nixpkgs adds the tools being used to `$PATH` so find program needs to use path.

This PR enables inadvertent errors on non-Nix systems though. When a specific LLVM path is used, and a binary is missing there, but a different binary with the same name is available in `$PATH`, we don't normally want that other binary to be used, it is quite possibly from a wrong version of LLVM. Right now, this is detected early at CMake time, and with this PR, it would no longer be.

If standalone builds continue to be used, could this be avoided by changing the Nixpkgs build to install symlinks to all needed tools in a single directory (possibly a temporary directory populated during the libclc build), and making that directory available as `LLVM_TOOLS_BINARY_DIR`?

https://github.com/llvm/llvm-project/pull/105969


More information about the cfe-commits mailing list