COMP: Shorten Windows build root to stay under ITK path limit#128
Open
hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
Open
COMP: Shorten Windows build root to stay under ITK path limit#128hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
Conversation
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>
2e1b922 to
8d8b425
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ITKFixedPointInverseDisplacementField→ stripITK→ truncate to 12 →FixedPointInD:\FixedPointIn→D:\a\ITKFixedPointInverseDisplacementFieldITK_BUILD_ROOTenv var in all subsequent steps (Download ITK, Build ITK, Configure CTest)ITK_BUILD_ROOTis 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.