feat: add make sbom target - #557
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds new autotools make sbom workflow to generate and install SBOM artifacts (CycloneDX + SPDX) for CRA compliance, plus updates repo guidance/docs.
Changes:
- Add SBOM-related
make sbom,make install-sbom,make uninstall-sbomtargets (staging install, callinggen-sbom, validating SPDX). - Extend
configure.acto expose libtool version components and discover SBOM tooling (python3,pyspdxtools,git). - Add/update contributor and build documentation under
AI/, plus refreshAGENTS.mdand ignore common AI tool local files.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| configure.ac | Exposes version components + finds SBOM tool executables for substitution into make rules |
| Makefile.am | Implements SBOM generation/validation and install/uninstall targets |
| AI/contributing.md | New contribution guidelines (workflow, CI rules, testing) |
| AI/build-windows.md | New Windows build guide |
| AI/build-linux.md | New Linux/macOS build guide |
| AI/build-embedded.md | New embedded/RTOS build guide |
| AGENTS.md | Replaces prior agent guidance with repo overview + links to new docs |
| .gitignore | Ignores common AI-tool local configuration directories/files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @MarkAtwood - Please address the Copilot feedback first |
embhorn
left a comment
There was a problem hiding this comment.
Skoll Code Review
Scan type: review
Overall recommendation: REQUEST_CHANGES
Findings: 8 total — 8 posted, 0 skipped
8 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [High] CMake sbom target uses shell redirection
>which does not work in add_custom_target COMMAND (VERBATIM) —CMakeLists.txt:516-517 - [Medium] CMake sbom target uses
cmake -E rmwhich requires CMake 3.17 but project minimum is 3.16 —CMakeLists.txt:535-536 - [Medium] CMake sbom target hardcodes libwolfmqtt.so, breaking static / macOS / Windows builds —
CMakeLists.txt:525 - [Medium] New Linux build doc recommends non-existent autotools flags --with-wolfssl / --with-wolfssl-tree —
AI/build-linux.md:46-49 - [Medium] AGENTS.md states GPLv2, contradicting the GPLv3-or-later licensing used everywhere else (including this PR) —
AGENTS.md:5 - [Medium] New CMake sbom target has no CI coverage —
.github/workflows/sbom.yml:88-163 - [Low] CMake and autotools feed different inputs to gen-sbom --options-h, undercutting the 'byte-comparable SBOM' claim —
CMakeLists.txt:502-517 - [Low] pull_request branches filter
'*'misses slash-containing base branches —.github/workflows/sbom.yml:6-7
Review generated by Skoll
embhorn
left a comment
There was a problem hiding this comment.
Hi @MarkAtwood
Very cool! I was able to generate the SBOM files.
Please review the skoll comments and then it should be ready.
## Document Information
SPDXVersion: SPDX-2.3
DataLicense: CC0-1.0
SPDXID: SPDXRef-DOCUMENT
DocumentName: wolfmqtt-2.0.0
DocumentNamespace: urn:uuid:d3437452-0edc-5202-a2e4-3089e486b663
## Creation Information
Creator: Organization: wolfSSL Inc.
Creator: Tool: wolfssl-sbom-gen-1.2
Created: 2026-07-10T10:15:17Z
## Package Information
PackageName: wolfmqtt
SPDXID: SPDXRef-Package-wolfmqtt
PackageVersion: 2.0.0
PackageSupplier: Organization: wolfSSL Inc.
PackageDownloadLocation: https://github.com/wolfSSL/wolfmqtt
FilesAnalyzed: false
PackageChecksum: SHA256: d6a8b093aba36f2e1abb6c2ed429df9ed113e4dea493ac21764ccfb99ad9d4ef
PackageLicenseConcluded: GPL-3.0-or-later
PackageLicenseDeclared: GPL-3.0-or-later
PackageCopyrightText: Copyright (C) 2006-2026 wolfSSL Inc.
PackageComment: Build configuration defines: ENABLE_MQTT_TLS, SIZEOF_LONG, WOLFMQTT_BROKER, WOLFMQTT_DISCONNECT_CB, WOLFMQTT_MAX_QOS, WOLFMQTT_PROPERTY_CB, WOLFMQTT_V5
ExternalRef: SECURITY cpe23Type cpe:2.3:a:wolfssl:wolfmqtt:2.0.0:*:*:*:*:*:*:*
ExternalRef: PACKAGE-MANAGER purl pkg:github/wolfSSL/wolfmqtt@v2.0.0
ExternalRef: SECURITY advisory https://github.com/wolfSSL/wolfmqtt/security/advisories
## Package Information
PackageName: wolfssl
SPDXID: SPDXRef-Package-wolfssl
PackageVersion: 5.9.2
PackageSupplier: Organization: wolfSSL Inc.
PackageDownloadLocation: https://github.com/wolfSSL/wolfssl
FilesAnalyzed: false
PackageLicenseConcluded: GPL-3.0-only
PackageLicenseDeclared: GPL-3.0-only
PackageCopyrightText: NOASSERTION
ExternalRef: PACKAGE-MANAGER purl pkg:github/wolfSSL/wolfssl@v5.9.2
## Relationships
Relationship: SPDXRef-DOCUMENT DESCRIBES SPDXRef-Package-wolfmqtt
Relationship: SPDXRef-Package-wolfmqtt DEPENDS_ON SPDXRef-Package-wolfssl
## Annotations
Annotator: Tool: wolfssl-sbom-gen-1.2
AnnotationDate: 2026-07-10T10:15:17Z
AnnotationType: OTHER
SPDXREF: SPDXRef-Package-wolfmqtt
AnnotationComment: wolfssl:sbom:hash-kind=library-binary
Annotator: Tool: wolfssl-sbom-gen-1.2
AnnotationDate: 2026-07-10T10:15:17Z
AnnotationType: OTHER
SPDXREF: SPDXRef-Package-wolfmqtt
AnnotationComment: wolfssl:sbom:hash-source=lib
|
SBOM generation is standardized on the canonical scripts/sbom.am fragment in wolfSSL/wolfssl#10343 (merged). The canonical was deliberately unified to be a superset — it now supports both options.h (via SBOM_OPTIONS_H) and config.h/AM_CFLAGS. Review: This PR's fragment is the older 206-line copy. It has the SBOM_OPTIONS_H branch wolfMQTT needs (feature flags come from wolfmqtt/options.h, not config.h), but it's missing the SBOM_CONFIG_H override, the AM_CFLAGS/CFLAGS capture, and sbomdir = $(docdir). How to address: Re-vendor the unified canonical verbatim. It keeps SBOM_OPTIONS_H, so nothing is lost: cp /path/to/wolfssl/scripts/sbom.am scripts/sbom.am |
Add `sbom`, `install-sbom` and `uninstall-sbom` targets to both build systems, producing CycloneDX and SPDX output for CRA compliance. The recipe is the canonical scripts/sbom.am fragment from wolfSSL (wolfSSL/wolfssl#10343), vendored byte-identical; Makefile.am only declares the wolfMQTT-specific inputs. Feature macros come from the generated wolfmqtt/options.h via SBOM_OPTIONS_H rather than config.h, since wolfMQTT uses no AC_DEFINE. Both paths stage an install to hash the real installed library, record wolfSSL as a dependency component, validate the SPDX with pyspdxtools, and are exercised in CI. Requires a wolfssl source tree via WOLFSSL_DIR for scripts/gen-sbom, plus python3 and spdx-tools on the build host.
13adb53 to
07d08d5
Compare
embhorn
left a comment
There was a problem hiding this comment.
Looking good. Just a couple suggestions.
| ``` | ||
|
|
||
| Note: recording wolfSSL as a dependency and emitting wolfMQTT-specific project | ||
| URLs require the `gen-sbom` from wolfSSL/wolfssl#10343. Against an older |
There was a problem hiding this comment.
Is this eventually going to make it into wolfSSL? It seems short sighted to document the PR in the Readme
| with: | ||
| path: wolfmqtt | ||
|
|
||
| # wolfMQTT links wolfSSL for TLS, so its SBOM records wolfSSL as a |
There was a problem hiding this comment.
wolfMQTT does not require wolfSSL if configured with --disable-tls. I suggest adding that config as a test case here (and expecting no dependencies).
Adds
make sbomand a cmakesbomtarget to wolfMQTT, producing CycloneDX andSPDX output for CRA compliance. Customers asking for an SBOM can then self serve
(support tickets 22020, 22165).
Usage
autotools:
./autogen.sh && ./configure make make sbom WOLFSSL_DIR=/path/to/wolfssl/sourcecmake:
cmake -B build -DWOLFSSL_DIR=/path/to/wolfssl/source . cmake --build build cmake --build build --target sbomOutputs:
wolfmqtt-<version>.cdx.json,wolfmqtt-<version>.spdx.json,wolfmqtt-<version>.spdx.make install-sbominstalls them under$(docdir);plain
make installdoes not, so the SBOM is opt in.Requirements
WOLFSSL_DIRpoints at a wolfssl source tree containingscripts/gen-sbom,which has been on wolfssl master since feat: SBOM generation and OmniBOR build provenance (CRA compliance) wolfssl#10343 merged.
python3andpip install spdx-toolson the build host.Design
scripts/sbom.amis the canonical fragment from wolfSSL/wolfssl, vendoredbyte-identical;
diff scripts/sbom.am <wolfssl>/scripts/sbom.amis empty.Makefile.amdeclares only the wolfMQTT-specific inputs. Keeping it verbatimmeans fixes to the canonical recipe apply here by re-copying, with no local
divergence to reconcile.
Feature macros come from the generated
wolfmqtt/options.hviaSBOM_OPTIONS_Hrather thanconfig.h, because wolfMQTT uses noAC_DEFINE.Both build systems stage an install and hash the library that actually gets
installed, record wolfSSL as a dependency component, and validate the SPDX with
pyspdxtools. CI exercises both paths and asserts the wolfSSLDEPENDS_ONrelationship, so an SBOM that silently dropped the dependency fails the build
rather than passing on file existence alone.
The two build systems agree on package metadata, license, option fingerprint and
the wolfSSL dependency. The recorded file name and checksum differ by design,
since autotools installs the SONAME-versioned library and cmake an unversioned
one, and each hashes what it actually installs.
Changes since the last review
scripts/sbom.amfrom the canonical unified copy, per @sameehj.The previous copy predated feat: SBOM generation and OmniBOR build provenance (CRA compliance) wolfssl#10343 and was missing
SBOM_CONFIG_H, theAM_CFLAGS/CFLAGScapture, andsbomdir = $(docdir).--config $<CONFIG>tocmake --install. Without it, multi-configgenerators (Visual Studio, Ninja Multi-Config) fall back to
Releaseand thetarget fails on a library built in any other configuration.
while autotools recorded it. Passed behind a
gen-sbom --helpprobe, mirroringscripts/sbom.am, so an older gen-sbom still emits a valid SBOM.lib, soa Windows DLL is found where CMake actually routes it.
AGENTS.mdrewrite and theAI/build guides that had accumulatedon this branch. They were unrelated to SBOM and the build documentation they
added duplicated README. This PR now has zero deletions.
Verified
autogen.sh,configure,make,make sbomall exit 0;pyspdxtoolsvalidates the SPDX;PackageLicenseDeclared: GPL-3.0-or-later;feature macros captured from
wolfmqtt/options.h; wolfSSL recorded at 5.9.2.above was reproduced before the fix and confirmed resolved after.
--dep-wolfsslfrom--help; it degrades to a valid SBOM without thedependency instead of failing.
and fails on one built without the dependency.