Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
befeleme opened this issue Feb 19, 2024 · 4 comments
Assignees
Labels
3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@befeleme
Copy link
Contributor

befeleme commented Feb 19, 2024

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

@befeleme befeleme added the type-bug An unexpected behavior, bug, or error label Feb 19, 2024
@hugovk
Copy link
Member

hugovk commented Feb 19, 2024

cc @sethmlarson

@hugovk hugovk added the 3.13 bugs and security fixes label Feb 19, 2024
@sethmlarson sethmlarson self-assigned this Feb 19, 2024
@hroncok
Copy link
Contributor

hroncok commented Feb 19, 2024

For the record, we do:

# Remove bundled libraries to ensure that we're using the system copy.
rm -r Modules/expat
rm -r Modules/_decimal/libmpdec

Which is likely the reason for this to fail.

befeleme added a commit to fedora-python/cpython that referenced this issue Feb 22, 2024
The script and make target, modified in Python 3.13.0a4,
assumes the presence of expat and _decimal/libmpdec libraries, resulting in an
error and failed build when not found.
Reported upstream: python#115663
sethmlarson added a commit to sethmlarson/cpython that referenced this issue Feb 22, 2024
…et (pythonGH-115790)

(cherry picked from commit c6a47de)

Co-authored-by: Seth Michael Larson <[email protected]>
@hugovk
Copy link
Member

hugovk commented Feb 24, 2024

Merged and backported to 3.12! Anything left to do here?

@hroncok
Copy link
Contributor

hroncok commented Feb 24, 2024

I think we are good. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants