-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unexpected rebuilds on contentAddressedByDefault = true;
nix
#5333
Comments
I think it happens because
$ diff -u \
<(nix show-derivation /nix/store/3v4099yr4l20ibz5f9iiivx6apqlf20b-texlive-combined-2021.drv) \
<(nix show-derivation /nix/store/4ypzxm2yd1ncvvd8qr7262v4xzwx87m5-texlive-combined-2021.drv) \
| sed -r 's@/nix/store/[0-9a-z]{32}-@/<<NIX>>/@g'
--- /dev/fd/63 2021-10-05 09:59:57.717183638 +0100
+++ /dev/fd/62 2021-10-05 09:59:57.717183638 +0100
@@ -1,5 +1,5 @@
{
- "/<<NIX>>/texlive-combined-2021.drv": {
+ "/<<NIX>>/texlive-combined-2021.drv": {
"outputs": {
"out": {
"hashAlgo": "r:sha256"
@@ -9,941 +9,941 @@
"/<<NIX>>/default-builder.sh"
],
"inputDrvs": {
- "/<<NIX>>/hyphens.sed.drv": [
+ "/<<NIX>>/texlive-simple-resume-cv-43057.drv": [
"out"
],
- "/<<NIX>>/texlive-attachfile2-2.11.drv": [
+ "/<<NIX>>/texlive-realscripts-0.3d.drv": [
"out"
],
- "/<<NIX>>/texlive-dehyph-48599.drv": [
+ "/<<NIX>>/texlive-ptext-1.1.drv": [
"out"
], I suspect that we currently sort Would it be possible not to reshuffle them? Say, if we would list them in The downside is that it would probably make attribute order unstable WRT seeingly immaterial changes. Currently it's stable:
|
Or even better: re-sort |
So after looking at things a bit more deeply, it’s indeed an ordering problem. Not of postBuild = ''
concatMapStrings (path: ''doSomethingOn ${path}'') (sort (a: b: a < b)) (map (p: p.outPath) inputs)
'' The call to So in a way, this is another instance of #4764 . I wonder now why the call to |
Oh, that's tricky! Looks like I think cheapest fix would be to tweak it to sort by |
In NixOS/nix#5333 I noticed that adding a minor change to `bash` derivation triggers rebuilds in CA for `bash` (expected) and `texlive.combine` (unexpected). regnat debugged derivation instability down to sort on outPath. The change avoid sorting on outPaths and uses pname of the derivations. Tested on `R` derivation. Closes: NixOS/nix#5333
Proposed the change as NixOS/nixpkgs#140619 |
Here is my experiment in
contentAddressedByDefault = true;
:R
packagebash
(core package) in a way that it changes only derivationR
packageExpected result: only
bash
package will get rebuild a few times. The rest will reuse the same CA store.Actual result:
bash
andR
get rebuilt again (and nothing else).Session log in
nixpkgs
checkoutstaging
branch (master
has the same behaviour):Is it expected that
R
gets rebuilt? Or it's a bug?bash patch:
CC @regnat
The text was updated successfully, but these errors were encountered: