rustc generates depfiles that have the following shape:
host_x64/exe.unstripped/cmc: ../../src/sys/cmc/src/main.rs ../../src/sys/cmc/src/cml.rs ../../src/sys/cmc/src/compile.rs ../../src/sys/cmc/src/format.rs ../../src/sys/cmc/src/merge.rs ../../src/sys/cmc/src/opts.rs ../../src/sys/cmc/src/validate.rs
host_x64/exe.unstripped/cmc.d: ../../src/sys/cmc/src/main.rs ../../src/sys/cmc/src/cml.rs ../../src/sys/cmc/src/compile.rs ../../src/sys/cmc/src/format.rs ../../src/sys/cmc/src/merge.rs ../../src/sys/cmc/src/opts.rs ../../src/sys/cmc/src/validate.rs
../../src/sys/cmc/src/main.rs:
../../src/sys/cmc/src/cml.rs:
../../src/sys/cmc/src/compile.rs:
../../src/sys/cmc/src/format.rs:
../../src/sys/cmc/src/merge.rs:
../../src/sys/cmc/src/opts.rs:
../../src/sys/cmc/src/validate.rs:
When invoking rustc from Ninja, it causes Ninja to rebuild the target on every invocation: Ninja consumes and deletes the cmc.d depfile (unless -d keepdepfile is specified) and process its content, recording cmc.d as an additional output of the rule that produced it. On the next invocation, Ninja notices that the cmc.d file is missing forcing a rebuild of that rule. rustc generates a new depfile, Ninja consumes and deletes it and so on which means that this process never converges.
I don't think rustc should be including the depfile itself in the generated depfile. I'm not aware of any other tool that would do that, and tools that consume depfiles such as Ninja cannot handle this.
rustcgenerates depfiles that have the following shape:When invoking
rustcfrom Ninja, it causes Ninja to rebuild the target on every invocation: Ninja consumes and deletes thecmc.ddepfile (unless-d keepdepfileis specified) and process its content, recordingcmc.das an additional output of the rule that produced it. On the next invocation, Ninja notices that thecmc.dfile is missing forcing a rebuild of that rule.rustcgenerates a new depfile, Ninja consumes and deletes it and so on which means that this process never converges.I don't think
rustcshould be including the depfile itself in the generated depfile. I'm not aware of any other tool that would do that, and tools that consume depfiles such as Ninja cannot handle this.