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
8 changes: 7 additions & 1 deletion .github/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ detail.
- `tools/perf-context-probe` links each archived library in turn and asserts
`user_key_comparison_count` is non-zero for the enabled one and zero for the disabled one. The
matrix's `run_probe` is false exactly where the runner cannot execute the target's binaries
(`darwin-x64`, both `windows-arm64` targets).
(`darwin-x64`, both `windows-arm64` targets). On Windows the generator and architecture are named
rather than left to CMake, whose default search falls back to NMake Makefiles and then fails with
no compiler. The generator name is read from vswhere and CMake rather than written down, so a
runner-image change surfaces as a clear error instead of an unbuildable default. The probe also
gets its own newer CMake there: the build is pinned to 3.31.10 to match the pinned vcpkg baseline,
and that CMake has no generator for the VS the image now ships. The probe only consumes the
installed package, so its CMake is independent of the one that built the libraries.
30 changes: 30 additions & 0 deletions .github/scripts/verify-prebuild-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,42 @@ if [[ "$RUN_PROBE" != "true" ]]; then
exit 0
fi

# This step has no Visual Studio developer prompt, so CMake's default generator search can land on
# NMake Makefiles and fail with no compiler.
GENERATOR_ARGS=()
if [[ "$windows_paths" == true ]]; then
vswhere="/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
if [[ ! -x "$vswhere" ]]; then
echo "::error::no vswhere.exe at ${vswhere}; cannot tell which Visual Studio to build the probe with" >&2
exit 1
fi
vs_major="$("$vswhere" -latest -property installationVersion 2>/dev/null | cut -d. -f1 | tr -cd '0-9' || true)"
if [[ -z "$vs_major" ]]; then
echo "::error::vswhere reported no Visual Studio installation" >&2
exit 1
fi
if ! cmake_help="$(cmake --help)"; then
echo "::error::cmake --help failed; cannot choose a generator" >&2
exit 1
fi
# head closes the pipe early, which pipefail would otherwise read as a failure.
generator="$(printf '%s\n' "$cmake_help" |
sed -n "s/^[ *]*\(Visual Studio ${vs_major} [0-9][0-9][0-9][0-9]\).*/\1/p" | head -1 || true)"
Comment thread
cb1kenobi marked this conversation as resolved.
if [[ -z "$generator" ]]; then
echo "::error::$(cmake --version | head -1) has no generator for the installed Visual Studio ${vs_major}.x" >&2
exit 1
fi
echo "Building the probe with ${generator}"
GENERATOR_ARGS=(-G "$generator")
fi

echo "=== Behavioural probe ==="
run_probe() {
local name="$1" expectation="$2" build_dir="${SCRATCH}/probe-$1"
shift 2

cmake -S "$PROBE_DIR" -B "$build_dir" \
${GENERATOR_ARGS[@]+"${GENERATOR_ARGS[@]}"} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$PREFIX" \
${EXTRA_CMAKE_ARGS[@]+"${EXTRA_CMAKE_ARGS[@]}"} \
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,12 @@ jobs:
target: windows-x64
triplet: x64-windows-static
run_probe: true
probe_cmake_args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
probe_cmake_args: -A x64 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
- runner: windows-latest
target: windows-x64-static-md
triplet: x64-windows-static-md
run_probe: true
probe_cmake_args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
probe_cmake_args: -A x64 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
- runner: windows-latest
target: windows-arm64
triplet: arm64-windows-static
Expand All @@ -490,7 +490,7 @@ jobs:

- name: Install cmake
if: ${{ matrix.platform.target != 'linux-x64-musl' && matrix.platform.target != 'linux-arm64-musl' }}
uses: lukka/get-cmake@latest
uses: lukka/get-cmake@a89e43e22a96abafcd7a62db652a65ecd33052c9 # latest as of 2026-10-04
with:
cmakeVersion: 3.31.10

Expand Down Expand Up @@ -628,6 +628,13 @@ jobs:
tar -cf - . | xz -9 > $ARCHIVE
echo "archive=$ARCHIVE" >> $GITHUB_OUTPUT

# Separate from the build's 3.31.10, which has no generator for the VS this image ships.
- name: Install a CMake that knows the installed Visual Studio (probe only)
if: ${{ startsWith(matrix.platform.target, 'windows-') && matrix.platform.run_probe }}
uses: lukka/get-cmake@a89e43e22a96abafcd7a62db652a65ecd33052c9 # latest as of 2026-10-04
with:
cmakeVersion: 4.4.3

- name: Verify release archive
if: ${{ matrix.platform.target != 'linux-x64-musl' && matrix.platform.target != 'linux-arm64-musl' }}
shell: bash
Expand Down
Loading