Skip to content

Add install-name-tool to llvm repo - #790

Merged
dzbarsky merged 1 commit into
bazel-contrib:masterfrom
alopezz:add-install-name-tool
Jun 30, 2026
Merged

dzbarsky merged 1 commit into
bazel-contrib:masterfrom
alopezz:add-install-name-tool

Conversation

@alopezz

@alopezz alopezz commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #606.

This makes llvm-install-name-tool available under <name>_llvm//:install-name-tool, making it available as a (hermetic) replacement for host install-name-tool.

@dzbarsky
dzbarsky enabled auto-merge (squash) June 30, 2026 12:34
@dzbarsky
dzbarsky merged commit ffe407c into bazel-contrib:master Jun 30, 2026
76 checks passed
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/datadog-agent that referenced this pull request Jul 6, 2026
### What does this PR do?

It moves bazel usage of host `install_name_tool` to [llvm's version](https://llvm.org/docs/CommandGuide/llvm-install-name-tool.html) of it and replaces ad-hoc rpath removal logic with a single command.

### Motivation

Mainly for the benefit of being able to use `--delete_all_rpaths` (#52964 (comment)), simplifying recently implemented logic (#52964) to manually do that.

Of course, it also adds improved hermeticity is an extra bonus, though considering that we won't ever get all the tools needed for rpath patching hermetically (i.e. we'll always need `codesign` at least), and that these are tools that are pretty much guaranteed to be installed on macos systems, that might not be such a big deal.

### Describe how you validated your changes

Local testing and green CI build (including health check).

### Additional Notes

This leverages the llvm toolchain we already had set up, which exposes the tool thanks to bazel-contrib/toolchains_llvm#790.

There's still possible cleanup to do and too many places where we're rewriting rpaths, but that will require follow-up targeted work.

Co-authored-by: alex.lopez <alex.lopez@datadoghq.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/datadog-agent that referenced this pull request Oct 5, 2026
### What does this PR do?
Bump the `toolchains_llvm` Bazel module from `1.8.0` to `1.11.1`.

Remove the `archive_override` that temporarily pinned it to an intermediate commit (bazel-contrib/toolchains_llvm#790), now shipped in the `1.11.0` release.

### Motivation
The dependency was pinned to a specific commit via `archive_override` instead of a tagged release, bypassing BCR version resolution, because bazel-contrib/toolchains_llvm#790 had not shipped in a release yet.

That PR adds the `install-name-tool` filegroup our macOS rpath-rewriting toolchain (`//bazel/toolchains/rpath_rewriter`) depends on, shipped starting with `1.9.0`.

### Describe how you validated your changes
Verified `@llvm_toolchain_llvm//:install-name-tool` and the `//bazel/toolchains/rpath_rewriter` toolchain wiring still resolve and build for `macos_arm64` under `1.11.1`.

Diffed the dependency's git history between `1.8.0` and `1.11.1` against our LLVM-adjacent Bazel code and found no other local workaround made redundant by it.

Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
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.

Add llvm-install-name-tool

2 participants