fix: update SRI hashes for fetchpatch2 FODs #157
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.
Description of changes
I failed to build
uefi-firmware
because some of these hashes were wrong. It's possible that GitHub changed the patch content slightly.fetchpatch
(vs.fetchpatch2
) can avoid instability in certaingit
portions of the patch file (index
,diff --git
, etc.) but unfortunatelyfetchpatch
does not support file renames so patches like https://github.com/tianocore/edk2/commit/ea6d859b50b692577c4ccbeac0fb8686fad83a6e.patch (in https://github.com/johnrichardrinehart/jetpack-nixos/blob/5acff7ab88f0fa7a511a107f55ebf219ab3e661e/pkgs/uefi-firmware/edk2-openssl-patches.nix#L31) will silently skip the rename (i.e. the source won't have the expected file that may later need to be patched which would cause subsequent patches to fail with a "file not found" kind of error). Since these patches do contain renames which later patches expect were applied a switch to usingfetchpatch
for all patches would, unfortunately, not work. It would be possible to change only some patches to usefetchpatch
to increase robustness. But, it's simpler to only fix those patches whose hash has changed.Worth noting is that GitHub supports a URL query parameter called
full_index
which acts like--full-index
forgit diff
. I'm not sure about othergit
interfaces (cgit
,GitLab
,BitBucket
, etc.). If it would be preferable to change all URLs to take advantage of this undocumented feature of GitHub's API then I'm happy to make that change.