From dcf3abf1bcfe3c381c1f92aa77dd0681aaaca747 Mon Sep 17 00:00:00 2001 From: "nekomimi.pet" Date: Wed, 28 Oct 2026 04:37:39 -0400 Subject: [PATCH] test: copy dependency priv dirs into daemon snapshots so a rebuild cannot remove a running daemon's NIF --- test/snapshot-daemon.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/snapshot-daemon.sh b/test/snapshot-daemon.sh index 2c4a927a9..4032d3a10 100755 --- a/test/snapshot-daemon.sh +++ b/test/snapshot-daemon.sh @@ -17,9 +17,13 @@ for ebin in "$root"/build/dev/erlang/*/ebin; do name="$(basename "$package")" mkdir -p "$out/$name" cp -R "$ebin" "$out/$name/ebin" - # priv keeps pointing at the source tree, as under `gleam run`. - if [ -e "$package/priv" ]; then + # A priv that links to a source tree keeps pointing at it, as under + # `gleam run`. One the build itself holds (a dependency's NIF) is copied: + # a rebuild by another toolchain deletes it under a running daemon. + if [ -L "$package/priv" ]; then ln -s "$(cd "$package/priv" && pwd -P)" "$out/$name/priv" + elif [ -d "$package/priv" ]; then + cp -R "$package/priv" "$out/$name/priv" fi done cat >"$out/albedo-daemon" <