libsome_pkg.so depends on libFoo.so which depends on libBar.so. When building the virtual environment the files 'lib/libFoo.so' and 'lib/libBar.so' are missing, even though they are a data dependency of the target for this package. This does not appear to be a problem on macos for the specific case, since it looks like macos resolves symlinks when searching through rpaths, but this does not work on linux. Normal bazel targets work fine with the
The BUILD file is something like this
py_library(
name = "foo",
srcs = glob(["lib/python3.11/site-packages/**/*.py"]),
data = glob(
["lib/**/*"],
exclude = ["*.py"],
)
)
Creating a venv depending on the target above, will not add the relevant paths to the venv pth-file or put the so/dylibs in a folder in the venv.
Any other information?
I cannot provide the precise example, but if any additional information is needed, I can help provide a more detailed example. I think the issue is likely due to the so-files of the dependent files lies outside the site-packages folder. The original package we use for this, is in fact a pre-compiled conda-package which has the 'standard' layout with libraries in lib and python code in lib/pythonX.Y/site-packages so the situation is not very special to this specific external library.
What happened?
We have a target in a repository with the following file layout:
libsome_pkg.so depends on libFoo.so which depends on libBar.so. When building the virtual environment the files 'lib/libFoo.so' and 'lib/libBar.so' are missing, even though they are a data dependency of the target for this package. This does not appear to be a problem on macos for the specific case, since it looks like macos resolves symlinks when searching through rpaths, but this does not work on linux. Normal bazel targets work fine with the
The BUILD file is something like this
Version
How to reproduce
Creating a venv depending on the target above, will not add the relevant paths to the venv pth-file or put the so/dylibs in a folder in the venv.
Any other information?
I cannot provide the precise example, but if any additional information is needed, I can help provide a more detailed example. I think the issue is likely due to the so-files of the dependent files lies outside the site-packages folder. The original package we use for this, is in fact a pre-compiled conda-package which has the 'standard' layout with libraries in
lib
and python code inlib/pythonX.Y/site-packages
so the situation is not very special to this specific external library.