COMP: Fix PrintNumericTrait build error in debug mode#6280
Merged
blowekamp merged 2 commits intoMay 15, 2026
Merged
Conversation
dzenanz
approved these changes
May 14, 2026
c4e7f7f to
8a1abb8
Compare
Member
|
@greptile review |
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
git-commits.md explicit requests inclusion of this in the PR description. |
Remove itkPrintHelper.h from the #ifndef NDEBUG block in itkMacro.h and include it unconditionally at the end of itkMacro.h instead. Replace the itkMacro.h #include in itkIndent.h with a #error guard that enforces the required include order. Fix the handful of headers that included itkIndent.h before itkMacro.h. Remove the now-redundant class Indent forward declaration from itkPrintHelper.h.
8a1abb8 to
79f01ca
Compare
seanm
approved these changes
May 14, 2026
The #error guard broke standalone header inclusion tested by ITKCommonHeaderTest1. itkIndent.h only needs ITKCommon_EXPORT, so include ITKCommonExport.h directly to avoid the circular dependency through itkMacro.h -> itkPrintHelper.h -> itkIndent.h.
63f6ddc
into
InsightSoftwareConsortium:main
23 of 28 checks passed
Member
|
@blowekamp Thank you. I'll now layer in the CI that adds a debug build. |
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
May 15, 2026
Repurpose the ITK.Linux pipeline (the only non-Python per-PR Azure pipeline with wall-time headroom) from MinSizeRel to Debug while keeping BUILD_EXAMPLES=ON, adding per-PR Debug-mode coverage without a new pipeline. Companion to InsightSoftwareConsortium#6279 (missing-examples fixes) and relies on InsightSoftwareConsortium#6280 (Debug itkPrintHelper include-order fix, merged). Changes: * CTEST_BUILD_CONFIGURATION MinSizeRel -> Debug; job/suffix/test-run renamed *DebugCxx20 so CDash and ccache keys stay partitioned. * EXCLUDE_LABEL extended to "BigIO|RUNS_LONG" to bound Debug test wall time. * CCACHE_MAXSIZE 2.4G -> 6.25G. Empirical: non-Debug ITK.Linux warm cache is ~1.6 GiB; Debug objects are several times larger, and the sibling ITK.Linux.Python pipeline already sustains a ~4.7-6.2 GB cache on the same agent class, so 6.25G is the validated ceiling with disk headroom. * Post-build cache trim: record build start, run build+test, then 'ccache --evict-older-than ${BUILD_DURATION}s'. ccache refreshes an entry timestamp on every hit, so last-use eviction keeps only this build's working set in the saved cache, capping the artifact near a single Debug build instead of the cross-PR high-water mark. Trade: MinSizeRel binary-size monitoring is dropped (rarely surfaces issues Release does not); per-PR Debug semantics (assert(), debug iterators, debug-mode template instantiations) is higher value.
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
May 15, 2026
Repurpose the ITK.Linux pipeline (the only non-Python per-PR Azure pipeline with wall-time headroom) from MinSizeRel to Debug while keeping BUILD_EXAMPLES=ON, adding per-PR Debug-mode coverage without a new pipeline. Companion to InsightSoftwareConsortium#6279 (missing-examples fixes) and relies on InsightSoftwareConsortium#6280 (Debug itkPrintHelper include-order fix, merged). Changes: * CTEST_BUILD_CONFIGURATION MinSizeRel -> Debug; job/suffix/test-run renamed *DebugCxx20 so CDash and ccache keys stay partitioned. * EXCLUDE_LABEL extended to "BigIO|RUNS_LONG" to bound Debug test wall time. * CCACHE_MAXSIZE 2.4G -> 6.25G. Empirical: non-Debug ITK.Linux warm cache is ~1.6 GiB; Debug objects are several times larger, and the sibling ITK.Linux.Python pipeline already sustains a ~4.7-6.2 GB cache on the same agent class, so 6.25G is the validated ceiling with disk headroom. * Post-build cache trim: record build start, run build+test, then 'ccache --evict-older-than ${BUILD_DURATION}s'. ccache refreshes an entry timestamp on every hit, so last-use eviction keeps only this build's working set in the saved cache, capping the artifact near a single Debug build instead of the cross-PR high-water mark. Trade: MinSizeRel binary-size monitoring is dropped (rarely surfaces issues Release does not); per-PR Debug semantics (assert(), debug iterators, debug-mode template instantiations) is higher value.
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
May 15, 2026
Repurpose the ITK.Linux pipeline (the only non-Python per-PR Azure pipeline with wall-time headroom) from MinSizeRel to Debug while keeping BUILD_EXAMPLES=ON, adding per-PR Debug-mode coverage without a new pipeline. Companion to InsightSoftwareConsortium#6279 (missing-examples fixes) and relies on InsightSoftwareConsortium#6280 (Debug itkPrintHelper include-order fix, merged). Changes: * CTEST_BUILD_CONFIGURATION MinSizeRel -> Debug; job/suffix/test-run renamed *DebugCxx20 so CDash and ccache keys stay partitioned. * EXCLUDE_LABEL extended to "BigIO|RUNS_LONG" to bound Debug test wall time. * CCACHE_MAXSIZE 2.4G -> 6.25G. Empirical: non-Debug ITK.Linux warm cache is ~1.6 GiB; Debug objects are several times larger, and the sibling ITK.Linux.Python pipeline already sustains a ~4.7-6.2 GB cache on the same agent class, so 6.25G is the validated ceiling with disk headroom. * Post-build cache trim: record build start, run build+test, then 'ccache --evict-older-than ${BUILD_DURATION}s'. ccache refreshes an entry timestamp on every hit, so last-use eviction keeps only this build's working set in the saved cache, capping the artifact near a single Debug build instead of the cross-PR high-water mark. Trade: MinSizeRel binary-size monitoring is dropped (rarely surfaces issues Release does not); per-PR Debug semantics (assert(), debug iterators, debug-mode template instantiations) is higher value.
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
May 16, 2026
Repurpose the ITK.Linux pipeline (the only non-Python per-PR Azure pipeline with wall-time headroom) from MinSizeRel to Debug while keeping BUILD_EXAMPLES=ON, adding per-PR Debug-mode coverage without a new pipeline. Companion to InsightSoftwareConsortium#6279 (missing-examples fixes) and relies on InsightSoftwareConsortium#6280 (Debug itkPrintHelper include-order fix, merged). Changes: * CTEST_BUILD_CONFIGURATION MinSizeRel -> Debug; job/suffix/test-run renamed *DebugCxx20 so CDash and ccache keys stay partitioned. * EXCLUDE_LABEL extended to "BigIO|RUNS_LONG" to bound Debug test wall time. * CCACHE_MAXSIZE 2.4G -> 6.25G. Empirical: non-Debug ITK.Linux warm cache is ~1.6 GiB; Debug objects are several times larger, and the sibling ITK.Linux.Python pipeline already sustains a ~4.7-6.2 GB cache on the same agent class, so 6.25G is the validated ceiling with disk headroom. * Post-build cache trim: record build start, run build+test, then 'ccache --evict-older-than ${BUILD_DURATION}s'. ccache refreshes an entry timestamp on every hit, so last-use eviction keeps only this build's working set in the saved cache, capping the artifact near a single Debug build instead of the cross-PR high-water mark. Trade: MinSizeRel binary-size monitoring is dropped (rarely surfaces issues Release does not); per-PR Debug semantics (assert(), debug iterators, debug-mode template instantiations) is higher value.
Member
|
May be unrelated. It is somewhat unusual that itkIndent.cxx doesn't have |
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
May 16, 2026
Repurpose the ITK.Linux pipeline (the only non-Python per-PR Azure pipeline with wall-time headroom) from MinSizeRel to Debug while keeping BUILD_EXAMPLES=ON, adding per-PR Debug-mode coverage without a new pipeline. Companion to InsightSoftwareConsortium#6279 (missing-examples fixes) and relies on InsightSoftwareConsortium#6280 (Debug itkPrintHelper include-order fix, merged). Changes: * CTEST_BUILD_CONFIGURATION MinSizeRel -> Debug; job/suffix/test-run renamed *DebugCxx20 so CDash and ccache keys stay partitioned. * EXCLUDE_LABEL extended to "BigIO|RUNS_LONG" to bound Debug test wall time. * CCACHE_MAXSIZE 2.4G -> 6.25G. Empirical: non-Debug ITK.Linux warm cache is ~1.6 GiB; Debug objects are several times larger, and the sibling ITK.Linux.Python pipeline already sustains a ~4.7-6.2 GB cache on the same agent class, so 6.25G is the validated ceiling with disk headroom. * Post-build cache trim: record build start, run build+test, then 'ccache --evict-older-than ${BUILD_DURATION}s'. ccache refreshes an entry timestamp on every hit, so last-use eviction keeps only this build's working set in the saved cache, capping the artifact near a single Debug build instead of the cross-PR high-water mark. Trade: MinSizeRel binary-size monitoring is dropped (rarely surfaces issues Release does not); per-PR Debug semantics (assert(), debug iterators, debug-mode template instantiations) is higher value.
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.
Fix a build error in debug mode where
PrintNumericTrait'sos << indentcould not resolveoperator<<(ostream, const Indent&).Root cause and approach
itkIndent.hpreviously pulled initkMacro.h, which inside#ifndef NDEBUGincludeditkPrintHelper.hbeforeclass Indentwas complete. Moving the include to the unconditional end ofitkMacro.hbreaks the circular chain cleanly.To enforce the required include order, the
#include "itkMacro.h"initkIndent.his replaced with a#errorguard — this surfaces any future violation at compile time rather than silently producing a bad include order.A handful of headers that directly included
itkIndent.hbeforeitkMacro.hwere fixed to includeitkMacro.hfirst. The now-redundantclass Indent;forward declaration is removed fromitkPrintHelper.h.Verified by building the full ITK debug tree (
cmake --preset debug) with no errors.AI assistance
GitHub Copilot (Claude Sonnet 4.6) identified the circular include chain, proposed the fix, and iterated until the full debug build was clean.