+++++ strace cp -r --preserve=mode,timestamps --reflink=auto -- /nix/store/jccwym60qp35f73m93bycl2rhf2lf0fc-source source
execve("/nix/store/yh6qg1nsi5h2xblcr67030pz58fsaxx3-coreutils-9.6/bin/cp", ["cp", "-r", "--preserve=mode,timestamps", "--reflink=auto", "--", "/nix/store/jccwym60qp35f73m93byc"..., "source"], 0x7fffffffc350 /* 90 vars */) = 0
brk(NULL) = 0x56d000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffff7ff7000
access("/etc/ld-nix.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/4izi23kn57b3cw47jddzq14wcv01b5y5-acl-2.3.2/lib/glibc-hwcaps/x86-64-v2/libacl.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/nix/store/4izi23kn57b3cw47jddzq14wcv01b5y5-acl-2.3.2/lib/glibc-hwcaps/x86-64-v2/", 0x7fffffffb3e0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/4izi23kn57b3cw47jddzq14wcv01b5y5-acl-2.3.2/lib/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=44416, ...}) = 0
mmap(NULL, 41008, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ffff7fec000
mmap(0x7ffff7fee000, 20480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ffff7fee000
mmap(0x7ffff7ff3000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7ffff7ff3000
mmap(0x7ffff7ff5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7ffff7ff5000
close(3) = 0
openat(AT_FDCWD, "/nix/store/4izi23kn57b3cw47jddzq14wcv01b5y5-acl-2.3.2/lib/libattr.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/pn0rk0wsmkjazbz380y8xzb99n8sr07g-attr-2.5.2/lib/glibc-hwcaps/x86-64-v2/libattr.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/nix/store/pn0rk0wsmkjazbz380y8xzb99n8sr07g-attr-2.5.2/lib/glibc-hwcaps/x86-64-v2/", 0x7fffffffb3c0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/pn0rk0wsmkjazbz380y8xzb99n8sr07g-attr-2.5.2/lib/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=30632, ...}) = 0
mmap(NULL, 28696, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ffff7fe4000
mmap(0x7ffff7fe6000, 12288, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ffff7fe6000
mmap(0x7ffff7fe9000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7ffff7fe9000
mmap(0x7ffff7fea000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7ffff7fea000
close(3) = 0
openat(AT_FDCWD, "/nix/store/4izi23kn57b3cw47jddzq14wcv01b5y5-acl-2.3.2/lib/libgmp.so.10", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/pn0rk0wsmkjazbz380y8xzb99n8sr07g-attr-2.5.2/lib/libgmp.so.10", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/rlpanzl29s3gv3wgs5720q04rbgysl8a-gmp-with-cxx-6.3.0/lib/glibc-hwcaps/x86-64-v2/libgmp.so.10", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/nix/store/rlpanzl29s3gv3wgs5720q04rbgysl8a-gmp-with-cxx-6.3.0/lib/glibc-hwcaps/x86-64-v2/", 0x7fffffffb3a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/rlpanzl29s3gv3wgs5720q04rbgysl8a-gmp-with-cxx-6.3.0/lib/libgmp.so.10", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=746072, ...}) = 0
mmap(NULL, 696840, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ffff7f39000
mmap(0x7ffff7f4b000, 520192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12000) = 0x7ffff7f4b000
mmap(0x7ffff7fca000, 94208, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x91000) = 0x7ffff7fca000
mmap(0x7ffff7fe1000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa8000) = 0x7ffff7fe1000
close(3) = 0
openat(AT_FDCWD, "/nix/store/4izi23kn57b3cw47jddzq14wcv01b5y5-acl-2.3.2/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/pn0rk0wsmkjazbz380y8xzb99n8sr07g-attr-2.5.2/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/rlpanzl29s3gv3wgs5720q04rbgysl8a-gmp-with-cxx-6.3.0/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/rmy663w9p7xb202rcln4jjzmvivznmz8-glibc-2.40-66/lib/glibc-hwcaps/x86-64-v2/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/nix/store/rmy663w9p7xb202rcln4jjzmvivznmz8-glibc-2.40-66/lib/glibc-hwcaps/x86-64-v2/", 0x7fffffffb380, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/rmy663w9p7xb202rcln4jjzmvivznmz8-glibc-2.40-66/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\243\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
fstat(3, {st_mode=S_IFREG|0555, st_size=2388416, ...}) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 2121176, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ffff7c00000
mmap(0x7ffff7c28000, 1527808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x7ffff7c28000
mmap(0x7ffff7d9d000, 352256, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7ffff7d9d000
mmap(0x7ffff7df3000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f2000) = 0x7ffff7df3000
mmap(0x7ffff7df9000, 52696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ffff7df9000
close(3) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffff7f37000
arch_prctl(ARCH_SET_FS, 0x7ffff7f38140) = 0
set_tid_address(0x7ffff7f38410) = 986861
set_robust_list(0x7ffff7f38420, 24) = 0
rseq(0x7ffff7f38a60, 0x20, 0, 0x53053053) = 0
mprotect(0x7ffff7df3000, 16384, PROT_READ) = 0
mprotect(0x7ffff7fe1000, 8192, PROT_READ) = 0
mprotect(0x7ffff7fea000, 4096, PROT_READ) = 0
mprotect(0x7ffff7ff5000, 4096, PROT_READ) = 0
mprotect(0x546000, 53248, PROT_READ) = 0
mprotect(0x6f0000036000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
prctl(PR_SET_NAME, "cp") = 0
prctl(PR_SET_MM, PR_SET_MM_ARG_START, 0x7fffffffc7b7, 0, 0) = -1 EPERM (Operation not permitted)
getrandom("\xcf\x58\x0a\xcd\x81\x21\xe0\xdc", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x56d000
brk(0x58e000) = 0x58e000
geteuid() = 2320
openat(AT_FDCWD, "source", O_RDONLY|O_PATH|O_DIRECTORY) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/nix/store/jccwym60qp35f73m93bycl2rhf2lf0fc-source", {st_mode=S_IFDIR|0555, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(AT_FDCWD, "source", 0x7fffffffbd10, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
mkdirat(AT_FDCWD, "source", 0555) = 0
newfstatat(AT_FDCWD, "source", {st_mode=S_IFDIR|0555, st_size=40, ...}, AT_SYMLINK_NOFOLLOW) = 0
fchmodat2(AT_FDCWD, "source", 040755, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
fcntl(1, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
write(2, "cp: ", 4cp: ) = 4
write(2, "setting permissions for 'source'", 32setting permissions for 'source') = 32
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
) = 1
lseek(0, 0, SEEK_CUR) = 0
close(0) = 0
close(1) = 0
close(2) = 0
exit_group(1) = ?
+++ exited with 1 +++
nix-portableworks on my nixos machinebut fails on a debian-based shared server
i have converted some nix expressions
from
fetchFromGitHubtofetchurlin my nur-packages
to fix failing
unpackPhasebranchesfor example milahu/nur-packages@b91e204
/nix/store/i29chfwff7bmigq47jjq5qwy0n9bspnr-sourceis the cloned git source
i tried to use
or
but no success
with
preUnpack = "set -x; pwd";with
strace
this error also shows with
cp -r -- $src sourcethis issue started
when i switched from
bwraptoprootbackendthe latest failing expression is
which is resistant to the
fetchurlworkaroundthis works:
nix-portable on bwrap
nix-on-droid on proot (todo why?)
this breaks:
nix-portable on proot
→ upstream issue proot-me/proot#387
building proot from source
with proot-me/proot#393
spoiler:
that PR is not supposed to fix proot-me/proot#387
but i still get
minimal reproducer
calling
prootdirectly worksso this seems to be an issue with the
nixbuild sandboxnix-build --option sandbox falsehas no effectfchmodat2only fails withdfd = AT_FDCWDDetails
test-fchmodat2.c
fchmodat2source: linux/fs/open.ci suspect this is related to
NixOS/nix#10501
i tried to use private linux headers like namei.h
so i can debug user_path_at etc
i tried to run
configureto generate headersand compile with
gcc -o test-fchmodat2 -Iinclude -Itools/include -Iarch/x86/include -Iarch/sh/include -Ibuild/include -Ibuild/arch/x86/include/generated test-fchmodat2.cbut then i get many compile errors...
maybe its easier to trace the
fchmodatsyscall?i tried to follow https://devkernel.io/posts/ftrace_intro/
but the trace output is not helpful
maybe downgrade to nix before NixOS/nix@ba68045 (nix 2.22.0)
no, fchmodat also fails with nix 2.10.0