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" <