Skip to content

Build is always executed if mtimes are missing #4425

@matklad

Description

@matklad

Today a user handled me a rar archive (from a windows machine) with a Cargo package. When I extracted it on my linux machine, I've noticed that cargo build always rebuilds the project, instead of doing zero builds. Looks like the problem is that extracted files miss mtimes, so we always rebulid in here:

let should_rebuild = match (*on_disk_mtime, *previously_built_mtime) {
(None, None) => false,
(Some(_), None) | (None, Some(_)) => true,

Seems like a niche use case, and I am not sure how to fix it properly (touching files seems inappropriate?), but lets log the issue anyways!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rebuild-detectionArea: rebuild detection and fingerprintingC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions