Use @loader_path
instead of $ORIGIN
in rpath on macos. Issue #4480.
#4589
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the same pull request as #4541, but with a different email address (due to some issues with CLA).
This patch fixes the issue with
$ORIGIN
in rpath on macos #4480. I'm not sure whether it is the best way to solve the issue, but it works :) I have a superficial knowledge about bazel's code, so feel free to correct me if I'm wrong in some way.There a still several open questions:
I'm not use should we use
@loader_path
or@executable_path
. As I understand, it is the same for plain executables, and only makes a difference for mac's frameworks or 'app' directories. But description inman dyld
is pretty crypric to me.There is a file
tools/osx/crosstool/CROSSTOOL.tpl
, that conains"-Wl,-rpath,$ORIGIN/%{runtime_library_search_directories}"
. I have tried to change it too, but it have not affected my test project. I'm not sure should I change this file too.I tested as described here. If there is another way, say me.
I tested using this project.