-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
CMake: Keep git info up-to-date without reconfiguration #3841
Conversation
09e5ee4
to
8c78569
Compare
76641c5
to
d192455
Compare
I am gad we are getting close, thank you. What a work for this tiny flag, not used for DJ-ing :-/ .. but at least interesting to lean cmake ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The big solution ... Thank you.
I have left some comments.
@@ -1705,9 +1648,12 @@ if(WIN32) | |||
"${CMAKE_CURRENT_BINARY_DIR}/src/mixxx.rc.include" | |||
@ONLY | |||
) | |||
add_dependencies(mixxx mixxx-gitinfo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do this for all targets and remove the git dependency from mixxx-lib.
Did you consider to configure a cpp file instead of a header, like did in the first attempt? This will speed up recompiling even more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will speed up recompiling even more?
How so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can take care after merge.
packaging/CPackConfig.cmake
Outdated
endif() | ||
set(CPACK_PACKAGE_FILE_NAME "mixxx-${PACKAGE_VERSION}") | ||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-source") | ||
set(CPACK_DEBIAN_GIT_DESCRIBE "${GIT_DESCRIBE}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code patching the source tree with CPACK_DEBIAN_GIT_DESCRIBE in CPackDebUploadPPA.cmake does no longer work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hopefully fixed it now. But I can't test (no debian system).
#define GIT_COMMIT_DATE "@GIT_COMMIT_DATE@" | ||
#cmakedefine GIT_COMMIT_YEAR @GIT_COMMIT_YEAR@ | ||
#cmakedefine GIT_COMMIT_COUNT @GIT_COMMIT_COUNT@ | ||
#cmakedefine GIT_DIRTY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this should become a cpp file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this file is also used from mixxx.rc.include.template
which isn't C/CPP. And I think configuring header files is much cleaner than cpp files. Performance wise I doubt this makes a difference.
Uhhh bad .... This fails with ninja. Ninja does not recalculate files during build. All files that changes during the build must be added with DEPENDS directives. Some of these do not work for VisualStudio. Since the dirty flag is only relevant for home builds, this important. Conclusion: What do you think? I have given up to make ninja / msbuild and make work in #3837 it is probably not possible with build system independent code. |
d192455
to
836d68b
Compare
I cannot reproduce this, it works fine here:
|
836d68b
to
dfea4f4
Compare
dfea4f4
to
a01f34e
Compare
@daschuer I also want to get this over with, but It works fine for me. Can you re-test or elaborate what exactly doesn't work? |
Ninja does not rebuild, mixxx when the git work there becomes dirty due to a file that not triggers a rebuild anyway. |
Cannot reproduce this, works for me:
In any case, I think this PR improves the current situation. |
I can no longer confirm the ninja build issues. |
Maybe the worktree was already dirty. In that case, if you change something else, too, it stays dirty and won't recompile unnecessarily. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this effort. It works now.
Based on #3831.
Hopefully replaces #3837 #3822 #3259 #3832 (EDIT: Also added setting the patched flag from git describe from #3817 in 09e5ee4)
This should avoid reconfiguration due to git state changes reliably: