nixpkgs/pkgs/stdenv
Ivan Trubach bd872b4a77 stdenv: fix unbound NIX_LOG_FD in nix develop
When running `nix develop` for a package, Nix records the stdenv
environment with NIX_LOG_FD set. That is, when the actual development
shell runs, it uses the functions that attempt to log to NIX_LOG_FD, but
this variable is not actually set.

As a workaround, check whether NIX_LOG_FD is set at runtime.

Example (before this change):
```console
$ nix develop --file . bash
$ echo "${NIX_LOG_FD-unset}"
unset
$ runPhase unpackPhase
bash: "$NIX_LOG_FD": Bad file descriptor
Running phase: unpackPhase
unpacking source archive /nix/store/v28dv6l0qk3j382kp40bksa1v6h7dx9p-bash-5.2.tar.gz
bash: "$NIX_LOG_FD": Bad file descriptor
source root is bash-5.2
bash: "$NIX_LOG_FD": Bad file descriptor
setting SOURCE_DATE_EPOCH to timestamp 1663942708 of file bash-5.2/y.tab.h
```

After this change:
```console
$ nix develop --file . bash
$ runPhase unpackPhase
Running phase: unpackPhase
unpacking source archive /nix/store/v28dv6l0qk3j382kp40bksa1v6h7dx9p-bash-5.2.tar.gz
source root is bash-5.2
setting SOURCE_DATE_EPOCH to timestamp 1663942708 of file bash-5.2/y.tab.h
```
2024-07-29 13:08:17 +03:00
..
cross Revert #320852: Clean up cross bootstrapping 2024-06-21 07:48:24 +02:00
custom
cygwin
darwin darwin.stdenv: remove darwin.ICU from the final overlay 2024-07-22 20:54:22 -04:00
freebsd [squashme] finish rename 2024-07-20 16:40:02 -07:00
generic stdenv: fix unbound NIX_LOG_FD in nix develop 2024-07-29 13:08:17 +03:00
linux add s390x to make-bootstrap-tools-cross.nix 2024-07-16 20:33:49 +02:00
native stdenv: consistently use self: super: … for bootstrapping overlays 2024-04-15 12:53:13 +02:00
nix
tests
adapters.nix *bsdCross: Remove these package sets 2024-06-21 11:47:36 -04:00
booter.nix
default.nix