bazel-lib
bazel-lib copied to clipboard
Consider failing by default when copy_to_directory encounters conflicting files
Silently ignoring conflicts and not overwriting could be a source of tricky to find bugs. Both ignore and overwrite behaviours should be explicitly declared.
fyi @devversion
Suppose we turn allow_overwrites
into a conflict_strategy
attribute with enum options overwrite
, ignore
and fail
defaulting to fail
.
Yeah I was thinking something along those lines as well.
Only downside is that there isn't an easy way to do this check with cp
. We have to add some more complicated logic to search for potential conflicts first (I think).
New impl will fail if there are conflicts and allow_overwrites
is False on all platforms. Closing this. If we want to switch to a conflict_strategy
attribute in the future then lets open up a new FR