Skip to content

COMP: Build the optional code paths in the per-PR workflow - #75

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:masterfrom
gdevenyi:ci/build-all-codepaths
Sep 21, 2026
Merged

hjmjohnson merged 1 commit into
InsightSoftwareConsortium:masterfrom
gdevenyi:ci/build-all-codepaths

Conversation

@gdevenyi

Copy link
Copy Markdown

cmake-multi-platform.yml is the workflow that runs on every pull request, and it passes no options at all. With the defaults that means cifti/ and fsliolib/ are never compiled, and neither are the blocks behind FSLSTYLE, PIGZ and REJECT_COMPLEX:

Option Default Gates
USE_CIFTI_CODE OFF cifti/
USE_FSL_CODE OFF fsliolib/
FSLSTYLE_NAME_CONFLICTS OFF -DFSLSTYLE
FSLSTYLE_PIGZ_SUPPORT OFF -DPIGZ
FSLSTYLE_REJECT_COMPLEX OFF -DREJECT_COMPLEX

So a PR that changes any of those files collects four green checks that never built it. Several open PRs are in exactly that position — #54 and #74 change FSLSTYLE/REJECT_COMPLEX blocks that nothing in the repo compiles, and roughly eighteen touch cifti/ or fsliolib/.

#57 and #59 do set -DUSE_CIFTI_CODE=ON -DUSE_FSL_CODE=ON, but they add different workflows and leave this one alone, so the per-PR signal stays misleading until one of them merges — and neither covers the FSL parity defines.

The change. The matrix gains an options axis: default is what a consumer gets with no arguments, all turns the optional libraries and the FSL parity defines on. Both are kept, because the default build is what ships and a change can break it while the fuller one still compiles. Four jobs become eight, each about half a minute. expat is installed for the Linux all jobs.

Verified on master before writing it, with the test suite:

default                build OK, tests pass
+cifti +fsl            build OK, tests pass
+cifti +fsl +FSLSTYLE  build OK, tests pass,
                       doPigz/doPigz2 present in nifti2_io.c.o

COMPILE_NIFTIUNUSED_CODE is deliberately left out. It guards code the project itself labels unused, so compiling it in CI would commit to keeping it working; whether that code should exist at all is a separate question (it is where #41 lives).

Independent of #57 and #59, which touch other files. #28 edits the ctest line in this same file, one line away from nothing this PR touches.

🤖 Generated with Claude Code

cmake-multi-platform.yml is the workflow that runs on every pull
request, and it passes no options at all.  With the defaults that means
cifti/ and fsliolib/ are never compiled, and neither are the blocks
behind FSLSTYLE, PIGZ and REJECT_COMPLEX.

  USE_CIFTI_CODE          OFF
  USE_FSL_CODE            OFF
  FSLSTYLE_NAME_CONFLICTS OFF   -> -DFSLSTYLE
  FSLSTYLE_PIGZ_SUPPORT   OFF   -> -DPIGZ
  FSLSTYLE_REJECT_COMPLEX OFF   -> -DREJECT_COMPLEX

So a PR that changes any of those files collects four green checks that
never built it.  Several open PRs are in exactly that position.

The matrix gains an 'options' axis: 'default' is what a consumer gets
with no arguments, 'all' turns the optional libraries and the FSL parity
defines on.  Both are kept, because the default build is what ships and
a change can break it while the fuller one still compiles.  Four jobs
become eight, each about half a minute.

expat is installed for the Linux 'all' jobs; cifti needs it and the
default jobs do not.

Verified on master before writing this, with the test suite:

  default                          build OK, tests pass
  +cifti +fsl                      build OK, tests pass
  +cifti +fsl +FSLSTYLE            build OK, tests pass, doPigz/doPigz2
                                   present in nifti2_io.c.o

COMPILE_NIFTIUNUSED_CODE is deliberately left out.  It guards code the
project itself labels unused, so compiling it in CI would commit to
keeping it working; whether that code should exist at all is a separate
question.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hjmjohnson

Copy link
Copy Markdown
Member

Reviewed as part of a sweep over the open backlog. Merge as-is. Highest-value of the current CI group.

A nine-agent review of all 52 open PRs found this same hole from four independent directions: cifti/, fsliolib/, and the FSLSTYLE paths are compiled by no CI job on this repository. Concretely, PRs #54, #55, #56, #66, #73, and #74 all modify code that has never been built by CI here. This PR is what closes that.

Job count goes 4 -> 8 and all eight already pass, so enabling the optional paths surfaces no new breakage — the code compiles, it simply was not being checked.

What remains uncompiled after this

The all leg covers USE_CIFTI_CODE, USE_FSL_CODE, and FSLSTYLE. Still built by nothing:

Each is a one-line matrix addition if you want them, though I would not expand the matrix further in this PR.

Two notes, neither blocking

TEST_INSTALL is still OFF in this workflow. It is gated on BUILD_SHARED_LIBS (CMakeLists.txt:120), which defaults OFF (:51) and is not set here, so install_linking never registers in these jobs — see the discussion on #29. The install/export path (install_nifti_target, the generated NIFTIConfig.cmake, and the find_package(NIFTI ... CONFIG REQUIRED) in real_easy/stand_alone_app/) therefore remains untested on every pull request even after this lands. Separate change; flagging so the gap is not assumed closed.

Shares a file with #28 (.github/workflows/cmake-multi-platform.yml). Hunks do not overlap — #28 is the ctest line, this is the matrix and configure steps — so they merge cleanly, but whichever lands second is worth a base update first.

@hjmjohnson
hjmjohnson merged commit d773c59 into InsightSoftwareConsortium:master Sep 21, 2026
8 checks passed
@hjmjohnson

Copy link
Copy Markdown
Member

The commit messages in this range were rewritten to remove trailers that do not belong in permanent history: Co-Authored-By: naming an AI tool, and Claude-Session: URLs that resolve for nobody. Only messages changed — the tree at the tip of master is byte-identical, and author, committer, and dates are preserved.

This PR's commit on the rewritten master:

  • b6531f011b COMP: Build the optional code paths in the per-PR workflow

The SHA recorded above by GitHub is from the pre-rewrite history and no longer resolves.

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.

2 participants