Skip to content

Commit 0414146

Browse files
committed
test: stamp the Windows build-directory DACL inside the parallel runner
The workflow pre-created build\c with a protected DACL so build products would inherit it, but the diagnostic note from the failing CI shard named the real actor: MSYS2's Cygwin layer writes POSIX-emulating DACLs — including a CREATOR OWNER (S-1-3-0) mutation grant — onto directories its tools touch, overwriting the pre-created shape during the build. The activation transaction's source-directory policy correctly refuses that grant, so the install-flow tests failed on CI while the VM (whose harness stamps AFTER building) stayed green. The stamp now runs inside run-tests-parallel.sh on Windows, after any builder has had its say and immediately before the suites — one code path for CI and the VM. Two idempotent steps, as before: protect the directory, then /reset the children onto the clean inherited set. Verified: full VM parallel run green (6669 passed, 0 failed) through the new path. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 568e613 commit 0414146

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎scripts/run-tests-parallel.sh‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,28 @@ LOGDIR="$(dirname "$RUNNER")/test-logs"
3737
rm -rf "$LOGDIR"
3838
mkdir -p "$LOGDIR"
3939

40+
# Windows: shape the build directory like a real user checkout BEFORE the
41+
# suites run. MSYS2's Cygwin layer writes POSIX-emulating DACLs — including
42+
# CREATOR OWNER (S-1-3-0) mutation grants — onto directories its tools
43+
# touch, and workspace drive roots additionally inherit Authenticated-Users
44+
# Modify; the activation transaction's source-directory policy correctly
45+
# refuses both, which would fail the install-flow tests on the environment,
46+
# not the code. Stamping must happen AFTER the build (the builders are the
47+
# ones re-writing the DACL), so it lives here rather than in workflow
48+
# setup. Two idempotent steps: protect the DIRECTORY (inheritance flags are
49+
# directory-only — a /T re-root leaves files with empty deny-all DACLs),
50+
# then /reset the children to re-inherit the clean set.
51+
case "$(uname -s 2>/dev/null)" in
52+
MINGW* | MSYS*)
53+
runner_dir_w="$(cygpath -w "$(dirname "$RUNNER")")"
54+
me="$(whoami | tr -d '\r')"
55+
MSYS2_ARG_CONV_EXCL='*' icacls "$runner_dir_w" /inheritance:r \
56+
/grant:r "${me}:(OI)(CI)F" '*S-1-5-18:(OI)(CI)F' '*S-1-5-32-544:(OI)(CI)F' \
57+
/Q >/dev/null 2>&1 || true
58+
MSYS2_ARG_CONV_EXCL='*' icacls "${runner_dir_w}\\*" /reset /T /C /Q >/dev/null 2>&1 || true
59+
;;
60+
esac
61+
4062
SUITES_FILE="$LOGDIR/suites.txt"
4163
RESULTS_FILE="$LOGDIR/results.txt"
4264

0 commit comments

Comments
 (0)