git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] ci: use Visual Studio for win+meson job on GitHub Workflows

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 6, 2025, 11:31 UTC
Message-ID
<20250306-b4-pks-ci-meson-vsenv-v1-1-a65fe860289f@pks.im>

In 7304bd2bc39 (ci: wire up Visual Studio build with Meson, 2025-01-22) we have wired up a new CI job that builds and tests Git with Meson on a Windows machine. The expectation here was that this build uses the Visual Studio toolchain to do so, and that is true on GitLab CI. But on GitHub Workflows it is not the case because we've got GCC in our PATH, and thus Meson favors that compiler toolchain over Visual Studio's.

Fix this by explicitly asking Meson to use the Visual Studio toolchain. While this is only really required for GitHub Workflows, let's also pass the flag in GitLab CI so that we don't implicitly assume the toolchain that Meson is going to pick.

Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
Hi,

this patch addresses the issue reported by Johannes [1] where GitHub Workflows doesn't use the Visual Studio toolchain in the win+Meson job even though it should.

Builds for GitLab are at [2], GitHub at [3]. GitHub now uses the MSVC toolchain as expected [4].

Thanks!
Patrick
[1]: <3e9ccffc7474698947bdcb6d49b5d0728deadd08.1741256780.git.gitgitgadget@gmail.com>
[2]: https://gitlab.com/gitlab-org/git/-/merge_requests/318
[3]: https://github.com/git/git/pull/1909
[4]: https://github.com/git/git/actions/runs/13697111615/job/38302001801?pr=1909#step:5:16
---
 .github/workflows/main.yml | 2 +-
 .gitlab-ci.yml             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9959b61ece2..6a002485aeb 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -265,7 +265,7 @@ jobs:
       run: pip install meson ninja
     - name: Setup
       shell: pwsh
-      run: meson setup build -Dperl=disabled -Dcredential_helpers=wincred
+      run: meson setup build --vsenv -Dperl=disabled -Dcredential_helpers=wincred
     - name: Compile
       shell: pwsh
       run: meson compile -C build
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2805cdeecb6..4798b283745 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -164,7 +164,7 @@ build:msvc-meson:
   extends: .msvc-meson
   stage: build
   script:
-    - meson setup build -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred
+    - meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred
     - meson compile -C build
   artifacts:
     paths:

---
base-commit: e969bc875963a10890d61ba84eab3a460bd9e535
change-id: 20250306-b4-pks-ci-meson-vsenv-e88b0d39ed2d
Message 1 of 1 in “ci: use Visual Studio for win+meson job on GitHub Workflows”
  1. ci: use Visual Studio for win+meson job on GitHub WorkflowsPatrick Steinhardt, Mar 6, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.