Skip to content

depfile dependency on dyndep output does not trigger rebuild #2641

@dseomn

Description

@dseomn

In this build file, copy depends on other, but when other changes, copy is not rebuilt:

rule dyndep
  command = printf 'ninja_dyndep_version = 1\nbuild stamp | other: dyndep\n' > $out

rule build_with_dyndep
  command = touch $out other
  dyndep = $out.dd

rule depends_on_dyndep
  command = printf '%s: other\n' $out > $out.d && cp other $out
  depfile = $out.d

build stamp.dd: dyndep
build stamp: build_with_dyndep || stamp.dd
build copy: depends_on_dyndep || stamp
$ ninja --version
1.12.1
$ ninja -v
[1/3] printf 'ninja_dyndep_version = 1\nbuild stamp | other: dyndep\n' > stamp.dd
[2/3] touch stamp other
[3/3] printf '%s: other\n' copy > copy.d && cp other copy
$ # edit build.ninja to add some spaces to build_with_dyndep's command
$ ninja -v
[1/1] touch stamp     other
$ ninja -v
[1/1] printf '%s: other\n' copy > copy.d && cp other copy
$ ninja -v
ninja: no work to do.
$ ninja -t missingdeps
Processed 3 nodes.
No missing dependencies on generated files found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions