aleeusgr / nix-things

a toolbox
1 stars 0 forks source link

Protect from garbage collector #5

Closed aleeusgr closed 1 year ago

aleeusgr commented 1 year ago

https://input-output-hk.github.io/haskell.nix/troubleshooting.html

How do I prevent the evaluation-time dependencies of my project from being garbage-collected? The haskell-nix.roots "ghc884" should include all the evaluation-time dependencies and the main build time dependencies of a project using ghc 8.8.4. So you can add that to the relevant GC root. In practice, if you're using a CI system like Hydra/Hercules, this means adding it to a job in release.nix/ci.nix.

aleeusgr commented 1 year ago

https://nixos.org/guides/nix-pills/garbage-collector.html#idm140737320050320

Programming languages with a garbage collector have an important concept in order to keep track of live objects: GC roots. A GC root is an object that is always alive (unless explicitly removed as GC root). All objects recursively referred to by a GC root are live.

aleeusgr commented 1 year ago

https://github.com/symphorien/nix-du

aleeusgr commented 1 year ago

https://nixos.org/manual/nix/unstable/package-management/garbage-collection.html