-
Notifications
You must be signed in to change notification settings - Fork 9
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
Make git upstream act more like tar #22
Conversation
This reverts commit ca32b1e. Evidently this wasn't working correctly on Windows. Signed-off-by: Scott K Logan <[email protected]>
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.
Overall, I like that this gets rid of a bunch of silly workarounds. I've got two nits inline.
dc42d53
to
7a90b62
Compare
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.
Looks good to me with green CI (including a Windows Debug run).
7a90b62
to
3af6812
Compare
GIT_REPOSITORY https://github.com/uncrustify/uncrustify.git | ||
GIT_TAG ${uncrustify_version} | ||
GIT_CONFIG advice.detachedHead=false | ||
# Suppress git update due to https://gitlab.kitware.com/cmake/cmake/-/issues/16419 | ||
# See https://github.com/ament/uncrustify_vendor/pull/22 for details | ||
UPDATE_COMMAND "" |
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.
As we just found out, https://github.com/eProsima/foonathan_memory_vendor/blob/0e6174a7f28c45faf711030697a6c32547336acd/CMakeLists.txt#L79 also has this workaround. So 🤞 this is the right solution.
Some of our problems with using GIT_REPOSITORY with a GIT_TAG stem from CMake trying to "update" the repository each time the target is evaluated. This would be important if not for the fact that we're targeting a specific REF, so the repository will never be out-of-date unless we change the ref, which would invalidate the target anyway. We can safely use UPDATE_DISCONNECTED to block the update step from invalidating the source target, which should prevent downstream targets like patch, build, and install from being re-triggered unnecessarily. The one caveat to this is that a change to GIT_TAG doesn't invalidate the target like a change to GIT_REPOSITORY or URL would. To work around this, I updated the target name to contain the ref instead of the supposed version number, which will then force a new build if we change the ref in the future. This is also more correct, since it would be easy for the ref and target name to get out of sync. Signed-off-by: Scott K Logan <[email protected]>
This reverts commit c614081. This is no longer necessary because of UDPATE_DISCONNECTED, which will make the download step act more like using a URL instead of a GIT_REPOSITORY. Signed-off-by: Scott K Logan <[email protected]>
3af6812
to
8b08698
Compare
The last force-push was just to update the commit message to prepare for a rebase-merge to preserve the revert history. |
Some of our problems with using GIT_REPOSITORY with a GIT_TAG stem from CMake trying to "update" the repository each time the target is evaluated. This would be important if not for the fact that we're targeting a specific REF, so the repository will never be out-of-date unless we change the ref, which would invalidate the target anyway. We can safely use UPDATE_DISCONNECTED to block the update step from invalidating the source target, which should prevent downstream targets like patch, build, and install from being re-triggered unnecessarily. The one caveat to this is that a change to GIT_TAG doesn't invalidate the target like a change to GIT_REPOSITORY or URL would. To work around this, I updated the target name to contain the ref instead of the supposed version number, which will then force a new build if we change the ref in the future. This is also more correct, since it would be easy for the ref and target name to get out of sync. Signed-off-by: Scott K Logan <[email protected]>
This package is proving to be a perfect storm of the following two issues:
Issue (1) initially caused problems for this package because it has a patching step. We mitigated that in #20 by essentially reverting any changes prior to applying the patch. So (1) is still manifesting in these builds, we just made the patch step robust in the face of an unclean source tree.
Issue (2) actually affects all of our vendor packages, but we normally don't see it because everywhere we're using
DESTDIR
we're also using discrete build and install invocations. However, due to this package being affected by (1), the external package got rebuilt during the install phase andDESTDIR
messed with the installation into the staging directory.Rather than making our patch step more robust, this change suppresses the "update" step for the external package, which is why the patch step was getting re-run in the first place. Without this update step, the package will act much more like it did when we used a
URL
upstream instead ofGIT_REPOSITORY
.The one caveat is that a change to
GIT_TAG
doesn't seem to invalidate the target like changingURL
orGIT_REPOSITORY
would. To mitigate that, I changed the entire target's name to include the ref, which is probably more accurate anyway.This changes reverts #20 because it is no longer needed in this package any more than it might be needed in a
URL
-based package.This change also reverts #21 because it was causing problems on Windows, and the package should no longer misbehave when faced with
DESTDIR
as long as discrete build and install phases are used properly.Release:
Debug: