Skip to content

Empty input file and missing input file produce the same target hash #276

@romanoid

Description

@romanoid

I observed that bazel-diff does not consider the target changed if one of the target's input files gets deleted if the file was empty to begin with.

It seems that the hashing logic below produces the same result :

} else {
val absoluteFilePath = workingDirectory.resolve(filenamePath)
val file = absoluteFilePath.toFile()
if (file.exists()) {
if (file.isFile) {
if (modifiedFilepaths.isEmpty()) {
putFile(file)
} else if (modifiedFilepaths.any { workingDirectory.resolve(it) == absoluteFilePath }) {
putFile(file)
}
}
} else {
logger.w { "File $absoluteFilePath not found" }
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions