trofi / nix-guix-gentoo

Gentoo overlay for nix and guix functional package managers.
110 stars 9 forks source link

nix-collect-garbage fails because of "keep" file in temproots #6

Closed pmiddend closed 4 years ago

pmiddend commented 4 years ago

nix-collect-garbage reads all files from /nix/var/nix/temproots and interprets the file names as process IDs. The ebuild calls keepdir on this directory, leading to a .keep_sys-apps_nix-0 residing there. Naively, nix-collect-garbage calls stoi to convert this to an integer and...fails. Is there a way to keep the directory without creating this file? Otherweise, well, one might patch Nix to ignore hidden files, maybe.

pmiddend commented 4 years ago

I went in and created a patch for Nix, see https://github.com/NixOS/nix/pull/3482. Should be fixed in the next version.

trofi commented 4 years ago

Ah, cool! I was wondering why stoi() crashes in such an obscure way but never got to debbug it. Thank you!

I'll pull it in latest ebuild as well.