Swift/Ninja: Some output files are not regenerated/restat, causing no-op builds to rebuild
Some build rules list files as outputs that are not always rebuilt/touched by the rule, causing the rule to stay permanently dirty, resulting in:
$> ninja -C build\debug foo.swift.obj -d explain
ninja explain: output <snip>/bar.swift.obj older than most recent input <snip>/baz.swift (7241285922001932 vs 7241901243373795)
ninja: Entering directory `build\debug'
[1/1] Linking Swift static library lib\foo.lib
$> ninja -C build\debug foo.swift.obj -d explain
ninja explain: output <snip>/bar.swift.obj older than most recent input <snip>/baz.swift (7241285922001932 vs 7241901243373795)
ninja: Entering directory `build\debug'
[1/1] Linking Swift static library lib\foo.lib
This has shown up for .swiftmodule
and .swift.obj
outputs.
Adding restat=1
to the relevant build rule in build.ninja
appears to fix the problem, but there may be repercussions here I'm not anticipating.
I know there's a change in the works to split the compilation model for swift (!8907 (merged)), maybe this will also fix the problem?