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

SBOM generator should not look for a pip wheel in a fixed location #114244

Closed
befeleme opened this issue Jan 18, 2024 · 4 comments · Fixed by #114450
Closed

SBOM generator should not look for a pip wheel in a fixed location #114244

befeleme opened this issue Jan 18, 2024 · 4 comments · Fixed by #114450
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@befeleme
Copy link
Contributor

befeleme commented Jan 18, 2024

Bug report

Bug description:

In Fedora Linux, when building Python RPM, we remove the bundled pip wheel. We use an RPM build available in the system instead.
In the past, a new option was added to Python to define a custom location for that wheel: --with-wheel-pkg-dir (#87022).
generate_sbom.py doesn't count with this possibility, it looks for pip in a hardcoded location and errors if not found.

Even if there was an option to skip the search for pip wheel, would it mean that sbom.spdx.json is shipped in the built Python with incorrect data?

Also, please note that pip bundles a lot of other libraries and the actual project license, if was to reflect that reality, would be tad more complicated, see: Fedora's pip license tag. In https://github.com/python/cpython/blob/main/Misc/sbom.spdx.json#L1719 there's declared MIT only.

(Additionally, we also use the system expat and _decimal/libmpdec libraries instead of the Python copies, which are hardcoded the same way in the script, so there surely will be more issues with the generated metadata if we were trying to create SBOM as downstream repackagers)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

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

hugovk commented Jan 18, 2024

cc @sethmlarson

@sethmlarson
Copy link
Contributor

Thanks for opening this @befeleme!

I created #114250 to address the licensing expression issue for pip wrt bundled dependencies, please take a look at my proposal there.

I wanted to ask how you were intending to use the SBOM being generated (if at all!) or if the issues you're seeing here are more incidental due to being included in make regen-all. Currently the SBOM itself and tooling around it is being built with the artifacts hosted on python.org/downloads in mind but if it can be useful for others then I would like to learn more :)

@hroncok
Copy link
Contributor

hroncok commented Jan 18, 2024

Technically speaking, if we (Fedora) were to ship the SBOM to our users (which I belive we are not doing unless it's installed by default), we would want pip to be skipped, because it's not part of our Python package, but it's only required. The version available at Python build time might not be the same version that's going to be used, as we update the pip wheel independently.

@befeleme
Copy link
Contributor Author

If regen-sbom was to be a part of regen-all, we'd probably appreciate most a possibility to configure which packages should/not be taken into account when generating the file.

befeleme added a commit to befeleme/cpython that referenced this issue Jan 19, 2024
The script and make target, added in Python 3.13.0a3, assumes a fixed
location of pip wheel and other bundled libraries, resulting in an
error and failed build when not found.
Reported upstream: python#114240
and python#114244
befeleme added a commit to fedora-python/cpython that referenced this issue Jan 19, 2024
The script and make target, added in Python 3.13.0a3, assumes a fixed
location of pip wheel and other bundled libraries, resulting in an
error and failed build when not found.
Reported upstream: python#114240
and python#114244
hrnciar added a commit to fedora-python/cpython that referenced this issue Feb 8, 2024
The script and make target, added in Python 3.12.2, assumes a fixed
location of pip wheel and other bundled libraries, resulting in an
error and failed build when not found.
Reported upstream: python#114240
and python#114244

Co-Authored-By: Tomáš Hrnčiar <[email protected]>
hrnciar added a commit to fedora-python/cpython that referenced this issue Apr 10, 2024
The script and make target, added in Python 3.12.2, assumes a fixed
location of pip wheel and other bundled libraries, resulting in an
error and failed build when not found.
Reported upstream: python#114240
and python#114244

Co-Authored-By: Tomáš Hrnčiar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants