Skip to content

ENH: Add SPDX SBOM generation for build-time supply chain tracking#1

Draft
Copilot wants to merge 13 commits intomainfrom
copilot/explore-sbom-generation
Draft

ENH: Add SPDX SBOM generation for build-time supply chain tracking#1
Copilot wants to merge 13 commits intomainfrom
copilot/explore-sbom-generation

Conversation

Copy link

Copilot AI commented Feb 20, 2026

Note: This PR needs to be rebased on top of the current main branch. The branch is currently based on an older version of the repository. A rebase cannot be performed automatically due to environment constraints — manual rebase and force-push is required.


ITK lacks a machine-readable, build-configuration-aware description of its components and third-party dependencies. The existing NOTICE file is static, unversioned, and not parseable by SBOM tooling. This adds SPDX 2.3 SBOM generation at CMake configure time, following VTK's adoption of SPDX.

Changes

  • CMake/ITKModuleMacros.cmake — Extend itk_module() macro with SPDX_LICENSE_IDENTIFIER, SPDX_COPYRIGHT_TEXT, SPDX_DOWNLOAD_LOCATION keywords
  • CMake/ITKSBOM.cmake (new) — itk_generate_sbom() function producing SPDX 2.3 tag-value output with package entries, CONTAINS and DEPENDS_ON relationships for all enabled modules
  • CMakeLists.txtITK_GENERATE_SBOM option (default OFF, advanced), invoked after module enablement
  • All 23 ThirdParty itk-module.cmake files — Annotated with SPDX license identifiers, copyright text, and upstream download locations
  • Documentation/docs/sbom.md (new) — Usage and extension documentation

Usage

cmake -DITK_GENERATE_SBOM=ON /path/to/ITK
# Generates ITK-6.0.0.spdx in build dir with only enabled modules

Modules without SPDX metadata appear as NOASSERTION, enabling incremental adoption. Remote modules can declare the same keywords to extend the build SBOM.

Example itk-module.cmake

itk_module(ITKZLIB
  DESCRIPTION "${DOCUMENTATION}"
  SPDX_LICENSE_IDENTIFIER "Zlib"
  SPDX_COPYRIGHT_TEXT "Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler"
  SPDX_DOWNLOAD_LOCATION "https://github.com/zlib-ng/zlib-ng"
)

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)
  • Updated API documentation (or API not changed)
  • Added license to new files (if any)
  • Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
  • Added ITK examples for all new major features (if any)

Refer to the ITK Software Guide for
further development details if necessary.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

blowekamp and others added 2 commits February 6, 2026 20:06
By use FetchContent for ITK, along with specific ITK module interface
library linking enable to build only the targets needed in ITK for a
project. While the initial configuration time is longer due to
downloading and configuring ITK, the CMake project structure is
simpler than a Superbuild, and the build is more efficient.
Iterators "with only index" do not need to have access to the image or its
offset table.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing a pull request! 🙏

Welcome to the ITK community! 🤗👋☀️

We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜
More support and guidance on the contribution process can be found in our contributing guide. 📖

This is an automatic message. Allow for time for the ITK community to be able to read the pull request and comment
on it.

Copilot AI changed the title [WIP] Explore generating Software Bill of Materials for ITK components ENH: Add SPDX SBOM generation for build-time supply chain tracking Feb 20, 2026
Copilot AI requested a review from dzenanz February 20, 2026 21:56
@dzenanz
Copy link
Owner

dzenanz commented Feb 20, 2026

Based on old version of repository.

@dzenanz dzenanz closed this Feb 20, 2026
N-Dekker and others added 3 commits February 21, 2026 21:05
Replaced code like `if (x) b = true; else b = false;` with `b = x;`

Using Notepad++, Replace in Files, doing:

    Find what: ^([ ]+ )if \((.+)\)\r\n\1{\r\n\1  (.+) = true;\r\n\1}\r\n\1else\r\n\1{\r\n\1  \3 = false;\r\n\1}
    Replace with: $1$3 = $2;
    Filters: itk*.*
    [v] Match case
    (*) Regular expression

Improved code readability by ensuring that the expression at the right hand side
of each assignment is a Boolean expression, rather than an integer expression.
Addressed the following compilation error with  AppleClang 12.0.0.12000032:
itkMaskFeaturePointSelectionFilter.hxx:53:50: error: missing
'typename' prior to dependent type name
'NumericTraits<SizeType>::PrintType'  os << indent << "BlockRadius: "
<< static_cast<NumericTraits<SizeType>::PrintType>(m_BlockRadius) <<
std::endl;

Reverts change made in ad0eaca.
Address linking error:
QuickViewTest.obj : error LNK2019: unresolved external symbol "public:
void __cdecl QuickView::AddImage<class itk::Image<char,2> >...

Explicitly instantiate the three native C++ char types for
Quick::View::AddImage to ensure compatibility with native pixel types.

xref: 944f3b0
@dzenanz
Copy link
Owner

dzenanz commented Feb 23, 2026

@copilot Rebase this on top of current main branch.

Copy link
Author

Copilot AI commented Feb 23, 2026

@copilot Rebase this on top of current main branch.

I'm unable to rebase this branch — my environment doesn't support git rebase (force push is not available) or pulling branches from GitHub. Could you rebase the branch locally and push it? Then I can continue working on top of the updated branch.

@dzenanz dzenanz force-pushed the copilot/explore-sbom-generation branch from 9b4411b to d09ee23 Compare February 23, 2026 16:04
@dzenanz
Copy link
Owner

dzenanz commented Feb 23, 2026

@copilot I rebased on top of current main, and force-pushed, but I did not resolved merge conflicts. Add a commit which reconciles the differences.

Manually put version information into the external data filename.
…ify-assignment-to-bool

STYLE: Simplify `bool` assignments by removing `if` and `else`
thewtex and others added 6 commits February 23, 2026 15:16
…e-Image-and-OffsetTable-from-ImageConstIteratorWithOnlyIndex

STYLE: Remove Image and OffsetTable from ImageConstIteratorWithOnlyIndex
- Add SPDX metadata keywords (SPDX_LICENSE_IDENTIFIER, SPDX_COPYRIGHT_TEXT,
  SPDX_DOWNLOAD_LOCATION) to the itk_module() macro in ITKModuleMacros.cmake
- Create CMake/ITKSBOM.cmake module that generates SPDX 2.3 documents at
  configure time when ITK_GENERATE_SBOM=ON
- Add SPDX metadata to all ThirdParty itk-module.cmake files
- Add ITK_GENERATE_SBOM option to main CMakeLists.txt
- Create documentation at Documentation/docs/sbom.md

Co-authored-by: dzenanz <[email protected]>
@dzenanz
Copy link
Owner

dzenanz commented Feb 23, 2026

@copilot I rebased on top of current main, and force-pushed, but I did not resolved merge conflicts. Add a commit which reconciles the differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants