From 26eba25577388072ba13b1682860fe872ba39942 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 24 Nov 2024 13:10:26 +0100 Subject: [PATCH 1/2] runInLinuxVM: re-add sourcing of stdenv & .attrs.sh This is required for `preVM` which can be arbitrary code: e.g. `vmTools.createEmptyImage` assumes the presence of `$out` in its default configuration. Also, before this patch, `preVM` wasn't even set in the `__structuredAttrs` case. --- pkgs/build-support/vm/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 648fea5cd016..8e262b20b3f6 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -240,6 +240,10 @@ rec { vmRunCommand = qemuCommand: writeText "vm-run" '' + if [ -f "''${NIX_ATTRS_SH_FILE-}" ]; then + source "$NIX_ATTRS_SH_FILE" + fi + source $stdenv/setup export > saved-env PATH=${coreutils}/bin From 4e2ce1ba944026460925a0f4271f6799a88a5417 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 24 Nov 2024 13:12:12 +0100 Subject: [PATCH 2/2] apptainer.tests.image-hello-cowsay: remove obsolete `rmdir "$out"` --- pkgs/build-support/singularity-tools/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/build-support/singularity-tools/default.nix b/pkgs/build-support/singularity-tools/default.nix index 2a6716962879..f85e9745d782 100644 --- a/pkgs/build-support/singularity-tools/default.nix +++ b/pkgs/build-support/singularity-tools/default.nix @@ -99,7 +99,6 @@ lib.makeExtensible (final: { inherit memSize; } '' - rmdir "$out" mkdir workspace mkfs -t ext3 -b 4096 /dev/${vmTools.hd} mount /dev/${vmTools.hd} workspace