-
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
Bazel 5.3.0 $(location :foo) disagrees with cc_binary's rpath with remote execution, regression from 5.0.0 #16108
Comments
@AustinSchuh Could you try replacing |
Phew, that was a pain to test. No difference with
|
I see, thanks for checking. I assume that should be fixed by #16215 then, but I'm not completely sure. |
Got it. Let's let the dust settle on 16215 then (looks like it is still in flight) and I can try again. |
@AustinSchuh Could you try this again with 6.0.0rc4? |
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 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post |
Description of the bug:
I've got a sh_test which calls a binary as located by
$(location :foo)
. See https://github.com/frc971/971-Robot-Code/blob/master/aos/network/sctp_lib_test.sh for the test, and https://github.com/frc971/971-Robot-Code/blob/master/aos/network/BUILD#L586 for the build rule. That test is in an external repository. I'm running it by runningbazel test @aos//aos/network:sctp_lib_test
from the base repository.When I upgrade from 5.0 to 5.3 and run the test on a remote execution cluster, I get a test failure saying:
The test is getting run from
/var/lib/worker/work/7/exec/bazel-out/k8-opt/bin/external/aos/aos/network/sctp_lib_test.runfiles/repo
($(pwd)
at the top of the shell script reports this).Bazel sets rpath in the binary being run to:
Inside the build file, we ask Bazel for the path to the test binary using
$(location :sctp_lib_test_binary)
Bazel returnsexternal/aos/aos/network/sctp_lib_test_binary
.When run from this path, the shared libraries aren't discoverable. If I instead hard-code the path to the binary to
../aos/aos/network/sctp_lib_test_binary
instead, RPATH now agrees with the path it's being run from and the test passes.I think the fix for this is going to be to make
$(location)
return../aos/path
instead ofexternal/aos/path
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Either import the repo above as an external repo and try to run the external test, or write a shell script mirroring it.
Which operating system are you running Bazel on?
Debian Bullseye
What is the output of
bazel info release
?release 5.3.0-202208151910+2ee906ec8e
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?The text was updated successfully, but these errors were encountered: