remove incorrect usage of tempdir for sandbox directories

The flags out-live the temporary directory
This commit is contained in:
Jörg Thalheim
2024-12-05 11:35:32 +01:00
parent e2ed57f8dd
commit 95adf200ac

View File

@@ -77,18 +77,13 @@ def nix_eval(flags: list[str]) -> list[str]:
] ]
) )
if os.environ.get("IN_NIX_SANDBOX"): if os.environ.get("IN_NIX_SANDBOX"):
with tempfile.TemporaryDirectory(prefix="nix-store-") as nix_store: return [
return [ *default_flags,
*default_flags, "--override-input",
"--override-input", "nixpkgs",
"nixpkgs", str(nixpkgs_source()),
str(nixpkgs_source()), *flags,
# --store is required to prevent this error: ]
# error: cannot unlink '/nix/store/6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh': Operation not permitted
"--store",
nix_store,
*flags,
]
return default_flags + flags return default_flags + flags