Skip to content

BUG: Spare test fixtures from dashboard post-build cleanup (#6322 regression)#6325

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:dashboardfrom
hjmjohnson:fix/dashboard-cleanup-spare-test-fixtures
May 22, 2026
Merged

BUG: Spare test fixtures from dashboard post-build cleanup (#6322 regression)#6325
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:dashboardfrom
hjmjohnson:fix/dashboard-cleanup-spare-test-fixtures

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

Fixes a regression from #6322: the post-build cleanup deletes Wavefront .obj mesh fixtures and a DCMTK Makefile.lib before ctest_test, breaking itkOBJMeshIOTest1/2 and itkMeshFileReadWriteOBJ* on every dashboard client (ARMBUILD, Azure ITK.* pipelines). Targets the dashboard branch — this is live on all PR CI right now.

Root cause

#6322 added a post-build, pre-test cleanup in itk_common.cmake:

file(GLOB_RECURSE _dashboard_object_files LIST_DIRECTORIES FALSE
     "${CTEST_BINARY_DIRECTORY}/*.o" "${CTEST_BINARY_DIRECTORY}/*.a"
     "${CTEST_BINARY_DIRECTORY}/*.obj" "${CTEST_BINARY_DIRECTORY}/*.lib")
file(REMOVE ${_dashboard_object_files})

*.obj and *.lib are overloaded extensions:

  • *.obj — MSVC compiled object and Wavefront mesh (ITKIOMeshOBJ Baseline/bunny.obj, box.obj; Cuberille mesh.obj).
  • *.lib — MSVC static/import lib and Modules/ThirdParty/DCMTK/.../config/templates/Makefile.lib.

GLOB_RECURSE descends into build/ExternalData/, so the mesh fixtures were deleted between ctest_build and ctest_test:

Read file .../build/ExternalData/Modules/IO/MeshOBJ/test/Baseline/bunny.obj failed
itkOBJMeshIOTest1 / itkOBJMeshIOTest2 / itkMeshFileReadWriteOBJTest ***Failed

The *.o/*.a parts were harmless (no test data uses those extensions); only the *.obj/*.lib additions collided.

The fix

Scope the deletion by path — compiled objects always live under CMakeFiles/, archives under lib/, on every platform:

file(GLOB_RECURSE _objs ... "*.o" "*.obj")
list(FILTER _objs INCLUDE REGEX "/CMakeFiles/")
file(GLOB_RECURSE _arch ... "*.a" "*.lib")
list(FILTER _arch INCLUDE REGEX "/lib/")

Verified against a real configured ITK build tree:

  • 5579 compiled objects + 148 archives still removed (disk savings preserved).
  • All 7 *.obj mesh fixtures and the DCMTK Makefile.lib spared.

@github-actions github-actions Bot added the type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances label May 21, 2026
@hjmjohnson hjmjohnson marked this pull request as ready for review May 21, 2026 23:57
@hjmjohnson hjmjohnson requested a review from dzenanz May 21, 2026 23:58
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR fixes a regression from #6322 where a post-build cleanup in itk_common.cmake deleted Wavefront .obj mesh fixtures and a DCMTK Makefile.lib before ctest_test ran, causing itkOBJMeshIOTest1/2 and related tests to fail across all dashboard CI clients. The fix scopes the deletion by directory path instead of extension alone.

  • Compiled objects (*.o, *.obj) are now filtered to match only paths under CMakeFiles/ (Ninja/Makefile generators) or .dir/ (Visual Studio generator), ensuring mesh fixtures in ExternalData/ are untouched.
  • Archives (*.a, *.lib) are filtered to paths under lib/, excluding the DCMTK Makefile.lib template; unused intermediate variables are properly unset afterward.

Confidence Score: 5/5

Safe to merge — the change is a targeted path-scoping fix that prevents false-positive deletion of test fixtures while preserving all legitimate intermediate file cleanup.

The fix correctly restricts object deletion to compiler intermediate directories and archive deletion to lib/ subdirectories. The GLOB + FILTER approach is sound, the regex patterns cover both Ninja/Makefiles and Visual Studio generator layouts, and unused variables are properly unset. No test data paths are in scope of the filtered lists.

No files require special attention.

Important Files Changed

Filename Overview
itk_common.cmake Scopes post-build cleanup to compiler intermediate directories (CMakeFiles/ and .dir/) for objects and lib/ for archives, preventing deletion of Wavefront .obj mesh fixtures and the DCMTK Makefile.lib before ctest_test.

Reviews (2): Last reviewed commit: "BUG: Spare test fixtures from dashboard ..." | Re-trigger Greptile

Comment thread itk_common.cmake Outdated
The post-build intermediate cleanup added in InsightSoftwareConsortium#6322 globs *.obj and *.lib
recursively under CTEST_BINARY_DIRECTORY and deletes the matches before
ctest_test. Both extensions are overloaded: *.obj also names Wavefront
mesh fixtures (ITKIOMeshOBJ Baseline/bunny.obj, box.obj; Cuberille
mesh.obj) and *.lib names a DCMTK Makefile template. GLOB_RECURSE
descends into ExternalData/, so those fixtures were removed between
build and test, failing itkOBJMeshIOTest1/2 and itkMeshFileReadWriteOBJ*
on every dashboard client (ARMBUILD, Azure ITK.* pipelines).

Scope the deletion by path: match compiled objects only under
CMakeFiles/ and archives only under lib/, where every compiler-emitted
object and archive lives on all platforms. Verified against a real
build tree: 5579 compiled objects and 148 archives still removed; all
seven *.obj mesh fixtures and the DCMTK Makefile.lib spared.
@hjmjohnson hjmjohnson force-pushed the fix/dashboard-cleanup-spare-test-fixtures branch from 6d15de2 to 27b2484 Compare May 22, 2026 01:16
@hjmjohnson hjmjohnson marked this pull request as draft May 22, 2026 12:49
@hjmjohnson

This comment was marked as outdated.

@hjmjohnson
Copy link
Copy Markdown
Member Author

hjmjohnson commented May 22, 2026

Local build verification on Windows (MSVC, C:\repo\ITK\build):

.obj files — 4,243 total

Category Count Total size Action
Compiled objects (path matches CMakeFiles/ or .dir/) 4,241 7,059 MB deleted
Mesh fixtures (ExternalData/.../bunny.obj, box.obj) 2 387 KB spared

.lib files — 116 total

Category Count Total size Action
Archives (path matches /lib/) 114 635 MB deleted
KWStyle build artifacts (KWStyle-build/bin/kwssys.lib, KWStyleLib.lib) 2 25 MB spared (in bin/, not test data)

No .o or .a files present (MSVC build). The filter correctly restricts deletion to compiler intermediate directories. The 2 KWStyle .lib files escape the /lib/ filter but are not test fixtures — minor reduction in disk savings relative to the original broad glob, not a regression introduced by this PR.

@hjmjohnson hjmjohnson marked this pull request as ready for review May 22, 2026 12:55
@hjmjohnson hjmjohnson merged commit cf0cf0e into InsightSoftwareConsortium:dashboard May 22, 2026
4 of 5 checks passed
@hjmjohnson hjmjohnson deleted the fix/dashboard-cleanup-spare-test-fixtures branch May 22, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants