Skip to content
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

Revert #1753 and add additional tests to expose previously untested behavior #1935

Merged
merged 2 commits into from
Mar 24, 2021

Conversation

jdrouhard
Copy link
Contributor

@jdrouhard jdrouhard commented Mar 23, 2021

This reverts #1753 with the intention of re-landing the change with the fixes from #1933.

Additional tests are included that recreate some CMake test suite tests (see #1932). These regression tests are useful since they expose some edge-casey behavior.

Fixes #1932.

@jdrouhard
Copy link
Contributor Author

cc: @jhasse @bradking

Copy link
Contributor

@bradking bradking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revert looks correct. The test cases are representative of what we discussed in #1932 and #1933.

I've made some minor comments that need addressing.

Also, please update the revert's commit message to mention that it fixes issue #1932.

"rule generate-depfile\n"
" command = echo \"$out: inimp\" > $depfile ; touch $out\n"
"build out: generate-depfile\n"
" depfile = out.d\n"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this missing test_dependency = inimp.

The human-reference command= line use $test_dependency instead of inimp. Also, for consistency with DiscoveredDepDuringBuildChanged, let's put the touch $out ; first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I'd updated all these to use the test_dependency binding. Must have missed this one in the cherry-pick.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"rule touch-out-implicit-dep\n"
" command = touch $out ; sleep 1 ; touch $test_dependency\n"
"rule generate-depfile\n"
" command = touch $out; echo \"$out: $test_dependency\" > $depfile\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace consistency nit: touch $out ; echo ....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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.
@jhasse jhasse merged commit 8cd25aa into ninja-build:master Mar 24, 2021
@jdrouhard jdrouhard deleted the revert_input_mtime branch March 24, 2021 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build.ninja generator not re-running when it should
3 participants