Skip to content

gh-113246: Updated bundled pip to 23.3.2 #113249

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

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Conversation

sbidoul
Copy link
Contributor

@sbidoul sbidoul commented Dec 18, 2023

@sbidoul
Copy link
Contributor Author

sbidoul commented Dec 18, 2023

I'm not sure if the failing check is related or not.

@hugovk
Copy link
Member

hugovk commented Dec 18, 2023

Please could you also update the pip version number here?

include=["Lib/ensurepip/_bundled/pip-23.3.1-py3-none-any.whl"]

And then run make regen-sbom and commit the updated Misc/sbom.spdx.json.

This is brand new tooling to generate a software bill-of-materials (SBOM), and this PR may be the first test of updating it :) Tracking issue: #112302.

cc @sethmlarson

@hugovk
Copy link
Member

hugovk commented Dec 18, 2023

We'll get this documented: python/devguide#1241

In the meantime, if you're on macOS or Linux and get this:

make regen-sbom
make: *** No rule to make target `regen-sbom'.  Stop.

Run ./configure first (https://devguide.python.org/).

If you're on Windows, run python Tools/build/generate_sbom.py

@sbidoul sbidoul force-pushed the pip-23.3.2-sbi branch 2 times, most recently from 58f8479 to 2ce1d53 Compare December 18, 2023 09:58
@sbidoul sbidoul requested a review from sethmlarson as a code owner December 18, 2023 09:58
@pfmoore
Copy link
Member

pfmoore commented Dec 18, 2023

Please could you also update the pip version number here?

I would suggest updating it to say

include=["Lib/ensurepip/_bundled/pip-*-py3-none-any.whl"]

(assuming that works). I don't want us to have to manually update this every pip release - it's just another manual task that could trip people up.

@pfmoore pfmoore enabled auto-merge (squash) December 18, 2023 10:08
@pfmoore pfmoore merged commit 4a24bf9 into python:main Dec 18, 2023
@sbidoul sbidoul deleted the pip-23.3.2-sbi branch December 18, 2023 10:25
@pfmoore pfmoore added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Dec 18, 2023
@miss-islington-app
Copy link

Thanks @sbidoul for the PR, and @pfmoore for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @sbidoul for the PR, and @pfmoore for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@pfmoore
Copy link
Member

pfmoore commented Dec 18, 2023

@sbidoul I've triggered the backport PRs, but they'll probably need fixing for the SBOM stuff. Is that something you can do?

@miss-islington-app
Copy link

Sorry, @sbidoul and @pfmoore, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 4a24bf9a13a7cf055113c04bde0874186722c62c 3.12

@miss-islington-app
Copy link

Sorry, @sbidoul and @pfmoore, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 4a24bf9a13a7cf055113c04bde0874186722c62c 3.11

sbidoul added a commit to sbidoul/cpython that referenced this pull request Dec 18, 2023
Updated bundled pip to 23.3.2

(cherry picked from commit 4a24bf9)
sbidoul added a commit to sbidoul/cpython that referenced this pull request Dec 18, 2023
Updated bundled pip to 23.3.2.
(cherry picked from commit 4a24bf9)

Co-authored-by: Stéphane Bidoul <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 18, 2023

GH-113253 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Dec 18, 2023
@bedevere-app
Copy link

bedevere-app bot commented Dec 18, 2023

GH-113254 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 18, 2023
sbidoul added a commit to sbidoul/cpython that referenced this pull request Dec 18, 2023
Updated bundled pip to 23.3.2

(cherry picked from commit 4a24bf9)
sbidoul added a commit to sbidoul/cpython that referenced this pull request Dec 18, 2023
Updated bundled pip to 23.3.2.
(cherry picked from commit 4a24bf9)

Co-authored-by: Stéphane Bidoul <[email protected]>
sbidoul added a commit to sbidoul/cpython that referenced this pull request Dec 18, 2023
Updated bundled pip to 23.3.2.
(cherry picked from commit 4a24bf9)

Co-authored-by: Stéphane Bidoul <[email protected]>
pfmoore pushed a commit that referenced this pull request Dec 18, 2023
* [3.12] gh-113246: Updated bundled pip to 23.3.2 (gh-113249)

Updated bundled pip to 23.3.2.
(cherry picked from commit 4a24bf9)

Co-authored-by: Stéphane Bidoul <[email protected]>
sbidoul added a commit to sbidoul/cpython that referenced this pull request Dec 18, 2023
Updated bundled pip to 23.3.2.
(cherry picked from commit 4a24bf9)

Co-authored-by: Stéphane Bidoul <[email protected]>
pfmoore pushed a commit that referenced this pull request Dec 18, 2023
Updated bundled pip to 23.3.2.
(cherry picked from commit 4a24bf9)
@sethmlarson
Copy link
Contributor

Apologies for putting in a roadblock without the full documentation in place, I've submitted this PR to the devguide to remedy that situation.

So this PR unfortunately has left the SBOM in an invalid state, pip has been upgraded to 23.2.2 but the SBOM still lists versionInfo: 23.2.1. The change to use * would only propagate that invalid state to future upgrades as well since CI no longer fails when an update is made.

Luckily pip (unlike most vendored dependencies) is a part of a packaging ecosystem so is easier to get the version information automatically. I've created this issue to work on automating more of this process where possible.

Happy to answer any questions about the SBOM work, this is one of the challenges of trying to add security features while minimizing the impact to core developers work so I'm looking to learn more from you all as well on what would work best.

@pfmoore
Copy link
Member

pfmoore commented Dec 18, 2023

Thanks - sorry for merging without your input, as I said I assumed automerge would wait for any requested reviewers. My bad.

Ideally, I'd hope that ultimately adding a new release of pip would mean simply updating the ensurepip __init__.py and dropping the new wheel in, as it did in the past. That was what I'd intended by suggesting using the wildcard. Was it the wildcard that made the versionInfo field invalid, or is that a different edit that we didn't know to make?

Hopefully, your ultimate resolution will be to automate all of the SBOM generation from just the wheel filename. The format of a wheel filename is standardised, and you can extract the version from it, so I'd hope that would be possible (even if it needed a small amount of special-case code for ensurepip).

@sethmlarson
Copy link
Contributor

@pfmoore No worries at all! I also didn't know that was a thing so now I've learned as well.

Hopefully, your ultimate resolution will be to automate all of the SBOM generation from just the wheel filename. The format of a wheel filename is standardised, and you can extract the version from it, so I'd hope that would be possible (even if it needed a small amount of special-case code for ensurepip).

This is my vision as well, potentially with an added run of make regen-sbom after dropping in the wheel so the generation can take place. Would that be acceptable as a workflow?

@pfmoore
Copy link
Member

pfmoore commented Dec 18, 2023

Would that be acceptable as a workflow?

Yep, assuming there's a Windows equivalent of that (i.e. something that doesn't rely on make). I'm bound to forget to do it a few times, and I don't know where would be a good place to document it (thinking in terms of where I look when I need to remember the process) but we can sort details like that out.

@hugovk
Copy link
Member

hugovk commented Dec 18, 2023

So this PR unfortunately has left the SBOM in an invalid state, pip has been upgraded to 23.2.2 but the SBOM still lists versionInfo: 23.2.1.

@sethmlarson Would you like this fixed for tomorrow's 3.13a3 release? If so, maybe fix directly, and update automation later if that will take a little longer.

@sethmlarson
Copy link
Contributor

@hugovk I'll submit a PR quickly, thanks for the ping :)

@sethmlarson
Copy link
Contributor

Created #113262 to fix the pip SBOM metadata.

@sethmlarson
Copy link
Contributor

@pfmoore @sbidoul pip SBOM metadata discovery is now automated: #113295

ryan-duve pushed a commit to ryan-duve/cpython that referenced this pull request Dec 26, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants