!VRULIdgoKmKPzJZzjj:nixos.org

Nix Package Manager development

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

Load older messages


SenderMessageTime
1 Jul 2025
@magic_rb:matrix.redalder.orgmagic_rbEven with lazy tree, if im using 40GB, i have to copy 40GB every time no?11:52:15
@magic_rb:matrix.redalder.orgmagic_rbThats how i understood it11:52:25
@roberthensing:matrix.orgRobert Hensing (roberth)

So I guess we have three possible behaviors:

  • deference it completely and return the file contents
  • put it in the store and return store references somehow (more complicated than it seems, but potentially lazy under more circumstances)
  • generate a .git/annex which only has the relevant entries (probably annoying to work with, unless your build makes assumptions about .git/annex)
11:53:59
@roberthensing:matrix.orgRobert Hensing (roberth)Only if you dereference every annexed file11:54:31
@roberthensing:matrix.orgRobert Hensing (roberth)

To make fetching the annexed files lazy involves:

  1. changing fetchTree to not copy everything to the store, returning a path value instead of a store path (or a lazy-trees store path that produces the correct hash part, which has never been done)
  2. implementing the annex support in an "event based" manner - not eagerly fetching everything
11:58:34
@emilazy:matrix.orgemilyif the build of a game requires processing every source asset – which I believe is normal – then this does not stop copying every asset anew for every build, even if lazy trees were fully implemented, right?11:59:20
@emilazy:matrix.orgemily(maybe you can cut down on it if you can split it into one asset build per derivation since the store paths would remain the same if the individual asset doesn't change?)11:59:55
@emilazy:matrix.orgemily(and I guess integration could avoid re-hashing the file to determine that?)12:00:03
@emilazy:matrix.orgemily just checking I understand correctly that if all the assets are needed in the same derivation as part of a src = ./.; type thing it would still amount to copying the entire thing every time 12:00:24
@magic_rb:matrix.redalder.orgmagic_rb Yeah this is what im saying. Say youre building a godot game, you end up with src = ./., you cant do much with uh, whats was it filterTree 12:03:33
@roberthensing:matrix.orgRobert Hensing (roberth)The store references choice does make that easier to achieve. Otherwise, we're looking representations of store objects that don't reside in a real filesystem but in a FUSE store, and an underlying ca-store like tvix/snix. That would be great to have, but it's a lot of work12:03:44
@emilazy:matrix.orgemilyI think the practical solution is just to poke holes in the sandbox to access the underlying content-addressed annex store12:05:47
@emilazy:matrix.orgemilyand rewrite symlinks to point to it before you run your build12:05:56
@roberthensing:matrix.orgRobert Hensing (roberth) Right, so to clarify, if your main goal is to distribute a built game, you should not use builtin fetchers for anything but Nix expressions, because those will be intermediate results, and only in case of FODs it's possible to optimize those away by virtue of the dependent being available and having no reference to the source 12:05:59
@roberthensing:matrix.orgRobert Hensing (roberth)So what we're left with is the "developer" use case12:06:15
@emilazy:matrix.orgemilyit is "reasonably" pure since things are still addressed by hash but it seems to me the only way to get builds involving >40 GiB of assets without years of experimental work on the Nix end12:06:25
@roberthensing:matrix.orgRobert Hensing (roberth)For development, presumably you want a quick build, so making asset processing fine grained with a derivation per asset would be the thing to do12:06:59
@magic_rb:matrix.redalder.orgmagic_rbTo clarify, i dont have an immediate use case for this. It would be nice, but so far i dont have a game id be developing lol12:07:17
@sinan:sinanmohd.comsinan changed their profile picture.12:07:52
@magic_rb:matrix.redalder.orgmagic_rb So this was more something i wanted to look at personally, but it seems i severely underestimated the complexity 12:09:11
@roberthensing:matrix.orgRobert Hensing (roberth)If you're ok with some eagerness for now, the complexity isn't so bad12:09:57
@roberthensing:matrix.orgRobert Hensing (roberth)This one's the easiest to implement, and it can follow the LFS pattern12:10:20
@magic_rb:matrix.redalder.orgmagic_rbHonestly even the eager version would be nice, currently it just leaves a bunch of dangling symlinks12:10:45
@magic_rb:matrix.redalder.orgmagic_rbSo option one, "deference it completely and return the file contents"12:11:07
@roberthensing:matrix.orgRobert Hensing (roberth)yep12:11:16
@roberthensing:matrix.orgRobert Hensing (roberth)That one can follow the structure of the LFS implementation12:11:40
@magic_rb:matrix.redalder.orgmagic_rbCan it be done as a plugin or does it have to be done in tree?12:11:59
@magic_rb:matrix.redalder.orgmagic_rbWhile experimenting a plugin would be much easier12:12:10
@roberthensing:matrix.orgRobert Hensing (roberth)(oh, it quoted the whole message lol)12:12:11
@roberthensing:matrix.orgRobert Hensing (roberth)I don't feel like plugins are easier because I don't think libfetchers plugins have been done, but I could be wrong12:13:00

Show newer messages


Back to Room ListRoom Version: 6