Skip externals update when already up to date - #1502
Conversation
jim-p-w
left a comment
There was a problem hiding this comment.
When both of the external repositories are checked out and are clean, cloning the external repositories is skipped.
If either of the repositories is not checked out, the missing repo does get cloned.
If one repo has modifications and the other repo isn't checked out, nothing happens and cmake fails. I think that is a problem with the checkout_externals mechanism and is outside the scope of this change.
|
@fmahebert The changes look good to me. Could you add some detail to the commit message? Generally, we'd like a one-line summary (80 characters or less), followed by a blank line, and then one or more paragraphs explaining the changes in the commit (wrapping lines at 80 characters). |
Update the CMake logic to check the output of `checkout_externals --status` before calling `checkout_external` in its default/checkout mode. This allows network access to be skipped when external packages (as listed in Externals.cfg) are already up-to-date and clean. This change is a small speed-up to the CMake re-configuration steps, and also allows to run CMake in environments without network access.
4a72a6d to
120d3a9
Compare
|
@mgduda no problem; I've just force-pushed a change to rephrase the commit message. Please let me know if this is an appropriate level of detail, I'm happy to add or remove if you recommend it. |
|
@fmahebert The new commit message looks great -- thanks for the update! (For a bit more background, since we use merge commits in the MPAS-Model, individual commits are preserved, and in case a commit gets cherry-picked onto another branch, it can become detached from the PR that introduced that commit; so, including details of the code changes in individual commit messages is helpful.) |
|
Thanks for the context @mgduda, that policy makes sense. |
This PR is a possible fix to #1501
The PR branch first runs
checkout_externals --statusto check whether the external versions match what is inExternals.cfg. Only if there is a mismatch do we fall back to remote git operations to update the local copy. We determine the mismatch by parsing the output of the status command.Tested by running locally and observing (a) out-of-date externals are still updated from upstream, and (b) up-to-date externals are now verified locally and network access is skipped.
This saves 3-4 seconds of configure time on my dev system.