DavHau / nix-portable

Nix - Static, Permissionless, Installation-free, Pre-configured
MIT License
788 stars 29 forks source link

Some builds fail: stat: cannot statx ...: no such file or directory #24

Open dali99 opened 2 years ago

dali99 commented 2 years ago

I'm running nix-portable with NP_LOCATION=/scratch/danio and these files in my PATH:

wxrwxrwx  1 danio eall_s   12 Aug 19 16:28 nix -> nix-portable
lrwxrwxrwx  1 danio eall_s   12 Aug 19 16:29 nix-build -> nix-portable
lrwxrwxrwx  1 danio eall_s   12 Aug 19 16:29 nix-collect-garbage -> nix-portable
lrwxrwxrwx  1 danio eall_s   12 Aug 19 16:29 nix-copy-closure -> nix-portable
lrwxrwxrwx  1 danio eall_s   12 Aug 19 16:29 nix-index -> nix-portable
lrwxrwxrwx  1 danio eall_s   12 Aug 19 16:29 nix-info -> nix-portable
lrwxrwxrwx  1 danio eall_s   12 Aug 19 16:29 nix-instantiate -> nix-portable
-rwxr-xr-x  1 danio eall_s  37M Apr 28 14:17 nix-portable
lrwxrwxrwx  1 danio eall_s   12 Aug 19 16:29 nix-shell -> nix-portable
lrwxrwxrwx  1 danio eall_s   12 Aug 19 16:28 nix-store -> nix-portable
-rwxr-xr-x  1 danio eall_s  114 Aug 21 14:46 nix_wrapper.sh

nix_wrapper.sh:

#!/bin/sh
exec bash -c '
mkdir -p /scratch/danio
export NP_LOCATION="/scratch/danio"
exec $SSH_ORIGINAL_COMMAND
'

on an NFS share

Some builds seem to work but others fail. I've seen it when I tried to build qtwebengine using this node as a builder, but now I also see it when running nix-build -vvvvvvvvvv -I "nixos=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-21.05.tar.gz" -A omnikey with a local default.nix

the key seems to lie here in the log:

stat: cannot statx '/nix/store/ah9102l9q1fsgsama0gss32w7p9a3il5-read-omnikey-0.1.0/bin/read-omnikey': No such file or directory
waiting for children
building of '/nix/store/bwyhffd4s60yl242194a5ldyqdyzllha-read-omnikey-0.1.0.drv!out' from .drv file: got EOF
building of '/nix/store/bwyhffd4s60yl242194a5ldyqdyzllha-read-omnikey-0.1.0.drv!out' from .drv file: woken up
building of '/nix/store/bwyhffd4s60yl242194a5ldyqdyzllha-read-omnikey-0.1.0.drv!out' from .drv file: build done
killing process 6457
builder process for '/nix/store/bwyhffd4s60yl242194a5ldyqdyzllha-read-omnikey-0.1.0.drv' finished
lock released on '/nix/store/ah9102l9q1fsgsama0gss32w7p9a3il5-read-omnikey-0.1.0.lock'
building of '/nix/store/bwyhffd4s60yl242194a5ldyqdyzllha-read-omnikey-0.1.0.drv!out' from .drv file: done
building of '/nix/store/bwyhffd4s60yl242194a5ldyqdyzllha-read-omnikey-0.1.0.drv!out' from .drv file: goal destroyed
error: --- Error -------------------------------------------------------------------- nix-build
builder for '/nix/store/bwyhffd4s60yl242194a5ldyqdyzllha-read-omnikey-0.1.0.drv' failed with exit code 1

Specifically the stat: cannot statx '/nix/store/ah9102l9q1fsgsama0gss32w7p9a3il5-read-omnikey-0.1.0/bin/read-omnikey': No such file or directory

Do you have an idea of what's wrong?

dali99 commented 2 years ago

Node that works: Linux demiurgen 5.14.0-1-amd64 #1 SMP Debian 5.14.6-3 (2021-09-28) x86_64 GNU/Linux

Node that doesn't work: Linux isvegg 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux

vetsin commented 3 months ago

Had a similar problem, adding filter-syscalls = false to my conf fixed it. Obviously not ideal, i can't see it in your logs but it's probably trying to setuid or setgid on read-omnikey. I'm not sure what the 'right' fix would be for you, but likely https://search.nixos.org/options?show=security.wrappers&query=security.wrappers