Skip to content

Should it matter if write_source_files goes to the same file? #1058

@njlr

Description

@njlr
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    need: investigationInvestigation required to proceed further

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions