The bad behavior of pkg_tar when include_runfiles = True breaking symlink

201 views
Skip to first unread message

shepherd Ou

unread,
Feb 12, 2024, 12:08:00 PMFeb 12
to bazel-discuss
I m trying to deploy some simple binary with pkg_tar such that user which can't access to the source code can use the tool out of the box(deployment tar).

I also want to reserve the dirtree and find the attribute include_runfiles useful.
However, I find a weird behavior of the tar rule:
Shared lib are duplicated in the tar: 
* One in the dir tree as we declare them by BUILD file. 
* Another is located in _solib_darwin_arm64 for MacOS (_solib_k8 for Linux).
In the project workspace, the one in _solib_darwin_arm64 is actually a symlink to the one in dir tree. However, in package tar both are duplicated files.
It introduces linking error when I run the binary. (The binary link the .so lib with relative path, e.g. @loader_path/../../../to_root/_solib_darwin_arm64/_U_S_encoded_path_to_shared_lib)
This behavior makes no sense to me.
Could anyone help? many thanks. 

Chuck Grindel

unread,
Feb 13, 2024, 8:43:07 AMFeb 13
to bazel-discuss
You may get more visibility on your question if you post and issue or discussion at https://github.com/bazelbuild/rules_pkg.

shepherd Ou

unread,
Feb 13, 2024, 12:59:49 PMFeb 13
to bazel-discuss
Sure, thanks for your attention.

Best regard

Reply all
Reply to author
Forward
0 new messages