Skip to content

Makefile-like dependency .d file is incomplete #8606

@pdietl

Description

@pdietl

Describe the problem you are trying to solve

The generated target/*/app.d file is incomplete in my opinion. Similar to the -MP option for gcc, I believe that we should be including phony targets for each dependency, so that if a dependency is deleted from src/, then the Makefile will not fail on a missing file, but instead consider it out of date and runs the phony rule which does nothing, but then allows the makefile rule to re-run cargo.
Also, I believe that Cargo.toml and Cargo.lock should always be included as dependencies, since a change in either could mean that a rebuild is necessary.

Describe the solution you'd like

For a cargo project that looks like:

src/main.rs
src/lib.rs

where src/main.rs uses src/lib.rs, I propose the following .d file be output:

foo: Cargo.lock Cargo.toml src/main.rs src/lib.rs

Cargo.lock:

Cargo.toml:

src/main.rs:

src/lib.rs:

Note: I found where this change would need to be made and it should be very simple. If interested, I can create a PR to solve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-dep-infoArea: dep-info, .d filesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions