mirror of
https://github.com/bazelbuild/bazel-skylib
synced 2024-11-27 05:43:25 +00:00
a832b8d717
copy_file currently includes the copied file in its runfiles even if it is not executable, which makes every rule depending on it have the file as a runfile (e.g. a `cc_library` depending on a copied header file via the hdrs attribute). In an ideal world, according to https://docs.bazel.build/versions/main/skylark/rules.html#runfiles-features-to-avoid, `copy_file` would not need to specify any runfiles in the `DefaultInfo` it returns - specifying `files` should suffice. However, due to the existence of rules with legacy behavior, this would break compatibility (actually, already with `sh_test` in skylib's unit tests). As a compromise that preserves compatibility with legacy rules but nevertheless cleans up the runfiles tree of depending rules, use the `data_runfiles` attribute of `DefaultInfo` if the copied file is not executable. |
||
---|---|---|
.. | ||
private | ||
analysis_test.bzl | ||
BUILD | ||
build_test.bzl | ||
common_settings.bzl | ||
copy_file.bzl | ||
diff_test.bzl | ||
expand_template.bzl | ||
native_binary.bzl | ||
run_binary.bzl | ||
select_file.bzl | ||
write_file.bzl |