{"thread":{"id":"63067","subject":"[PATCH] ci: use Visual Studio for win+meson job on GitHub Workflows","startedAt":"2025-03-06T11:31:38Z","lastAt":"2025-03-06T11:31:38Z","messageCount":1,"participants":["Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"513650","messageId":"20250306-b4-pks-ci-meson-vsenv-v1-1-a65fe860289f@pks.im","threadId":"63067","inReplyTo":null,"subject":"[PATCH] ci: use Visual Studio for win+meson job on GitHub Workflows","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-03-06T11:31:29Z","receivedAt":"2025-03-06T11:31:38Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In 7304bd2bc39 (ci: wire up Visual Studio build with Meson, 2025-01-22)\nwe have wired up a new CI job that builds and tests Git with Meson on a\nWindows machine. The expectation here was that this build uses the\nVisual Studio toolchain to do so, and that is true on GitLab CI. But on\nGitHub Workflows it is not the case because we've got GCC in our PATH,\nand thus Meson favors that compiler toolchain over Visual Studio's.\n\nFix this by explicitly asking Meson to use the Visual Studio toolchain.\nWhile this is only really required for GitHub Workflows, let's also pass\nthe flag in GitLab CI so that we don't implicitly assume the toolchain\nthat Meson is going to pick.\n\nReported-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\nHi,\n\nthis patch addresses the issue reported by Johannes [1] where GitHub\nWorkflows doesn't use the Visual Studio toolchain in the win+Meson job\neven though it should.\n\nBuilds for GitLab are at [2], GitHub at [3]. GitHub now uses the MSVC\ntoolchain as expected [4].\n\nThanks!\n\nPatrick\n\n[1]: <3e9ccffc7474698947bdcb6d49b5d0728deadd08.1741256780.git.gitgitgadget@gmail.com>\n[2]: https://gitlab.com/gitlab-org/git/-/merge_requests/318\n[3]: https://github.com/git/git/pull/1909\n[4]: https://github.com/git/git/actions/runs/13697111615/job/38302001801?pr=1909#step:5:16\n---\n .github/workflows/main.yml | 2 +-\n .gitlab-ci.yml             | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 9959b61ece2..6a002485aeb 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -265,7 +265,7 @@ jobs:\n       run: pip install meson ninja\n     - name: Setup\n       shell: pwsh\n-      run: meson setup build -Dperl=disabled -Dcredential_helpers=wincred\n+      run: meson setup build --vsenv -Dperl=disabled -Dcredential_helpers=wincred\n     - name: Compile\n       shell: pwsh\n       run: meson compile -C build\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex 2805cdeecb6..4798b283745 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -164,7 +164,7 @@ build:msvc-meson:\n   extends: .msvc-meson\n   stage: build\n   script:\n-    - meson setup build -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred\n+    - meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred\n     - meson compile -C build\n   artifacts:\n     paths:\n\n---\nbase-commit: e969bc875963a10890d61ba84eab3a460bd9e535\nchange-id: 20250306-b4-pks-ci-meson-vsenv-e88b0d39ed2d\n\n"}]}