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
Before this PR, Rust rules merge data_runfiles of dependencies into its
default_runfiles (because we used
`[collect_data=True](https://bazel.build/versions/7.1.0/rules/lib/builtins/ctx#runfiles)`).
`cc_libraries` put shared libraries to data_runfiles even when
`cc_library` has a static library equivalent and Bazel is linking
statically. This becomes problematic when packaging binaries - we end up
putting unnecessary shared libraries into the package.
Therefore, this PR removes the use of `collect_data`, and refactors our
runfiles logic to follow the [latest
guidance](https://bazel.build/versions/7.1.0/extending/rules#runfiles).
While at it, I made sure to only put transitive shared libraries to
runfiles when building a binary-like target (bin, staticlib, cdylib).
This way we avoid depset flattenning in libraries.
Added a little regression test.
0 commit comments