Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions nix/zed-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/nix/interop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';

Expand Down
Loading