-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
TMPDIR handling by nix-shell #395
Comments
Thanks. Can you please show |
Here we go:
|
Anyway, it's better we do |
Apparently on your system I guess we could try to detect whether XDG_RUNTIME_DIR is broken... The reason for not using |
@edolstra IMO, nix-shell's $TMPDIR should be cleared when the shell exists. Some builders use |
Just want to share my story. The company I work for is doing quite some stuff in the |
Ran into this today. nix-shell and nix-build shouldn't be setting TMPDIR to /run. Any process which expects to be able to create large files in a mktemp -d is going to have a bad day if they're run in a nix-build or a nix-shell. |
I was just bit by this as well. /tmp is, well, for temporary files. Why not use it? |
On most modern systems, /tmp is also a tmpfs so it doesn't really matter whether we use /tmp or /run. |
I wanted to be snarky and say, "Is NixOS 17.09 not sufficiently modern?" :) But I've found the boot.tmpOnTmpfs option and I'll try it out. I suspect in my case, a more directed solution would be to (a) make cabal clean up after itself during large sandbox installs as it goes along, and (b) make sure its error messages point more directly to the root problem (i.e. being out of disk space) when a problem occurs. I don't think this solves @ledettwy's problem, however. |
@ledettwy have you found a workaround? @brodul's workaround with I'm trying to run a CI build with Nix and
|
@fkorotkov |
@ledettwy tried it and seems it's passing it to the environment but
I'm on Darwin BTW and I'm trying to run |
I've pin pointed the issue. In my case the problem is with
As you can see
|
@fkorotkov In case this is not obsolete already: don't pass -t at all or do |
I marked this as stale due to inactivity. → More info |
I think the confusing part here is that it fallbacks to One of the users argued that this is by design due to this location having the purpose of just storing lock files and other runtime related stuff that essentially doesn't occupy any significant space. If this is the case it feels bad to fallback to using this directory. |
I marked this as stale due to inactivity. → More info |
+1; this problem is exacerbated on WSL2 where the |
No. They are indeed different. Here's some quotes from XDG spec:
I also encountered multiple people complaining about ENOSPC when build inside |
I recently ran into this issue when using Nix on GitHub Actions. We were running out of space when running After some investigation, I realized that It took me a long time to find this. I don't know what the right answer is here, but it was quite unexpected. |
Set `TMPDIR` if not already set to workaround potential disk space issues while running builds in a nix shell. See NixOS/nix#395 for more info. fixes cachix#197
+1, we're still hitting ENOSPC because of this. The choice of |
FWIW, on my NixOS 23.05, there is not only a space limit, but a relatively tight inode limit too:
This is easily exhausted even when not using a bunch of space, by tools that make a lot of tempfiles like NPM. |
Hi,
Lethalman in #nixos has asked me to report this. I've had trouble with building a Haskell Yesod project using a nix-shell on Ubuntu 14.04. I get a GHC panic error when building with:
But not when building with
nix-build
. My setup is the standard code that you get fromyesod init
along with the followingdefault.nix
:It seems to come down to my normal shell not having TMPDIR set (I'm not sure why) so when I use
nix-shell --pure
it is picking up theXDG_RUNTIME_DIR=/run/user/1000/
and using that as the TMP directory. Lethalman pointed to this line.That directory was then potentially upsetting GHC as it didn't have the correct permissions or something. I'm unfortunately new to nix & haskell so I am reporting what others have told me. Happy to help where I can though.
Cheers,
Michael
The text was updated successfully, but these errors were encountered: