You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a target using a native binary rule, for example py_binary, depends on a cc_library target as a data dependency, excessive amounts of files get included in the runfiles of the binary target depending on the flag --incompatible_always_include_files_in_data. Without that flag on, only the .so file in the _solib_* directory gets included. With that flag on, in addition to the .so file in the _solib_* directory, the same .so file will get included outside the _solib_* directory and the .a version of the library will get included in the runfiles.
This is especially problematic when packaging the runfiles inside some other target, for example when using the py_image rule from rules_docker. This will at least double the size of the library in the tar file generated by the py_image target.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I understand the use case, but I think that *_library targets aren't really meant to be data dependencies of anything. Could you try to use cc_shared_library instead which is specifically meant to produce shared libraries as final build outputs? Alternatively, cc_binary with linkshared = True should also work.
Description of the bug:
When a target using a native binary rule, for example py_binary, depends on a cc_library target as a data dependency, excessive amounts of files get included in the runfiles of the binary target depending on the flag
--incompatible_always_include_files_in_data
. Without that flag on, only the .so file in the_solib_*
directory gets included. With that flag on, in addition to the .so file in the_solib_*
directory, the same .so file will get included outside the_solib_*
directory and the .a version of the library will get included in the runfiles.This is especially problematic when packaging the runfiles inside some other target, for example when using the py_image rule from rules_docker. This will at least double the size of the library in the tar file generated by the py_image target.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Setup repository by running the following:
Build the image with and without the flag on and check the contents of the layer. (Removed the non relevant parts)
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?release 6.0.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
Issue on the flag #16654
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: