Skip to content

feat: add make sbom target#557

Open
MarkAtwood wants to merge 3 commits into
wolfSSL:masterfrom
MarkAtwood:feat/add-sbom-make-target
Open

feat: add make sbom target#557
MarkAtwood wants to merge 3 commits into
wolfSSL:masterfrom
MarkAtwood:feat/add-sbom-make-target

Conversation

@MarkAtwood

@MarkAtwood MarkAtwood commented Jun 23, 2026

Copy link
Copy Markdown

Summary

Adds make sbom, make install-sbom, and make uninstall-sbom targets to the autotools build.

  • Stages a temporary install to extract the built .so for hashing
  • Dumps preprocessor defines via cc -dM -E for the options snapshot
  • Calls gen-sbom (from wolfssl scripts/gen-sbom) to produce CycloneDX and SPDX outputs
  • Validates SPDX with pyspdxtools

Usage

```sh
./configure --with-wolfssl=/path/to/wolfssl/install
make
make sbom WOLFSSL_DIR=/path/to/wolfssl/source
```

Outputs: wolfmqtt-<version>.cdx.json, wolfmqtt-<version>.spdx.json, wolfmqtt-<version>.spdx

Requirements

  • WOLFSSL_DIR must point to a wolfssl source tree containing scripts/gen-sbom (available on the feat/sbom-embedded branch of wolfssl)
  • python3 and pip install spdx-tools on the build host

Test plan

  • ./configure --with-wolfssl=... && make && make sbom WOLFSSL_DIR=...
  • Verify three output files are produced
  • pyspdxtools --infile wolfmqtt-*.spdx.json passes validation

CMake support

The same SBOM workflow is available for cmake builds via a sbom custom target.

cmake -B build -DWOLFSSL_DIR=/path/to/wolfssl/source .
cmake --build build
cmake --build build --target sbom

The cmake target mirrors the autotools one:

  • Version is read from wolfmqtt/version.h (not project(VERSION)) so both build systems emit the same version.
  • Stages a cmake --install to hash the installed libwolfmqtt.so.
  • Dumps preprocessor defines via cc -dM -E on the generated options.h.
  • Validates SPDX with pyspdxtools.
  • WOLFSSL_DIR, python3, and pyspdxtools are checked at configure time (fatal error if missing) so problems surface before building.

Outputs (in the build directory): wolfmqtt-<version>.cdx.json, wolfmqtt-<version>.spdx.json, wolfmqtt-<version>.spdx

Add top-level AGENTS.md with project overview, build quick start,
and contribution rules. Detailed platform build guides in AI/ for
Linux/macOS, Windows, and embedded targets.

Update .gitignore to ignore common AI tool local files.
Adds sbom, install-sbom, and uninstall-sbom targets.
Runs gen-sbom to produce CDX and SPDX outputs.
Requires WOLFSSL_DIR pointing to a wolfssl tree with
the feat/sbom-embedded branch (includes gen-sbom).
@MarkAtwood MarkAtwood requested review from Copilot and sameehj June 23, 2026 01:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-sbom targets (staging install, calling gen-sbom, validating SPDX).
  • Extend configure.ac to expose libtool version components and discover SBOM tooling (python3, pyspdxtools, git).
  • Add/update contributor and build documentation under AI/, plus refresh AGENTS.md and 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.

Comment thread Makefile.am
--supplier 'wolfSSL Inc.' \
--license-file $(srcdir)/LICENSE \
--options-h $(abs_builddir)/wolfmqtt/options.h \
--lib $(abs_builddir)/_sbom_staging$(libdir)/libwolfmqtt.so.$(WOLFMQTT_LIBRARY_VERSION_FIRST).$(WOLFMQTT_LIBRARY_VERSION_SECOND).$(WOLFMQTT_LIBRARY_VERSION_THIRD) \
Comment thread configure.ac
Comment on lines +43 to +45
WOLFMQTT_LIBRARY_VERSION_FIRST=19
WOLFMQTT_LIBRARY_VERSION_SECOND=0
WOLFMQTT_LIBRARY_VERSION_THIRD=0
Comment thread Makefile.am
fi
rm -rf $(abs_builddir)/_sbom_staging
$(MAKE) install DESTDIR=$(abs_builddir)/_sbom_staging
$(PYTHON3) $(WOLFSSL_DIR)/scripts/gen-sbom \
Comment thread Makefile.am
--license-file $(srcdir)/LICENSE \
--options-h $(abs_builddir)/wolfmqtt/options.h \
--lib $(abs_builddir)/_sbom_staging$(libdir)/libwolfmqtt.so.$(WOLFMQTT_LIBRARY_VERSION_FIRST).$(WOLFMQTT_LIBRARY_VERSION_SECOND).$(WOLFMQTT_LIBRARY_VERSION_THIRD) \
--git '$(GIT)' \
Comment thread Makefile.am
Comment on lines +108 to +110
$(INSTALL_DATA) $(SBOM_CDX) $(DESTDIR)$(sbomdir)/
$(INSTALL_DATA) $(SBOM_SPDX) $(DESTDIR)$(sbomdir)/
$(INSTALL_DATA) $(SBOM_SPDX_TV) $(DESTDIR)$(sbomdir)/
Comment thread Makefile.am

.PHONY: sbom install-sbom uninstall-sbom

sbom:
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