2
0
Fork 0
mirror of https://github.com/bazel-contrib/bazel-lib synced 2024-11-27 17:43:27 +00:00
bazel-lib/lib/copy_directory.bzl
Justin Pinkul ad48c0d855
fix: moving the preserve mtime test logic to Go for portability (#908)
* Fix: Moving the preserve mtiem test logic to Go for portability

* add tags to disable remote caching, execution and force the test to always re-run

* include docs

* use the runfiles library for windows compatability

* mark the test as manual

* remove duplicate word in comment

* chore: reduce duplication of the long caveats text

---------

Co-authored-by: Alex Eagle <alex@aspect.dev>
2024-09-17 17:25:26 -07:00

27 lines
1.1 KiB
Python

"""A rule that copies a directory to another place.
The rule uses a precompiled binary to perform the copy, so no shell is required.
## Preserving modification times
`copy_directory` and `copy_to_directory` have a `preserve_mtime` attribute, however
there are two caveats to consider when using this feature:
1. Remote Execution / Caching: These layers will reset the modify time and are
incompatible with this feature. To avoid these failures the [no-remote tag](https://bazel.build/reference/be/common-definitions)
can be added.
2. Caching: Changes to only the modified time will not re-trigger cached actions. This can
be worked around by using a clean build when these types of changes occur. For tests the
[external tag](https://bazel.build/reference/be/common-definitions) can be used but this
will result in tests never being cached.
"""
load(
"//lib/private:copy_directory.bzl",
_copy_directory = "copy_directory",
_copy_directory_bin_action = "copy_directory_bin_action",
)
copy_directory = _copy_directory
copy_directory_bin_action = _copy_directory_bin_action