toolchains_llvm icon indicating copy to clipboard operation
toolchains_llvm copied to clipboard

Probe each toolchain bin for existence

Open scasagrande opened this issue 8 months ago • 3 comments

Probe each toolchain binary for existence before attempting to make symlinks to them.

This allows for llvm packages without tools that aren't needed by a given project.

A simple loop here was used for readability with consideration for the limited number of items in the loop.

Here is an example copy of tools after the filtering when using this package: https://github.com/MaterializeInc/toolchains/releases/tag/clang-18.1.8-5

 {"clang-cpp": "clang-cpp", "ld.lld": "ld.lld", "llvm-ar": "llvm-ar", "llvm-dwp": "llvm-dwp", "llvm-profdata": "llvm-profdata", "llvm-cov": "llvm-cov", "llvm-nm": "llvm-nm", "llvm-objcopy": "llvm-objcopy", "llvm-objdump": "llvm-objdump", "llvm-strip": "llvm-strip"}

scasagrande avatar Apr 17 '25 22:04 scasagrande

Looks like all the failing tests are upset about llvm-ar

/home/runner/.cache/bazel/_bazel_runner/f764bf27ef94a0d5a3cfad3bad3e40be/sandbox/processwrapper-sandbox/526/execroot/_main/external/toolchains_llvm++llvm+llvm_toolchain/bin/llvm-ar: not found

I'll keep looking

scasagrande avatar Apr 17 '25 22:04 scasagrande

Oh, it was working locally for me because the download and extraction had already completed.

Running the test, then making a trivial change to toolchain/internal/configure.bzl and running the test again results in a pass. This code is executed before we download and extract the package. I'll take another look later if no one else has any suggestions.

scasagrande avatar Apr 17 '25 23:04 scasagrande

If it helps, we could always create the symlinks and then write out a .bzl with the tools that actually exist after the download has happened.

fmeum avatar Apr 18 '25 12:04 fmeum