1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-12 13:36:02 +01:00
Nix, the purely functional package manager
Find a file
Eelco Dolstra 6613e7ebfb Move pseudoterminal slave open to child
Hopefully this fixes "unexpected EOF" failures on macOS
(#3137, #3605, #7242, #7702).

The problem appears to be that under some circumstances, macOS
discards the output written to the slave side of the
pseudoterminal. Hence the parent never sees the "sandbox initialized"
message from the child, even though it succeeded. The conditions are:

* The child finishes very quickly. That's why this bug is likely to
  trigger in nix-env tests, since that uses a builtin builder. Adding
  a short sleep before the child exits makes the problem go away.

* The parent has closed its duplicate of the slave file
  descriptor. This shouldn't matter, since the child has a duplicate
  as well, but it does. E.g. moving the close to the bottom of
  startBuilder() makes the problem go away. However, that's not a
  solution because it would make Nix hang if the child dies before
  sending the "sandbox initialized" message.

* The system is under high load. E.g. "make installcheck -j16" makes
  the issue pretty reproducible, while it's very rare under "make
  installcheck -j1".

As a fix/workaround, we now open the pseudoterminal slave in the
child, rather than the parent. This removes the second condition
(i.e. the parent no longer needs to close the slave fd) and I haven't
been able to reproduce the "unexpected EOF" with this.

(cherry picked from commit c536e00c9d)
2025-02-13 11:21:42 -05:00
.github Remove installer and installer_test GHAs for now 2025-02-13 11:11:37 -05:00
config Update config.guess for proper arm64 macOS detection 2020-12-04 12:22:31 +01:00
contrib function-trace: always show the trace 2020-01-05 16:30:32 +01:00
corepkgs nix-channel: Don't fetch binary-cache-url 2019-06-25 13:27:16 +02:00
doc/manual Add release notes 2024-03-01 10:24:54 +01:00
m4 autoconf: Fix C++17 detection not working on Ubuntu 16.04. 2019-07-03 04:32:25 +02:00
maintainers upload-release.pl: add aarch64-darwin 2021-07-02 14:13:26 +02:00
misc Apply OS checks to host platform, not build 2021-07-27 08:41:57 +00:00
mk Close stdin while running tests 2021-11-30 05:33:50 +00:00
perl Apply OS checks to host platform, not build 2021-07-27 08:41:57 +00:00
scripts Create to daemon-socket folder during install 2023-10-26 14:31:46 +02:00
src Move pseudoterminal slave open to child 2025-02-13 11:21:42 -05:00
tests build: backport NIX_ATTRS_*_FILE 2024-12-08 15:45:05 +01:00
.dir-locals.el Add .dir-locals.el for Emacs 2016-01-28 11:12:04 +01:00
.editorconfig Add .editorconfig 2017-06-05 22:57:28 +01:00
.gitignore Treat plain derivation paths in context as normal paths. 2019-01-13 11:29:55 -05:00
.travis.yml Test the installer 2017-07-14 12:11:04 -04:00
.version Bump version 2023-11-03 18:05:47 +01:00
bootstrap.sh bootstrap: Simplify & make more robust. 2011-09-06 12:11:05 +00:00
configure.ac libutil: add ZstdDecompressionSink 2023-10-23 17:36:13 +00:00
COPYING * Change this to LGPL to keep the government happy. 2006-04-25 16:41:06 +00:00
flake.lock Add best-effort flake.nix 2024-01-15 10:40:48 +01:00
flake.nix Add best-effort flake.nix 2024-01-15 10:40:48 +01:00
local.mk Merge all nix-* binaries into nix 2018-10-26 12:54:00 +02:00
Makefile autoconf: Allow overriding CFLAGS/CXXFLAGS from outside. 2019-07-03 04:32:25 +02:00
Makefile.config.in libutil: add ZstdDecompressionSink 2023-10-23 17:36:13 +00:00
nix.spec.in libutil: add ZstdDecompressionSink 2023-10-23 17:36:13 +00:00
README.md README, error msg: http -> https 2020-05-26 11:39:02 +02:00
release-common.nix Address removal of pkgconfig alias 2023-10-31 12:22:36 +02:00
release.nix Add a NixOS test for the sandbox escape 2024-03-01 10:24:54 +01:00
shell.nix Build with large config Boehm GC 2020-02-18 18:02:58 +01:00

Open Collective supporters

Nix, the purely functional package manager

Nix is a new take on package management that is fairly unique. Because of its purity aspects, a lot of issues found in traditional package managers don't appear with Nix.

To find out more about the tool, usage and installation instructions, please read the manual, which is available on the Nix website at https://nixos.org/nix/manual.

Contributing

Take a look at the Hacking Section of the manual. It helps you to get started with building Nix from source.

License

Nix is released under the LGPL v2.1

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit.