Skip to content

BUG: Reject absolute ITK install directories - #6919

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
agourakis82:6896-relative-install-dirs
Oct 1, 2026
Merged

hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
agourakis82:6896-relative-install-dirs

Conversation

@agourakis82

Copy link
Copy Markdown
Contributor

Reject absolute ITK_INSTALL_*_DIR values at configure time so install metadata cannot be generated with prefixed absolute paths. Closes #6896.

Validation
  • cmake -S . -B build-6896-policy-ok -DITK_BUILD_DEFAULT_MODULES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
  • cmake -S . -B build-6896-policy-bad -DITK_BUILD_DEFAULT_MODULES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DITK_INSTALL_LIBRARY_DIR=/usr/lib64 failed with the new configure-time error
  • cmake -S . -B build-6896-cmake-install-libdir-bad -DITK_BUILD_DEFAULT_MODULES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_INSTALL_LIBDIR=/usr/lib64 failed with the new configure-time error
  • cmake --build build-6896-policy-ok --target itkTestDriver -j 6
  • git diff --check
  • pre-commit run --files CMakeLists.txt CMake/ITKModuleExternal.cmake Modules/Core/TestKernel/src/CMakeLists.txt
AI assistance
  • Role: implementation and local validation support for a maintainer-directed CMake policy change.
  • The diff, commit, and validation were reviewed before submission.

@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Core Issues affecting the Core module labels Sep 29, 2026
@dzenanz

dzenanz commented Sep 29, 2026

Copy link
Copy Markdown
Member

@greptileai review this

@dzenanz dzenanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good on a glance.

@dzenanz
dzenanz requested a review from hjmjohnson September 29, 2026 17:59
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Build system adds validation for installation directory paths.

The PR appears safe to merge; no actionable issue remains from the changes reviewed.

Summary

The PR moves absolute install-directory rejection to the two ITK configuration entry points and removes the redundant TestKernel-local check.

  • Both entry points validate the seven ITK_INSTALL_*_DIR values after assigning defaults.
  • TestKernel continues to calculate its install RPATH for configurations that pass validation.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[In-tree ITK configure] --> C[Assign install-directory defaults]
  B[External module configure] --> C
  C --> D{Any ITK install directory absolute?}
  D -- Yes --> E[Stop configuration]
  D -- No --> F[Generate install metadata and process modules]
Loading

Reviews (2) · Last reviewed commit: "BUG: Reject absolute ITK install directo..."

@agourakis82
agourakis82 marked this pull request as ready for review September 30, 2026 20:49
Copilot AI balanced review requested due to automatic review settings September 30, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The validation is consistently applied before affected install paths are generated, with no unresolved issues found.

Review effort: Balanced
Findings: None

What changed in this PR

Rejects absolute ITK installation directories before generating invalid install metadata.

Changes:

  • Validates all ITK_INSTALL_*_DIR values in main and external-module configurations.
  • Simplifies test-driver RPATH generation under the enforced relative-path invariant.
File Description
CMakeLists.txt Adds top-level install-directory validation.
CMake/​ITKModuleExternal.cmake Applies validation to external modules.
Modules/​Core/​TestKernel/​src/​CMakeLists.txt Removes redundant local validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@hjmjohnson
hjmjohnson merged commit acd3617 into InsightSoftwareConsortium:main Oct 1, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ITK_INSTALL_*_DIR are assumed relative to CMAKE_INSTALL_PREFIX; absolute values yield wrong paths

4 participants