go has some pretty aggressive, immutable build caching that really helps speed up builds. I could be wrong, but this seems to be largely ignored, since we export GOCACHE=$TMPDIR/go-cache
. this is an understandable pragmatic decision, since the cache MUST be writable and should not really be part of the output.
that said, it would be quite cool to be able to hoist these entries into /nix/store
as part of some go cache abstraction that can be picked up by the likes of buildGoXxx
. there are some massive missing implementation details for sure, but I could conceive of making them intermediate derivations like source
, that way they are not fetched automatically, get garbage collected after time has passed, but still get shared between go module builds.
has this been attempted for any other languages, is there context I am missing, anything else?