diff --git a/nix/zed-package.nix b/nix/zed-package.nix index 92b02249..cb82b886 100644 --- a/nix/zed-package.nix +++ b/nix/zed-package.nix @@ -365,6 +365,24 @@ rec { ${postUnpack} ''; postPatch = '' + # A source checkout may carry the durable operation rendezvous created + # by prior Zed commands. Its diagnostic bytes are mutable coordination + # state, not package input, and must not enter the immutable consumer + # output. Preserve every other deterministic `.zed` adapter artifact. + operation_lock=".zed/operation.lock" + if [[ -L "$operation_lock" ]]; then + echo "mkZedPackage: operation lock must not be a symlink" >&2 + exit 1 + fi + if [[ -e "$operation_lock" ]]; then + if [[ ! -f "$operation_lock" ]]; then + echo "mkZedPackage: operation lock must be a regular file" >&2 + exit 1 + fi + rm -f -- "$operation_lock" + rmdir .zed 2>/dev/null || true + fi + if [[ ! -d ${zedDeps}/tree ]]; then echo "mkZedPackage: zedDeps does not contain the Nix bridge tree" >&2 exit 1 diff --git a/tests/nix/interop.nix b/tests/nix/interop.nix index 7dcc948d..98707a33 100644 --- a/tests/nix/interop.nix +++ b/tests/nix/interop.nix @@ -72,6 +72,7 @@ let test -f .vendor/.zed/zed-pkg/docker-node-lib/package.json test -f node_modules/@zed-pkg/docker-node-lib/package.json test ! -e .vendor/.zed/zed-pkg/docker-node-lib/generated/output.txt + test ! -e .zed/operation.lock runHook postCheck '';