Skip to content

fix(release): SBOM step conflicts with .[all] extras — install base only#39

Merged
alphacrack merged 1 commit into
mainfrom
chore/fix-sbom-conflict
Jul 22, 2026
Merged

fix(release): SBOM step conflicts with .[all] extras — install base only#39
alphacrack merged 1 commit into
mainfrom
chore/fix-sbom-conflict

Conversation

@alphacrack

Copy link
Copy Markdown
Owner

What

One-line change to .github/workflows/publish-pypi.yml: the SBOM step now runs pip install -e "." instead of pip install -e ".[all]".

Why

The v0.5.0 publish attempt failed at the SBOM step:

ModuleNotFoundError: No module named 'cyclonedx.builder'
  File ".../cyclonedx_py/_internal/utils/cdx.py", line 27
    from cyclonedx.builder.this import this_component as lib_component

Chain of events:

  1. pip install build twine cyclonedx-bom installs cyclonedx-python-lib==11.11.0 (dep of cyclonedx-bom v7).
  2. pip install -e ".[all]" pulls in checkov, which pins cyclonedx-python-lib>=5,<8. pip downgrades the lib to 7.6.2.
  3. cyclonedx-py environment then crashes because cyclonedx.builder was removed between lib 8 and 11.

This has silently broken every release since v0.4.0 (April 2026). Confirmed by re-inspecting run 24622455355 — same fingerprint.

Why this fix over alternatives

  • Reinstall cyclonedx-bom AFTER .[all] — doesn't help: checkov's <8 pin blocks lib>=8, and cyclonedx-bom v7 requires >=8. Hard conflict, not resolver order.
  • Isolated venv for cyclonedx-py — works but adds ~6 lines of orchestration.
  • Install base only ← this PR. SBOM describes what pip install iac-scanner gives an end user; optional extras have their own dep trees. Cleanest.

What lands in the SBOM

Before this PR: + + + +

   _               _

| | ___ | | _______ __
/ _| ' \ / _ / | |/ / _ \ \ / /
| (
| | | | / (| < (
) \ V /
_
|
| ||_|_||____/ _/

By Prisma Cloud | version: 3.2.524
Update available 3.2.524 -> 3.3.8
Run pip3 install -U checkov to update + + (everything from ).

After this PR: + + + (default install). Users who install iac-scanner[rules] etc. get the checkov dep tree in their own env; if they need an SBOM for that superset they should generate it locally.

Verified

Ran the exact CI sequence locally on Python 3.12:

$ pip install build twine 'cyclonedx-bom>=4.0.0'
$ pip install -e "."
$ cyclonedx-py environment --output-format json --output-file /tmp/sbom.cdx.json
$ python -c "import json; d=json.load(open('/tmp/sbom.cdx.json')); print(d['bomFormat'], d['specVersion'], 'components:', len(d['components']))"
CycloneDX 1.6 components: 12

Under the .[all] version this raised ModuleNotFoundError.

Next steps

Once merged, I will:

  1. Delete GitHub Release + tag v0.5.0 (nothing was published anywhere yet — safe).
  2. Re-tag v0.5.0 on the new main tip (now with this fix reachable).
  3. Push tag → release.yml re-creates the Release → I manually dispatch publish-pypi.yml on v0.5.0.
  4. Publish job pauses at release env for @alphacrack approval → PyPI upload + Sigstore + SBOM attached to Release.

Related

  • Blocks v0.5.0 release
  • Explains why v0.4.0 release also failed to attach SBOM

Checklist

  • Change is scoped to one workflow step
  • Local repro of the failure and of the fix
  • DCO sign-off
  • No CHANGELOG entry needed (release infra hotfix, invisible to end users of a shipped release)

Failure fingerprint from run 29865374542:

  ModuleNotFoundError: No module named 'cyclonedx.builder'
    File ".../cyclonedx_py/_internal/utils/cdx.py", line 27
      from cyclonedx.builder.this import this_component as lib_component

Chain of events in the failing job:

  1. Step "pip install build twine cyclonedx-bom" installs
     cyclonedx-python-lib 11.11.0 (dep of cyclonedx-bom v7).
  2. Step "Generate CycloneDX SBOM" runs "pip install -e '.[all]'",
     which pulls in checkov, which pins cyclonedx-python-lib>=5,<8.
     pip *downgrades* the lib to 7.6.2 to satisfy checkov.
  3. cyclonedx-py then imports cyclonedx.builder which was removed
     between lib 8 and 11 — crash.

This bug has silently broken every release since April 2026 (v0.4.0
run 24622455355 fails identically). No SBOM has ever attached to a
GitHub Release for this project.

Fix: generate the SBOM against the base install only. The SBOM
should describe what "pip install iac-scanner" gives an end user;
optional extras (checkov, ollama, mcp) are separate opt-in dep trees.
Base install has zero SBOM/cyclonedx-lib conflicts.

Verified locally with the exact CI sequence: base .[all] downgrade no
longer occurs, cyclonedx-py environment succeeds, produces valid
CycloneDX 1.6 JSON.

Signed-off-by: alphacrack <18480504+alphacrack@users.noreply.github.com>
@github-actions github-actions Bot added area:release release.py, publish-pypi.yml, tag flow, PyPI area:ci .github/workflows, pre-commit, release automation labels Jul 22, 2026
@alphacrack
alphacrack merged commit b8ce1e2 into main Jul 22, 2026
20 checks passed
@alphacrack
alphacrack deleted the chore/fix-sbom-conflict branch July 22, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci .github/workflows, pre-commit, release automation area:release release.py, publish-pypi.yml, tag flow, PyPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant