diff --git a/infra/build-server/lib.sh b/infra/build-server/lib.sh index 962878e94..74993cc87 100755 --- a/infra/build-server/lib.sh +++ b/infra/build-server/lib.sh @@ -121,18 +121,20 @@ bs_push_and_checkout() { # visible here and tools/ci/copied-sources-check.sh sees it. target dirs and .git never travel; --delete keeps the box equal to # the Mac inside the directory (excluded paths are protected). bs_overlay_dir() { - local rel="$1" src="$BS_WT_ROOT/$1" dst="$BS_REMOTE_WT/$1" list n + local rel="$1" src="$BS_WT_ROOT/$1" dst="$BS_REMOTE_WT/$1" list nfiles ndirs [ -d "$src" ] || bs_die "no $src" list=$(mktemp) bs_ssh "mkdir -p '$dst'" bs_rsync -rlpgoD --checksum --delete --out-format='%n' \ --exclude '/target' --exclude '/target-*' --exclude '/target/' --exclude 'target-*/' --exclude '.git' --exclude '.DS_Store' --exclude 'node_modules' \ "$src/" "$BS_HOST:$dst/" > "$list" || { rm -f "$list"; bs_die "rsync of $rel failed"; } - n=$(grep -c . "$list" || true) - if [ "$n" -gt 0 ]; then - grep -v '/$' "$list" | tr '\n' '\0' | bs_ssh "cd '$dst' && xargs -0 -r touch --no-create" || bs_die "re-stamp of $rel failed" + # files only: directories are listed whenever an attribute differs (a fresh clone's ownership), and a tree whose files + # were all identical lists ONLY directories (first run of 6 October 2026: an empty file list failed the pipeline) + nfiles=$(grep -vc '/$' "$list" || true); ndirs=$(grep -c '/$' "$list" || true) + if [ "${nfiles:-0}" -gt 0 ]; then + if ! grep -v '/$' "$list" | tr '\n' '\0' | bs_ssh "cd '$dst' && xargs -0 -r touch --no-create"; then rm -f "$list"; bs_die "re-stamp of $rel failed"; fi fi - bs_log "overlay $rel -> $dst: $n entr$( [ "$n" = 1 ] && echo y || echo ies) written and re-stamped" + bs_log "overlay $rel -> $dst: ${nfiles:-0} file(s) written and re-stamped, ${ndirs:-0} dir(s)" rm -f "$list" }