-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
cannot run binary that dlopens shared objects from a {py,sh}_test #6700
Comments
Is anyone able to comment on whether this is expected behavior or not? |
Yes, the runfiles tree of the cc_binary will be merged into the sh_test's runfiles. |
@benjaminp, got it, thank you for the reply. Does that mean there is a problem with the construction of the test?
We are running the binary using the path passed in on the command line as determined using the |
You'll probably want to locate the binary with the bash runfiles library. |
@benjaminp, your suggestion sounded very promising and I was happy that we might have an easy fix, but unfortunately this does not seem to help. I mocked up a test script around the actual binary I am having problems with and ran into the same error. The script simply takes a label pointing to a
I then added an
Running the test runs into an error:
I do see Any suggestions? |
@benjaminp @mhlopko, is maybe the underlying problem that Bazel just doesn't robustly support |
It is absolutely a bug, quite long standing one. @oquenchil @lberki is this only about adding another rpath or there is something more involved? |
The path changes depending on the name of the binary that includes the dynamic library. I'm not sure whether adding an rpath will be sufficient. |
/cc @laszlocsomor Well... the problem is that what RPATH you use is actually important no matter where you use the binary. So I'd rather we take a step back and figure out how RPATH and dynamic library loading should look like instead of a quick band-aid. FWIW, the runfiles of the |
I think this is why you want your runtime dynamic linker to support |
@benjaminp, can you point me to something that elaborates on this? Is this a thing outside of Google? |
@benjaminp, I found a thread on the glibc mailing list that explains Note that Bazel seems to add |
@hlopko, I see you unassigned the issue but curious if any progress was made? I haven't been able to upgrade Bazel for a while due to difficulties with getting away from my CROSSTOOLS file. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
Was the |
EXEC_ORIGIN was never merged, no. |
@crorvick If this is still an issue, could you update your reproducer to demonstrate the problem you are seeing when using the runfiles library? A few issues related to missing RPATH entries have been fixed since you last tried this. |
With 75e5d2f and Please give this a try with Bazel 7.2.0rc2 and create a new issue if problems persist. |
Description of the problem / feature request:
I am trying to run a
cc_binary
target as part of ansh_test
. Passing the binary target as a data dependency causes Bazel to build it, but it does not create the runfiles hierarchy.Feature requests: what underlying problem are you trying to solve with this feature?
The binary I am trying to run depends on the runfiles hierarchy existing so that its dependencies are met. Without this my test is failing unless I explicitly build the
cc_binary
target first.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
Gentoo
What's the output of
bazel info release
?release 0.18.0- (@non-git)
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.emerge bazel
The text was updated successfully, but these errors were encountered: