Skip to content

Skip externals update when already up to date - #1502

Merged
mgduda merged 1 commit into
MPAS-Dev:developfrom
fmahebert:skip_checkout_externals
Sep 14, 2026
Merged

mgduda merged 1 commit into
MPAS-Dev:developfrom
fmahebert:skip_checkout_externals

Conversation

@fmahebert

Copy link
Copy Markdown

This PR is a possible fix to #1501

The PR branch first runs checkout_externals --status to check whether the external versions match what is in Externals.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.

@mgduda
mgduda requested review from jim-p-w and mgduda September 4, 2026 23:07
@mgduda mgduda added the Build System Changes related to the build system, either `Make` or `CMake`. label Sep 4, 2026

@jim-p-w jim-p-w left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@mgduda

mgduda commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

@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.
@fmahebert
fmahebert force-pushed the skip_checkout_externals branch from 4a72a6d to 120d3a9 Compare September 14, 2026 18:44
@fmahebert

Copy link
Copy Markdown
Author

@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.

@mgduda

mgduda commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@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.)

@mgduda
mgduda merged commit 5b281fa into MPAS-Dev:develop Sep 14, 2026
@fmahebert

Copy link
Copy Markdown
Author

Thanks for the context @mgduda, that policy makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build System Changes related to the build system, either `Make` or `CMake`.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants