| 21 Oct 2025 |
Julian | 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 |
Julian | 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? | 14:16:40 |
Sergei 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 |
Sergei Zimmerman (xokdvium) | (As in, it should not use the fetchToStore cache entry) | 14:18:27 |
Sergei Zimmerman (xokdvium) | Because submodules are wonky and caching them correctly in a way that the narHash stays the same is hard | 14:19:20 |
Sergei 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/14050 | 14:20:54 |
Julian | 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 |
Julian | Thank you for these thoughts and hints. I guess I at least figured out the root cause now with this. | 14:25:52 |
Sergei Zimmerman (xokdvium) | In reply to @juliankuners:matrix.org
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?
Hm, a local checkout might do that yeah. The git fetcher might consider it to be cacheable and doesn’t take into account empty subdirs | 14:27:23 |