Skip to content

Probe each toolchain bin for existence#483

Draft
scasagrande wants to merge 1 commit into
bazel-contrib:masterfrom
scasagrande:sc/issue-481-check-bin-existence
Draft

Probe each toolchain bin for existence#483
scasagrande wants to merge 1 commit into
bazel-contrib:masterfrom
scasagrande:sc/issue-481-check-bin-existence

Conversation

@scasagrande

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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 scasagrande marked this pull request as draft April 17, 2025 23:29
@scasagrande

Copy link
Copy Markdown
Contributor Author

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.

@fmeum

fmeum commented Apr 18, 2025

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants