bazel-lib
bazel-lib copied to clipboard
Should it matter if `write_source_files` goes to the same file?
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
copy_file(
name = "foobar",
src = "//some/generated:file",
out = "foobar.json",
)
write_source_files(
name = "write_foobar",
files = {
"foobar.json": ":foobar",
},
)
This will complain that foobar.json is the same file as foobar.json.
Should this be an error? They have (by definition) the same contents
I am using copy_file to get the file into the correct position for usage by another tool.