When i attempt to apply patches in a derivation for a Python package with format = "wheel"
, i get errors like (patching setup.py
here)
applying patch /nix/store/3hkj6z218mphk7ai4vgccwp98zwczami-001-extras-require.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/setup.py b/setup.py
|index dece7a0..41b3b3f 100755
|--- a/setup.py
|+++ b/setup.py
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
If i take a look in the temporary build directory for the derivation, it contains only the *.whl
and a env-vars
file, e.g.,
$ tree
.
├── dist
│ └── sacrebleu-1.4.6-py3-none-any.whl
└── env-vars
so it makes sense that the patch couldn’t be applied. Do wheels in principle disallow patching? It’d make sense given that it’s a binary package format, but i’m reading that wheels get extracted at some point so is there maybe a later stage where patches can be applied?