about summary refs log tree commit diff
path: root/COPYING
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-03-31T16·12+0200
committerEelco Dolstra <edolstra@gmail.com>2017-03-31T16·20+0200
commit29d35805c63f316aa19b33a481f953ca332d9b65 (patch)
treeb41a39a3a8641d926063b4e7dee68d7cdf25d448 /COPYING
parent3ecb09a40a8500d1052b087295b589ca4856fd7a (diff)
Sandbox: Fix /dev/ptmx on recent kernels
This fixes "No such file or directory" when opening /dev/ptmx
(e.g. http://hydra.nixos.org/build/51094249).

The reason appears to be some changes to /dev/ptmx / /dev/pts handling
between Linux 4.4 and 4.9. See
https://patchwork.kernel.org/patch/7832531/.

The fix is to go back to mounting a proper /dev/pts instance inside
the sandbox. Happily, this now works inside user namespaces, even for
unprivileged users. So

  NIX_REMOTE=local?root=/tmp/nix nix-build \
    '<nixpkgs/nixos/tests/misc.nix>' -A test

works for non-root users.

The downside is that the fix breaks sandbox builds on older kernels
(probably pre-4.6), since mounting a devpts fails inside user
namespaces for some reason I've never been able to figure out. Builds
on those systems will fail with

  error: while setting up the build environment: mounting /dev/pts: Invalid argument

Ah well.
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions