bazel-contrib / bazel-contrib/bazel-lib
platform_transition_test appears to break RUNPATH
- Dominant language
- Starlark
- Stars
- 182
- Forks
- 134
- Avg merge
- 1d 46m
- Merged PRs (30d)
- 1
Description
Hello
I am using ``platform_transition_test`` on a C++ test binary.
When executing the test remotely it fails because it cannot find the shared libraries in _solib_aarch64 (referenced in the binary using RUNPATH)
The issue appears to be that the "symlink" action does not guarantee to produce a symlink remotely and therefore
our buildbarn worker gets a copy instead, and this breaks RUNPATH resolution (the RUNPATH uses relative locations)
I can work around it in my case by outputting a wrapper bash script that exec's the test binary. Basically changing the symlink action to be this instead
```py
ctx.actions.write(
new_executable,
content = """#!/bin/bash
exec {}
""".format(original_executable.short_path),
is_executable = True,
```
However I would like to discuss what could be a permanent solution to this problem
Contributor guide
Research direction
Start by reading and running platform_transition_test with a remotely executed C++ test binary, then inspect the symlink action described in the issue. Reproduce the failure involving _solib_aarch64 and relative RUNPATH resolution; done means the remote test can locate its shared libraries without relying on an unconfirmed symlink or an ad hoc wrapper.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100