-
Notifications
You must be signed in to change notification settings - Fork 2
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
BREAKING: Modify path layout to fix relative RPATH lookups #104
Conversation
099996a
to
1281642
Compare
1281642
to
eea765c
Compare
75830d0
to
e494d60
Compare
e494d60
to
eb0a778
Compare
242a31b
to
f7152cd
Compare
f7152cd
to
43f389d
Compare
43f389d
to
2abfa8d
Compare
@keith This PR should fix the problems with shared deps on Linux, but it runs into a surprising failure on macOS: Despite a matching |
I can reproduce this failure on |
Can confirm that this patch to Bazel fixes the problem: diff --git a/tools/cpp/osx_cc_wrapper.sh.tpl b/tools/cpp/osx_cc_wrapper.sh.tpl
index e40a98bb1a601d..3d5e3bdfb3beed 100644
--- a/tools/cpp/osx_cc_wrapper.sh.tpl
+++ b/tools/cpp/osx_cc_wrapper.sh.tpl
@@ -106,7 +106,7 @@ function get_otool_path() {
function call_install_name() {
/usr/bin/xcrun install_name_tool -change $(get_otool_path "$1") \
- "@loader_path/$2/$3" "${OUTPUT}"
+ "@rpath/$3" "${OUTPUT}"
}
# Do replacements in the output |
Sorry for the stream of messages here, I just now learned about |
6bfa1fb
to
6b48d34
Compare
TLDR is that this is broken in Bazel without bazelbuild/bazel#23089. I disabled the test on macOS for now. |
The executable of an executable transitioned rule is now created in a subdirectory of the target's package, which allows it to match the path depth under the execroot of the original executable and thus gets relative RPATH entries to resolve.
Also copy any DLLs next to the new executable on Windows.
The new path layout can be disabled via
--no@with_cfg.bzl//:incompatible_same_depth_path_layout
, e.g. if users hardcoded rlocationpaths and don't want to update them now. It is recommended to avoid this and use$(rlocationpath ...)
instead.Fixes #85