lix/src/libstore
Eelco Dolstra c536e00c9d 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.
2023-03-15 10:58:37 +01:00
..
build Move pseudoterminal slave open to child 2023-03-15 10:58:37 +01:00
builtins buildenv: throw BuildEnvFileConflictError with more context 2023-02-27 21:39:34 +01:00
tests Derivation::toJSON: fix bug! 2023-02-20 17:38:57 -05:00
binary-cache-store.cc Merge pull request #7203 from graham33/feature/cpp20 2023-02-01 15:41:04 +01:00
binary-cache-store.hh getBuildLog: factor out resolving derivations 2022-12-15 15:58:54 -05:00
build-result.hh Get CPU stats from the cgroup 2022-11-18 13:40:59 +01:00
builtins.hh
ca-specific-schema.sql
content-address.cc
content-address.hh
crypto.cc
crypto.hh
daemon.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
daemon.hh Get rid of the authHook parameter on processConnection 2023-02-02 12:02:03 -05:00
derivations.cc Derivation::toJSON: fix bug! 2023-02-20 17:38:57 -05:00
derivations.hh Move Derivation toJSON logic to libnixstore 2023-02-19 10:06:40 -05:00
derived-path.cc Split OutputsSpec and ExtendedOutputsSpec, use the former more 2023-01-11 18:57:18 -05:00
derived-path.hh More property tests 2023-01-29 17:09:59 -05:00
dummy-store.cc
export-import.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
filetransfer.cc Merge pull request #7942 from edolstra/remove-format 2023-03-03 10:22:11 +01:00
filetransfer.hh Move isUri() and resolveUri() out of filetransfer.cc 2022-12-12 14:05:35 +01:00
fs-accessor.hh
gc-store.hh
gc.cc Make findRuntimeRoots() more resilient to disappearing processes 2023-03-09 16:44:51 +01:00
globals.cc Treat empty env var paths as unset 2023-03-01 20:50:07 +01:00
globals.hh add information on the build-hook setting 2023-02-27 16:27:56 +01:00
http-binary-cache-store.cc NarInfoDiskCache: Rename cacheExists -> upToDateCacheExists 2023-02-07 23:34:36 +01:00
legacy-ssh-store.cc Delete dead code 2023-01-30 11:29:01 -05:00
local-binary-cache-store.cc moveFile -> renameFile 2022-08-03 10:27:25 +02:00
local-fs-store.cc getBuildLog: factor out resolving derivations 2022-12-15 15:58:54 -05:00
local-fs-store.hh getBuildLog: factor out resolving derivations 2022-12-15 15:58:54 -05:00
local-store.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
local-store.hh Move the default profiles to the user’s home 2023-01-17 14:17:28 +01:00
local.mk Include macOS sandbox files in the Nix binary 2023-01-04 04:36:07 -08:00
lock.cc On macOS with auto-uid-allocation and sandboxing, use the correct gid 2023-01-05 04:58:55 -08:00
lock.hh On macOS with auto-uid-allocation and sandboxing, use the correct gid 2023-01-05 04:58:55 -08:00
log-store.cc Move the getBuildLog implementation to its own implementation file 2023-01-13 11:05:44 +01:00
log-store.hh Move the getBuildLog implementation to its own implementation file 2023-01-13 11:05:44 +01:00
machines.cc
machines.hh
make-content-addressed.cc
make-content-addressed.hh
misc.cc Try to fix build failure 2023-01-15 15:16:14 -05:00
names.cc
names.hh
nar-accessor.cc Replace src/libutil/json.cc with nlohmann json generation 2022-11-16 16:50:50 +01:00
nar-accessor.hh Replace src/libutil/json.cc with nlohmann json generation 2022-11-16 16:50:50 +01:00
nar-info-disk-cache.cc NarInfoDiskCache: Keep BinaryCache.id stable and improve test 2023-02-07 23:34:36 +01:00
nar-info-disk-cache.hh NarInfoDiskCache: Keep BinaryCache.id stable and improve test 2023-02-07 23:34:36 +01:00
nar-info.cc libstore/nar-info: drop unused system field 2022-06-23 14:25:10 -04:00
nar-info.hh libstore/nar-info: drop unused system field 2022-06-23 14:25:10 -04:00
nix-store.pc.in Fix building with GCC 9 2023-02-10 18:38:57 +01:00
optimise-store.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
outputs-spec.cc Test store paths, with property tests 2023-01-23 07:05:50 -05:00
outputs-spec.hh Assert on construction that OutputsSpec::Names is non-empty 2023-01-12 20:52:29 -05:00
parsed-derivations.cc Merge pull request #3600 from NixOS/auto-uid-allocation 2022-11-29 14:01:42 +01:00
parsed-derivations.hh Split auto UID allocation from cgroups 2022-11-08 16:03:42 +01:00
path-info.cc Move ValidPathInfo defintions to path-info.cc 2023-01-13 15:39:19 -05:00
path-info.hh Delete dead code 2023-01-30 11:29:01 -05:00
path-regex.hh Test store paths, with property tests 2023-01-23 07:05:50 -05:00
path-with-outputs.cc Merge pull request #6815 from obsidiansystems/better-wanted-outputs 2023-01-13 16:03:12 +01:00
path-with-outputs.hh Improve OutputsSpec slightly 2023-01-11 18:54:50 -05:00
path.cc Test store paths, with property tests 2023-01-23 07:05:50 -05:00
path.hh Separate path.hh from content-address.hh 2023-01-30 10:14:03 -05:00
pathlocks.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
pathlocks.hh
profiles.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
profiles.hh A setting to follow XDG Base Directory standard 2023-02-10 20:14:06 +04:00
realisation.cc
realisation.hh Separate path.hh from content-address.hh 2023-01-30 10:14:03 -05:00
references.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
references.hh Restrict readFile context to references that appear in the string 2022-11-11 13:04:34 +01:00
remote-fs-accessor.cc Replace src/libutil/json.cc with nlohmann json generation 2022-11-16 16:50:50 +01:00
remote-fs-accessor.hh
remote-store.cc Don't send plugin-files to the daemon. 2023-02-01 20:05:56 -05:00
remote-store.hh Remove dead code RemoteStore::sameMachine 2023-03-01 11:10:30 -05:00
repair-flag.hh
s3-binary-cache-store.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
s3-binary-cache-store.hh
s3.hh Fix libcxx build 2022-04-28 14:37:05 +02:00
schema.sql schema.sql: add comment about hash being in base16 2022-06-01 14:59:57 +02:00
serve-protocol.hh
sqlite.cc sqlite.cc: Add SQL tracing 2023-02-07 23:34:36 +01:00
sqlite.hh Improve sqlite error messages 2022-12-17 14:51:37 +01:00
ssh-store.cc Remove dead code RemoteStore::sameMachine 2023-03-01 11:10:30 -05:00
ssh.cc Defer to SSH config files for ForwardAgent option 2022-10-22 19:51:22 -05:00
ssh.hh
store-api.cc Merge pull request #8015 from tweag/progress-during-nix-copy 2023-03-10 16:23:22 +01:00
store-api.hh Separate path.hh from content-address.hh 2023-01-30 10:14:03 -05:00
store-cast.hh
uds-remote-store.cc
uds-remote-store.hh Remove dead code RemoteStore::sameMachine 2023-03-01 11:10:30 -05:00
worker-protocol.hh