nix: cross-platform syscall wrapper
All checks were successful
Test / Create distribution (push) Successful in 42s
Test / Sandbox (push) Successful in 54s
Test / Sandbox (race detector) (push) Successful in 52s
Test / Planterette (push) Successful in 51s
Test / Hakurei (push) Successful in 1m1s
Test / Hakurei (race detector) (push) Successful in 59s
Test / Flake checks (push) Successful in 1m6s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-07-07 04:22:55 +09:00
parent 356b42a406
commit 72c2b66fc0
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q

View File

@ -185,17 +185,23 @@
''; '';
}; };
generateSyscallTable = pkgs.mkShell { generateSyscallTable =
# this should be made cross-platform via nix let
shellHook = "exec ${pkgs.writeShellScript "generate-syscall-table" '' GOARCH = {
set -e x86_64-linux = "amd64";
${pkgs.perl}/bin/perl \ aarch64-linux = "arm64";
sandbox/seccomp/mksysnum_linux.pl \ };
${pkgs.linuxHeaders}/include/asm/unistd_64.h | \ in
${pkgs.go}/bin/gofmt > \ pkgs.mkShell {
sandbox/seccomp/syscall_linux_amd64.go shellHook = "exec ${pkgs.writeShellScript "generate-syscall-table" ''
''}"; set -e
}; ${pkgs.perl}/bin/perl \
container/seccomp/mksysnum_linux.pl \
${pkgs.linuxHeaders}/include/asm/unistd_64.h | \
${pkgs.go}/bin/gofmt > \
container/seccomp/syscall_linux_${GOARCH.${system}}.go
''}";
};
} }
); );
}; };