Skip to content

cdxgen: new port, version 13.1.0 - #34520

Open
jrjsmrtn wants to merge 2 commits into
macports:masterfrom
jrjsmrtn:add-cdxgen-port
Open

cdxgen: new port, version 13.1.0#34520
jrjsmrtn wants to merge 2 commits into
macports:masterfrom
jrjsmrtn:add-cdxgen-port

Conversation

@jrjsmrtn

@jrjsmrtn jrjsmrtn commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Description

New port: cdxgen, which generates CycloneDX bills of materials from manifests and
lockfiles.

Related to #34515: the +obom variant needs port:osquery, and only the update in that
PR is installable. The default variant has no such dependency, so this can merge either
way — only +obom is affected.

Only obom uses osquery, hence a variant rather than a dependency of every SBOM; it also
wraps the cdxgen and obom launchers so OSQUERY_CMD defaults to the port, since
cdxgen otherwise downloads its own binary at run time. package.json requires node 24,
which path:bin/node does not guarantee, so a pre-fetch check reports an older one.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 26.6.2 25G83 arm64
Xcode 26.6 17F113

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • checked your Portfile with port lint?
  • tried a full install with sudo port -vs install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

Both variants tested: default gave a 334-component SBOM, +obom a 3227-component
operations BOM. Trace mode is unavailable on arm64, so -vs rather than -vst.

Only obom uses osquery, so it is a +obom variant rather than a
dependency of every SBOM.

package.json requires node 24, which the npm PortGroup's path:bin/node
dependency does not guarantee; a pre-fetch check reports an older one.
npm.version 11 to match, since npm10 pulls the conflicting nodejs22.
cdxgen's macOS profile queries homebrew_packages but has no MacPorts
equivalent, so an OBOM on a MacPorts system lists applications, launch
agents and installer receipts while every installed port is invisible.

The query needs a macports_packages table, which osquery does not ship
(osquery/osquery#9074 proposes one); until then an Automatic Table
Construction config over the registry supplies it. Where neither is
present cdxgen skips the query silently, since executeOsQuery suppresses
"no such table".

Applied in post-destroot rather than through patchfiles: the npm
PortGroup installs the package during destroot, so worksrcpath is empty
when the patch phase runs and patchfiles has nothing to act on. The block
errors out if the query profile is not where it is expected, rather than
producing a port that quietly lacks the query.

Measured on an Intel Mac with the ATC table configured: the OBOM went
from 2503 to 3011 components, the 508 extra rows being the installed
ports.

@barracuda156 barracuda156 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please at least review what you submit. Formatting is broken.

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

Development

Successfully merging this pull request may close these issues.

3 participants