Skip to content

COMP: Shorten Windows build root to stay under ITK path limit#128

Open
hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
hjmjohnson:fix-windows-long-path
Open

COMP: Shorten Windows build root to stay under ITK path limit#128
hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
hjmjohnson:fix-windows-long-path

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

@hjmjohnson hjmjohnson commented Apr 14, 2026

Shorten the build directory path on Windows using a directory junction instead of bypassing ITK's path length validation. The repo name is stripped of its "ITK" prefix and truncated to 12 characters, then a junction provides a short root for all build directories.

How it works
  1. Compute short name (bash, all platforms): ITKFixedPointInverseDisplacementField → strip ITK → truncate to 12 → FixedPointIn
  2. Create junction (pwsh, Windows only): D:\FixedPointInD:\a\ITKFixedPointInverseDisplacementField
  3. Use ITK_BUILD_ROOT env var in all subsequent steps (Download ITK, Build ITK, Configure CTest)
  4. On Linux/macOS, ITK_BUILD_ROOT is just the real workspace parent (no junction needed)

Path math: D:\FixedPointIn\ITK-build = 26 chars (well under the 50-char limit).

Why not ITK_SKIP_PATH_LENGTH_CHECKS?

The previous approach disabled ITK's path validation entirely. This approach keeps the safety check active — if a path is genuinely too long even after shortening, ITK will still catch it at configure time.

Instead of unconditionally skipping ITK's path length checks, shorten
the build directory path on Windows using a directory junction. The
repo name is stripped of its "ITK" prefix and truncated to 12 characters
(e.g. ITKFixedPointInverseDisplacementField → FixedPointIn), then a
junction D:\<short> → D:\a\<full-repo-name> provides a short root for
ITK clone, build, and CTest dashboard directories.

This keeps ITK's 50-character path validation active as a safety check
while ensuring long-named remote module repos can build on Windows CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hjmjohnson hjmjohnson force-pushed the fix-windows-long-path branch from 2e1b922 to 8d8b425 Compare April 15, 2026 00:17
@hjmjohnson hjmjohnson changed the title COMP: Skip ITK path length checks on Windows CI COMP: Shorten Windows build root to stay under ITK path limit Apr 15, 2026
@hjmjohnson hjmjohnson requested a review from thewtex April 15, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant