From c69574ed1b73bf6dbbf945ca38171e54837b5833 Mon Sep 17 00:00:00 2001 From: "Brian M. Carr" Date: Tue, 6 Oct 2026 09:33:52 -0500 Subject: [PATCH] ci: set up MSVC environment for Windows native-image build The Windows native-build job fails at nativeCompile because native-image can't auto-detect Visual Studio on the runner (setup-graalvm skips MSVC env setup for GraalVM JDK 17+). Export the MSVC env explicitly via ilammy/msvc-dev-cmd before the first gradlew call, mirroring the fix in engine-public/protoc-gen-openapi#38. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/native-build.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/native-build.yaml b/.github/workflows/native-build.yaml index 2e1bde1..0cca52e 100644 --- a/.github/workflows/native-build.yaml +++ b/.github/workflows/native-build.yaml @@ -94,6 +94,16 @@ jobs: EOF fi + # GraalVM native-image needs the MSVC toolchain (vcvarsall/cl.exe) on + # Windows. setup-graalvm skips MSVC env setup for GraalVM JDK 17+, expecting + # native-image to auto-detect Visual Studio; that detection fails on this + # runner. Export the MSVC env explicitly. Must run before the first gradlew + # call so the Gradle daemon (and thus the native-image child process) + # inherits these vars. + - name: "Set up MSVC environment (Windows)" + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + - name: Setup gradle uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # https://github.com/gradle/actions/releases/tag/v6.1.0