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

buildsystem: fix cyclic dependency on unnecessary timefile #1084

Merged
merged 1 commit into from
Jan 27, 2019

Conversation

TheJJ
Copy link
Member

@TheJJ TheJJ commented Jan 27, 2019

The timefile is problematic: cmake says in the implementation of cmMakefileTargetGenerator::WriteMakeRule:

// For multiple outputs, make the extra ones depend on the first one.

-> the first output was the timefile, the extra ones are the generated sources.
But the timefile is touched after the sources were generated. The generated sources depend on the (now newer) timefile, so they need to be rebuilt, i.e. touched. Then the generated ones are newer than the dependent C++ files, causing funny unnecessary rebuilds.

Finally fixes #1075.

@TheJJ TheJJ added area: buildsystem Related to our cmake/python buildsystem bugfix Restores intended behavior labels Jan 27, 2019
@TheJJ TheJJ force-pushed the codegen-rebuild-fix branch 2 times, most recently from dd6174e to 6550622 Compare January 27, 2019 17:33
This caused rebuilds because the generated files depend on the first
file (see cmake sources, e.g. https://github.com/Kitware/CMake/blob/b4ccb6cd32029efa802dfdfa889c75bc16f65cf1/Source/cmMakefileTargetGenerator.cxx#L974-L1006).
The first file (the timefile) is touched after the files were generated.
The generated files are then older than the timefile, and are touched,
causing rebuils for any (non-generated) source file depending on them.
@zuntrax zuntrax merged commit cb95bd0 into SFTtech:master Jan 27, 2019
@TheJJ TheJJ deleted the codegen-rebuild-fix branch January 27, 2019 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: buildsystem Related to our cmake/python buildsystem bugfix Restores intended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buildsystem builds unchanged things when touching unrelated files
2 participants