-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build.ninja generator not re-running when it should #1932
Comments
Cc: @jhasse @jdrouhard |
I'll take a look. Thanks. |
…re checking the build log (Fixes ninja-build#1932) This is a followup fix for ninja-build#1753. `build_log()` will always be valid (even for new builds). We should be checking for the output being older than the input before we check the build log for additional possible conditions that would make the output dirty.
Here is another case not fixed by the current draft of #1933: rm -f .ninja_deps .ninja_log
touch inout
cat >build.ninja <<EOF
rule generator
command = touch inout ; sleep 1; touch build.ninja
generator = 1
build build.ninja: generator | inout inimp
EOF
sleep 1
touch inimp
ninja
ls -tr build.ninja inout inimp Prior to #1753, this re-ran the generator exactly once. After #1753 it does not re-run the generator at all. With the current draft of #1933, it re-runs the generator repeatedly. |
…re checking the build log This is a followup fix for ninja-build#1753. Fixes ninja-build#1932 `build_log()` will always be valid (even for new builds). We should be checking for the output being older than the input before we check the build log for additional possible conditions that would make the output dirty.
@bradking would it make sense to continue to record the output's mtime in the build log if the rule is marked as a |
@jdrouhard let's try that special case for |
@bradking done. Let me know. |
Here is another case: rm -f .ninja_deps .ninja_log out out.d
>inimp
echo >build.ninja '
ninja_required_version = 1.5
rule example
command = echo "$out: inimp" > $depfile ; touch $out
build out: example
depfile = out.d
default out'
ninja
ninja -d explain Prior to #1753, the output was:
Now the output is:
Adding |
Sure. This seems to be of a similar nature to the other cases, where the rule itself generates a file that ends up being an implicit input dependency. In this case, it's not a generator rule, but a non-special depfile. I have it fixed on my branch, but I'd like to write a test for it. We should port your entire CMake test suite into native ninja tests, they would be very useful, I think ;). Thanks for testing this so thoroughly. |
How so? The EDIT: Or do you mean that the |
Yes, that's what I meant. |
These expose some behavior related to implicit deps unknown to ninja and timestamps with generating them as part of a rule. See discussions in ninja-build#1932 and ninja-build#1933.
This reverts commit 67fbbee. There were a few missing test cases exposed by CMake's test suite that need slight adjustments. Better to revert the original attempt, add the test cases, and then re-land the change with the fixes. Fixes ninja-build#1932
These expose some behavior related to implicit deps unknown to ninja and timestamps with generating them as part of a rule. See discussions in ninja-build#1932 and ninja-build#1933.
This reverts commit 67fbbee. There were a few missing test cases exposed by CMake's test suite that need slight adjustments. Better to revert the original attempt, add the test cases, and then re-land the change with the fixes. Fixes ninja-build#1932
These expose some behavior related to implicit deps unknown to ninja and timestamps with generating them as part of a rule. See discussions in ninja-build#1932 and ninja-build#1933.
#1753 broke CMake's test suite. I must have neglected to run it before my approval in that PR.
I tracked it down to this example:
Prior to the change, the output is:
After the change, the output is:
The text was updated successfully, but these errors were encountered: