--keep-failed of FODs does not retain "bad" store paths #907

Open
opened 2025-07-07 18:04:35 +00:00 by jade · 1 comment
Owner

I was trying to diagnose #904, but it is impossible to diagnose because the bad path does not get retained in the store.

$ nix build --keep-failed -L -f '<nixpkgs>' wrangler
...
error: hash mismatch in fixed-output derivation '/nix/store/jfz5yk8wr39z3fxa82s5xrfk8ih53hi7-wrangler-pnpm-deps.drv':
           likely URL: (unknown)
            specified: sha256-r3QswmqP6CNufnsFM0KeKojm/HjHogrfYO/TdL3SrmA=
                  got: sha256-/+MdmCSOzeA0HW924bH+27qj4KecIjAte3w8LlVythc=
        expected path: /nix/store/fm61042nhj9y91wdbmyiqhvrw76fcfns-wrangler-pnpm-deps
             got path: /nix/store/jsf3ris8hmspp2zm8440786ppx3v5w2m-wrangler-pnpm-deps
note: keeping build directory '/nix/var/nix/builds/nix-build-wrangler-pnpm-deps.drv-0'
error: 1 dependencies of derivation '/nix/store/cp2x11zvj3fijahq8yxxp738yhawk7j6-wrangler-4.22.0.drv' failed to build

... build with a CppNix daemon successfully, producing the "expected" path but not the "got" path ...

~ » ls /nix/store/fm61042nhj9y91wdbmyiqhvrw76fcfns-wrangler-pnpm-deps /nix/store/jsf3ris8hmspp2zm8440786ppx3v5w2m-wrangler-pnpm-deps
ls: cannot access '/nix/store/jsf3ris8hmspp2zm8440786ppx3v5w2m-wrangler-pnpm-deps': No such file or directory
/nix/store/fm61042nhj9y91wdbmyiqhvrw76fcfns-wrangler-pnpm-deps:
v3

This also presumably is jacked if you want to e.g. run a FOD and fix the hash without redownloading it.

I suspect this is related to the security fixes, but it's not security relevant behaviour to retain FOD outputs at their actual hash once they fail to build at their expected hash; this is totally in line with store invariants.

Version: lix-2.94.0-dev-pre20250706-378b360

I was trying to diagnose #904, but it is impossible to diagnose because the bad path does not get retained in the store. ``` $ nix build --keep-failed -L -f '<nixpkgs>' wrangler ... error: hash mismatch in fixed-output derivation '/nix/store/jfz5yk8wr39z3fxa82s5xrfk8ih53hi7-wrangler-pnpm-deps.drv': likely URL: (unknown) specified: sha256-r3QswmqP6CNufnsFM0KeKojm/HjHogrfYO/TdL3SrmA= got: sha256-/+MdmCSOzeA0HW924bH+27qj4KecIjAte3w8LlVythc= expected path: /nix/store/fm61042nhj9y91wdbmyiqhvrw76fcfns-wrangler-pnpm-deps got path: /nix/store/jsf3ris8hmspp2zm8440786ppx3v5w2m-wrangler-pnpm-deps note: keeping build directory '/nix/var/nix/builds/nix-build-wrangler-pnpm-deps.drv-0' error: 1 dependencies of derivation '/nix/store/cp2x11zvj3fijahq8yxxp738yhawk7j6-wrangler-4.22.0.drv' failed to build ``` ... build with a CppNix daemon successfully, producing the "expected" path but not the "got" path ... ``` ~ » ls /nix/store/fm61042nhj9y91wdbmyiqhvrw76fcfns-wrangler-pnpm-deps /nix/store/jsf3ris8hmspp2zm8440786ppx3v5w2m-wrangler-pnpm-deps ls: cannot access '/nix/store/jsf3ris8hmspp2zm8440786ppx3v5w2m-wrangler-pnpm-deps': No such file or directory /nix/store/fm61042nhj9y91wdbmyiqhvrw76fcfns-wrangler-pnpm-deps: v3 ``` This also presumably is jacked if you want to e.g. run a FOD and fix the hash without redownloading it. I suspect this is related to the security fixes, but it's not security relevant behaviour to retain FOD outputs at their actual hash once they fail to build at their expected hash; this is totally in line with store invariants. Version: lix-2.94.0-dev-pre20250706-378b360
Owner

Cannot reproduce on Linux without --keep-failed (not for this particular package, but for a FOD failure I just got on another package.) FWIW.

2.94.0-dev20250707181316-raito-edition

Cannot reproduce on Linux without `--keep-failed` (not for this particular package, but for a FOD failure I just got on another package.) FWIW. `2.94.0-dev20250707181316-raito-edition`
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#907
No description provided.