Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Description

Developers modifying remote modules lose changes when CMake reconfigures and updates modules to upstream versions. Setting Module_<name>_GIT_TAG for each module is cumbersome with multiple remotes.

Changes

  • Added ITK_FREEZE_REMOTE_MODULES CMake option in ITKModuleRemote.cmake

    • Default: OFF, marked advanced
    • Prevents git fetch/update on existing remote modules
    • New modules still clone normally (intentional)
  • Modified itk_fetch_module() in ITKModuleRemote.cmake

    • Check runs after Module_<name>_GIT_TAG override processing
    • Precedence: ITK_FORBID_DOWNLOADS > Module_<name>_GIT_TAG > ITK_FREEZE_REMOTE_MODULES > empty tag check
    • Status message logged when skipping updates
  • Updated Modules/Remote/README.md

    • New "Working with Modified Remote Modules" section
    • Documents both global freeze and per-module override patterns

Usage

# Freeze all remote modules
cmake -DITK_FREEZE_REMOTE_MODULES=ON /path/to/ITK

# Per-module override still works (takes precedence)
cmake -DITK_FREEZE_REMOTE_MODULES=ON \
      -DModule_Montage_GIT_TAG="" \
      /path/to/ITK

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)
  • Updated API documentation (or API not changed)
  • Added license to new files (if any)
  • Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
  • Added ITK examples for all new major features (if any)
Original prompt

This section details on the original issue you should resolve

<issue_title>Improve workflow of updating remote modules</issue_title>
<issue_description>Updating remote modules is cumbersome. Brad made a nice suggestion to improve the situation. It would be good if someone implemented it. I am repeating it here:

To prevent the remote's hash to reverting to what is upstream, set CMake variables Module_XXX_GIT_TAG. In one of my local builds I have Module_MinimalPathExtraction_GIT_TAG set to e43a18f43272bea8c9de5ded7846efbffc81f0ad and Module_Montage_GIT_TAG set to 9aafc48520b2cac963f0f1dfad97b32ed9ab89cf.

That can be cumbersome with multiple remotes being modified... Ideally a flag not to update any of them would be ideal. 🤔
</issue_description>

<agent_instructions>Implement the requested feature by appropriately modifying CMake code in this repository.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 27, 2026 15:01
Co-authored-by: dzenanz <1792121+dzenanz@users.noreply.github.com>
…dence

Co-authored-by: dzenanz <1792121+dzenanz@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve workflow of updating remote modules ENH: Add ITK_FREEZE_REMOTE_MODULES option to prevent remote module updates Jan 27, 2026
Copilot AI requested a review from dzenanz January 27, 2026 15:11
@github-actions github-actions bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Remotes Issues affecting the Remote module labels Jan 27, 2026
@dzenanz dzenanz requested review from blowekamp and removed request for dzenanz January 27, 2026 16:32
@dzenanz
Copy link
Member

dzenanz commented Jan 27, 2026

Can you give this a try Brad?

Copy link
Member

@blowekamp blowekamp left a comment

Choose a reason for hiding this comment

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

The changes seem to work for me.

OFF
)
mark_as_advanced(ITK_FREEZE_REMOTE_MODULES)

Copy link
Member

Choose a reason for hiding this comment

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

This option's location would be better at the top to ITKModuleRemote.cmake file.

Copy link
Member

Choose a reason for hiding this comment

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

@copilot apply this suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the option to the top of ITKModuleRemote.cmake in commit 1c6652d.

Co-authored-by: dzenanz <1792121+dzenanz@users.noreply.github.com>
Copilot AI requested a review from dzenanz January 27, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Remotes Issues affecting the Remote module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve workflow of updating remote modules

3 participants