diff options
author | Antoine Eiche <lewo@abesis.fr> | 2020-04-29 14:39:37 +0200 |
---|---|---|
committer | Antoine Eiche <lewo@abesis.fr> | 2020-04-29 15:43:20 +0200 |
commit | ca93b26db6d2d73e702ea8ecdd0a98f17ace2c7b (patch) | |
tree | 8ebcf30f1abbd645212cc11badcfb29b4c7f3ca7 /src | |
parent | 06849c3090615d85dbba17b674e97dff71bd41bc (diff) |
Only call grantpt on MacOS systems
The commit 3cc1125595d97b4ab7369e37e4ad22f4cfecb8b2 adds a `grantpt`
call on the builder pseudo terminal fd. This call is actually only
required for MacOS, but it however requires a RW access to /dev/pts
which is only RO bindmounted in the Bazel Linux sandbox. So, Nix can
not be actually run in the Bazel Linux sandbox for unneeded reasons.
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/build.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 572634765..147093fae 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2250,10 +2250,13 @@ void DerivationGoal::startBuilder() if (chown(slaveName.c_str(), buildUser->getUID(), 0)) throw SysError("changing owner of pseudoterminal slave"); - } else { + } +#if __APPLE__ + else { if (grantpt(builderOut.readSide.get())) throw SysError("granting access to pseudoterminal slave"); } +#endif #if 0 // Mount the pt in the sandbox so that the "tty" command works. |