Skip to content

Tools/build/generate_sbom.py fails if expat and _decimal/libmpdec/** are configured to come from the system #115663

Closed
@befeleme

Description

@befeleme

Bug report

Bug description:

I try to build Python 3.13.0a4 for Fedora Linux, but unsuccessfully.
expat and _decimal/libmpdec are removed from our version of Python. We configure it with the options --with-system-expat and --with-system-libmpdec.

The traceback:

$ python3.13 /builddir/build/BUILD/Python-3.13.0a4/Tools/build/generate_sbom.py
fatal: no path specified
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.13.0a4/Tools/build/generate_sbom.py", line 228, in <module>
    main()
    ~~~~^^
  File "/builddir/build/BUILD/Python-3.13.0a4/Tools/build/generate_sbom.py", line 190, in main
    paths = filter_gitignored_paths(paths)
            ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/builddir/build/BUILD/Python-3.13.0a4/Tools/build/generate_sbom.py", line 121, in filter_gitignored_paths
    assert git_check_ignore_proc.returncode in (0, 1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
make: *** [Makefile:2885: regen-sbom] Error 1

paths for the removed Modules resolves to an empty list, this is passed to the subprocess invoking git which ends with return code 128, hence assertion error visible above.

generate_sbom, if really has to be a part of regen all, should not require the presence of those libraries if Python is configured without them.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions