den icon indicating copy to clipboard operation
den copied to clipboard

why nix downloads any gen inputs on every eval

Open unazikx opened this issue 6 days ago • 2 comments

unpacking 'https://github.com/sini/gen/archive/857e01c2b5830673dc13fdc07a3f77fb5cf62343.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-rules/archive/2e4eb276c4e1bdfc25fbd6d32cbe32da91f49608.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-merge/archive/eb7f36ec5d6fc8a57dad6b6188b9b6fdb4eb49dc.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-types/archive/1c040f101d64b2d835bdce6f318cfafa072c070f.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-identity/archive/86ac6687b6d9917286c685e2d6883625694abe20.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-algebra/archive/5b4b33aa33ac6dfc7be6104e70d0880aba840651.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-prelude/archive/1178b8bce89fd80d3129ed182afd2df9c5236804.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-scope/archive/1e6482fc47ec1978906f189c0a398d2e1b23004d.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-graph/archive/401211ecce77474948fa183a50d7cda92decd272.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-memo/archive/0743eef640aa802650ff19fd7fbd6d1e87cdc38e.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-program/archive/c33847ef3ec0e9c88b285a2e6d5dfc7ed44f8361.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-aspects/archive/62d2f93bada8a5522caa0bb904528a6b2d119931.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-schema/archive/2bf1801c1d275576a96562f9f6f59f5d34a32d3d.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-class/archive/6c3f161e2dd1cd15a6e1ee3a42ad0eb462af123a.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-settings/archive/0e5e82c948ed2402318079283122750478649b77.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-bind/archive/81e9a92a8faf4d3355def60392617ead9c05f803.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-link/archive/92a4f07228f887238b9b3f16ed86a7e03ccc78c6.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-view/archive/c2f7ad5ab45554fdc3da5814d7c990e5986572b1.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-select/archive/29a873cd389afd7a65e265661ac87dfa6cf6e888.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-dispatch/archive/8ad0ffe9b9ac91c336d35cf66ffc3cffb11b7662.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-assemble/archive/f0187fec9c80d4c694f1e6c0721d9436b28fefc8.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-delivery/archive/11131d6029f6956dd51b205ca7093fa4e2d8f7f0.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-inspect/archive/f6a432907b4a5737a3bc38deda8892ea1352bc76.tar.gz' into the Git cache...
unpacking 'https://github.com/sini/gen-product/archive/987b798b532131b4b63587ec96055349456b38b6.tar.gz' into the Git cache...
unpacking 'https://github.com/denful/nix-effects/archive/c3c68a45deb892d028711eeff8b80937e30a90dd.tar.gz' into the Git cache...
unpacking 'https://github.com/nix-community/nur/archive/ab24c8428c5754ba696b8685929a4ef79ed89943.tar.gz' into the Git cache...

in tack i have only den and import-tree

unazikx avatar Nov 30 '26 08:11 unazikx

Thanks for the report. It isn't a full re-download on every eval. On upstream Nix (and Determinate with lazy-trees on), builtins.fetchTarball with a hash doesn't register the fetched path in the store when it's only imported, so once Nix's tarball cache expires (tarball-ttl, an hour by default) each eval re-checks those URLs. They come back "not modified", so it costs a couple of seconds of round trips, but Nix still prints "unpacking". Lix, and Determinate with lazy-trees off, don't do this.

nur isn't fetched by den or gen; that line comes from your own config hitting the same behaviour. A github: flake input for NUR avoids it.

Until there's a fix, adding gen and nix-effects as flake inputs at den's pinned revisions avoids it. den uses them from your inputs when they're there:

inputs = {
  gen.url = "github:sini/gen/857e01c2b5830673dc13fdc07a3f77fb5cf62343";
  gen.inputs.nixpkgs.follows = "nixpkgs";
  gen.inputs.import-tree.follows = "import-tree";
  nix-effects.url = "github:denful/nix-effects/c3c68a45deb892d028711eeff8b80937e30a90dd";
};

These revisions are the ones den's current main pins. Keep them in step with your den revision, because den runs on whatever gen you pass it. This only helps flake configs, and assumes your inputs reach den's modules (e.g. through specialArgs, as the templates do).

I'm looking at changing how den and gen fetch these so it isn't needed.

sini avatar Dec 03 '26 04:12 sini

Looks like a nix bug https://github.com/NixOS/nix/pull/16639

qweered avatar Dec 03 '26 13:12 qweered