1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-19 16:59:35 +01:00

don't include derivation name in temporary build directories

With the migration to /nix/var/nix/builds we now have failing builds
when the derivation name is too long.
This change removes the derivation name from the temporary build to have
a predictable prefix length:

Also see: https://github.com/NixOS/infra/pull/764
for context.
This commit is contained in:
Jörg Thalheim 2025-08-27 09:29:47 +02:00
parent 8ee74792fe
commit 725a2f379f
4 changed files with 14 additions and 8 deletions

View file

@ -104,8 +104,8 @@ in
# Wait for the build to be ready
# This is OK because it runs as root, so we can access everything
machine.wait_until_succeeds("stat /nix/var/nix/builds/nix-build-open-build-dir.drv-*/build/syncPoint")
dir = machine.succeed("ls -d /nix/var/nix/builds/nix-build-open-build-dir.drv-*").strip()
machine.wait_until_succeeds("stat /nix/var/nix/builds/nix-*/build/syncPoint")
dir = machine.succeed("ls -d /nix/var/nix/builds/nix-*").strip()
# But Alice shouldn't be able to access the build directory
machine.fail(f"su alice -c 'ls {dir}/build'")
@ -125,8 +125,8 @@ in
args = [ (builtins.storePath "${create-hello-world}") ];
}' >&2 &
""".strip())
machine.wait_until_succeeds("stat /nix/var/nix/builds/nix-build-innocent.drv-*/build/syncPoint")
dir = machine.succeed("ls -d /nix/var/nix/builds/nix-build-innocent.drv-*").strip()
machine.wait_until_succeeds("stat /nix/var/nix/builds/nix-*/build/syncPoint")
dir = machine.succeed("ls -d /nix/var/nix/builds/nix-*").strip()
# The build ran as `nixbld1` (which is the only build user on the
# machine), but a process running as `nixbld1` outside the sandbox