!VRULIdgoKmKPzJZzjj:nixos.org

Nix Package Manager development

870 Members
For people hacking on Nix: https://github.com/NixOS/nix Nix maintainers can be reached here.182 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
21 Oct 2025
@fzakaria:one.ems.hostfzakariaI started the kaitai spec here: https://github.com/fzakaria/nix-nar-kaitai-spec/tree/main tested directories and regular files so far. There is a test program that is mostly AI generated i need to fix05:08:27
@fzakaria:one.ems.hostfzakariahttps://github.com/fzakaria/nix-nar-kaitai-spec/blob/main/NAR.ksy05:08:55
@raboof:matrix.orgraboof no, --outputs will list all outputs of the derivation. --tree and --graph(ml) are basically recursive versions of --references which shows the inputs (but only shows 'derivation X depends on derivation Y', not 'derivation X depends on output Z of derivation Y') 11:13:45
@juliankuners:matrix.orgJulian

Hey there,

I am currently investigating nix assertion errors that consistently appear once in a while in our CI. Only MacOS machines are affected by this and the error persists until the nix store is garbage collected. It also only persists on the same user on the machine.

[...]
using cache entry 'fetchToStore:{"fingerprint":"3f0bf132df94785670cb324fbb759e85ff5ad0b6","method":"nar","name":"source","path":"/","store":"/nix/store"}' -> 'null', '/nix/store/72alw9m62226brv4v4m98fqrk31mlp34-source'
store path cache hit for '«github:runtimeverification/k/3f0bf132df94785670cb324fbb759e85ff5ad0b6?narHash=sha256-SYrGoV4PuOWux7d4nYhluWD515%2B9sh0DjAMcEDbREVM%3D»/nix/store/8ck644nfh5mb5dqkzgvqhfbznsk1n4df-source'
custom debug: storePath='72alw9m62226brv4v4m98fqrk31mlp34-source' originalInput.computeStorePath(*state.store)='8ck644nfh5mb5dqkzgvqhfbznsk1n4df-source'
Assertion failed: (!originalInput.getNarHash() || storePath == originalInput.computeStorePath(*state.store)), function copyInputToStore, file ../flake.cc, line 40.

This is the assertion that is violated though the check has since been moved in master. We currently run nix version 2.31.2.

So essentially the two nix store paths differ due to existing and non-existing submodule directories, without their content and also somewhat their parent directory, see:

% diff -qr expected instead | sort
Only in expected/haskell-backend/src/main: native
Only in expected/llvm-backend/src/main: native
Only in expected/web: k-web-theme

Does anybody see what could be wrong here or where to look for bugs in nix? I will probably continue to debug this, but there's a lot going on in nix that I am not aware of yet.

13:29:59
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) Generally flake inputs with submodules should not be cached for this reason (the fetchToStore cache entry from the fingerprint -> store path). Maybe that’s the broken part? 13:53:43
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)does it end up in the cache with submodules enabled and disabled?13:56:32
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)For the same git revision13:56:51
@juliankuners:matrix.orgJulian Sergei Zimmerman (xokdvium): What specifically do you mean with submodules enabled/disabled? And which cache specifically? 13:57:38
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)The fetcher cache.13:58:44
@juliankuners:matrix.orgJulian Sergei Zimmerman (xokdvium): Only the revision with no empty submodule directories is in the fetcher cache fetcher-cache-v4.sqlite. For the build to work, the store path should include empty submodule directories (or atleast for hashes to match). 14:15:12
@juliankuners:matrix.orgJulianSo I guess there must be some code that puts invalid entries into the fetcher cache? And this specifically only happens when the repository contains submodules that are not fetched?14:16:40
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)
In reply to @juliankuners:matrix.org
So I guess there must be some code that puts invalid entries into the fetcher cache? And this specifically only happens when the repository contains submodules that are not fetched?
When submodules are fetched it should not try to use the fetcher cache at all. That’s the issue I think. There’s some logic for it there, but it must have been broken somehow
14:17:59
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)(As in, it should not use the fetchToStore cache entry)14:18:27
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Because submodules are wonky and caching them correctly in a way that the narHash stays the same is hard14:19:20
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)This must have surfaced because fetchToStore caching was broken for a while and only got fixed recently in https://github.com/NixOS/nix/pull/1405014:20:54
@juliankuners:matrix.orgJulian

Hmm, considering all the past CI issues, I think I spotted one point in CI logs where the issue starts happening, as it logs the additional unpacking [...] log that later is not printed anymore. Though I cannot confirm whether this is the only place where the issue starts to appear. This code snippet in CI executes nix flake metadata . --refresh. It runs in a checkout without submodules, and I suppose without the empty git submodule directories.

Do you think this could populate the cache with an invalid entry?

14:24:42
@juliankuners:matrix.orgJulianThank you for these thoughts and hints. I guess I at least figured out the root cause now with this.14:25:52

Show newer messages


Back to Room ListRoom Version: 6