Conversation
3185d3c to
cfb6253
Compare
|
This is so beautiful. I am not sure if we need all of those options, but relative is just amazing. |
|
Do we have a way to test if this invalidates any other hashes in nixpkgs? (Although I assume a test like that would give us false positives because of unstable sources …) |
Look at the source while assuming |
|
I just randomly invalidated a random hash. something called Got this: |
cfb6253 to
6ff03ad
Compare
🤦 Fixed now. |
maralorn
left a comment
There was a problem hiding this comment.
I have invalidated a 6 interesting looking hashes for different fetchpatches all over nixpkgs, with and without stripLen. They all seemed fine.
I think this change is really nice. But because this is a rather central piece of infrastructure I would prefer to have another pair of eyes on this.
roberth
left a comment
There was a problem hiding this comment.
Please add tests in tests.fetchpatch aka pkgs/build-support/fetchpatch/tests.nix.
Testing fixed-output derivations is tricky without invalidateFetcherByDrvHash, because successes are cached, so we really need those test cases.
|
I'd drop |
Allows restricting patches to a specific subdirectory, à la `git diff --relative=subdir`. This cannot be done (cleanly) currently because the `includes` logic happens *after* `stripLen` is applied, so we can't match on `subdir/*`. This change adds a `relative` argument that makes this possible by filtering files before doing any processing, and setting `stripLen` and `extraPrefix` accordingly.
a363192 to
9aced64
Compare
Agreed, dropped it. I also realised there's no good reason to disallow using
Added a simple |
|
@ofborg build tests.fetchpatch |
|
Hm, it looks like you drop a few |
|
What do you mean? The only restriction on |
|
I look at the package changes. It looks like the goal was to move from |
|
Oh, yes, I looked at each patch carefully. The only one whose |
We can drop `includes` since there's only one file in that directory.
We can drop `includes` since there's only one file in that directory.
The `gcc-12-prereq.patch` patch now includes the entire `CGAL_Core` subdirectory, but the patch only fixes warnings so this is fine.
We can drop `includes` since there's only one file in that directory.
9aced64 to
a6bc988
Compare
preIncludes and relativerelative
Allows restricting patches to a specific subdirectory, à la
git diff --relative=subdir.This cannot be done (cleanly) currently because the
includeslogic happens afterstripLenis applied, so we can't match onsubdir/*. This change adds apreIncludesargument to make this possible, as well as arelativemeta-argument that takes the name of a subdirectory and setspreIncludes,stripLenandextraPrefixaccordingly.(I turned
meta.brokeninto assertions as it seems cleaner (#43538 (review)).)As a proof of concept, I changed every instance of
fetchpatch { stripLen > 0; includes = [ ... ]; }in nixpkgs (checked by adding abuiltins.traceand evaluating everything) to userelativeinstead. This changes some hashes because (besides the conversion to SRI) previously people would usestripLento transforma/subdir/fileintosubdir/file, while withrelativeyou geta/fileinstead.There might be more applications in the haskell-updates branch, and in fact the whole motivation for this was #165014 (comment).
Example