devshell icon indicating copy to clipboard operation
devshell copied to clipboard

Strange issue on a Mac

Open johnae opened this issue 3 years ago • 5 comments

I'm testing this on a Mac (nix flakes enabled), and I'm getting this output:

% nix develop
mktemp: illegal option -- -
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
### 🔨 Welcome to devshell ####
[commands]
devshell-menu - print this menu
devshell-root - change directory to root
[devshell]$ 

I've been unable to find any mention of mktemp in this repo, however it seems to be related to mkDevShell since I can use mkShell from nixpkgs without ever seeing the above output. On NixOS everything is fine.

johnae avatar Sep 10 '20 16:09 johnae

Also, the error above doesn't seem to affect usage as far as I've been able to determine anyway. But it sure doesn't look good. I'm testing this on MacOS Catalina, latest version 10.15.6.

johnae avatar Sep 10 '20 16:09 johnae

So, clearly something is calling the mktemp that comes with MacOS. Could even be somewhere in nixpkgs. By doing this:

nix profile install nixpkgs#mktemp

I no longer have this problem. Would be interesting to find where this happens since I believe it should call the mktemp from nixpkgs.

johnae avatar Sep 10 '20 20:09 johnae

I'm seeing the same issue on macOS 1.15.5 - nix (Nix) 3.0pre20200804_ed52cf6

cem2ran avatar Sep 24 '20 21:09 cem2ran

This is an issue with Nix. nix develop is calling mktemp before entering the environment:

https://github.com/NixOS/nix/blob/13e49be6602314fe5e5d7beb8a807d5d892e864e/src/nix/develop.cc#L198

zimbatm avatar Oct 11 '20 13:10 zimbatm

It looks like this was fixed upstream: https://github.com/NixOS/nix/pull/4491

mistydemeo avatar Apr 20 '23 16:04 mistydemeo