Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gc.cc: Ignore hidden files in temproots #3482

Merged
merged 1 commit into from Apr 9, 2020

Conversation

pmiddend
Copy link

@pmiddend pmiddend commented Apr 9, 2020

While trying out Nix on Gentoo, I noticed that nix-collect-garbage failed, outputting simply error: stoi. Investigating a bit, I noticed that in /nix/var/nix/temproots, there was a file called .keep_sys-apps_nix-0, which Nix tried to interpret as a process ID (and failed, of course). Apparently, Gentoo puts such files in directories in order to remember if any package wants this directory there (even if might be currently empty). If the file's not there, Gentoo will delete the directory.

Since creating the temproots directory dynamically seemed a bit "unsafe", I changed the GC code so that hidden files are ignored. I'm not sure myself if that's a good solution, to be honest. But it does improve interoperability with other package managers, apparently.

@edolstra edolstra merged commit f46cb68 into NixOS:master Apr 9, 2020
@edolstra
Copy link
Member

edolstra commented Apr 9, 2020

Thanks!

@Mic92
Copy link
Member

Mic92 commented Apr 13, 2020

Thanks! This also will fix cases where the nix store is stored in a NFS share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants