Skip to content

Probe each toolchain bin for existence #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scasagrande
Copy link
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
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
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
Copy link
Member

fmeum commented Apr 18, 2025

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