Add pip-hashes to complement pip-requirements. #10600
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For stronger build integrity, the build tools as downloaded should be verified against hashes that this repo's maintainers also concur are authentic.
Note the "unsafe" qualifier for setuptools is not troublesome [1], but still pinning pip itself could be a problem [2]
Not pinning pip means that container definitions that pip install --upgrade pip -r requiremenst.txt will fail. The base container's pip package should be sufficient to install the edk2 build dependencies.
There are many hashes this tool adds for single release versions because one tool version can get released on many platforms and Python versions.
The tool stores hashes in alphabetical order rather than in a release list order. I have not culled any since there is no "official" development platform to weed out unnecessary hashes. If we decide that only the CI toolchain containers matter, then we should cull after first showing that they can handle --require-hashes in the pip-install step.
[1] jazzband/pip-tools#806 (comment)
[2] pypa/pip#6459
Description
How This Was Tested
I copied in the pip-hashes.txt instead of downloading the "master" pip-requirements in the tianocore ubuntu22 container definition:
This was successful. Note this drops the --upgrade pip added in tianocore/containers@46802aa.
I recommend that any reviewer install
pip-tools
themselves and runTo compare digests to show there is no funny business.
Integration Instructions
As tested.