Skip to content

Commit

Permalink
gitlab-ci: wire up Visual Studio build with Meson
Browse files Browse the repository at this point in the history
Add a new job that builds and tests Meson-based builds with Visual
Studio. While the build job is mandatory, the test job is marked as
"manual" so that it doesn't run by default. We already have a bunch of
Windows-based jobs, and the computational overhead that these cause is
simply out of proportion to run the test suite twice.

A couple notes:

  - We disable Perl. This is because we pick up Perl from Git for
    Windows, which outputs different paths ("/c/" instead of "C:\") than
    what we expect in our tests.

  - We don't use the Git for Windows SDK. Instead, the build only
    depends on Visual Studio, Meson and Git for Windows. All the other
    dependencies like curl, pcre2 and zlib get pulled in and compiled
    automatically by Meson and thus do not have to be provided by the
    system.

  - We open-code "ci/run-test-slice.sh". This is because we only have
    direct access to PowerShell, so we manually implement the logic.
    There is an upstream pull request for the Meson build system [1] to
    implement test slicing in Meson directly.

All tests are passing.

[1]: mesonbuild/meson#14092

Signed-off-by: Patrick Steinhardt <[email protected]>
  • Loading branch information
pks-t committed Jan 9, 2025
1 parent b0056f5 commit 2530700
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,42 @@ test:mingw64:
- git-sdk/usr/bin/bash.exe -l -c 'ci/print-test-failures.sh'
parallel: 10

.msvc-meson:
tags:
- saas-windows-medium-amd64
before_script:
- choco install -y git meson ninja openssl
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
- refreshenv
# The certificate store for Python on Windows is broken and fails to fetch
# certificates, see https://bugs.python.org/issue36011. Work around the
# issue by importing cetrificates manually.
- Invoke-WebRequest https://curl.haxx.se/ca/cacert.pem -OutFile cacert.pem
- openssl pkcs12 -export -nokeys -in cacert.pem -out certs.pfx -passout "pass:"
- Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\Root -FilePath certs.pfx

build:msvc-meson:
extends: .msvc-meson
stage: build
script:
- meson setup build -Dperl=disabled
- meson compile -C build
artifacts:
paths:
- build

test:msvc-meson:
extends: .msvc-meson
stage: test
when: manual
timeout: 6h
needs:
- job: "build:msvc-meson"
artifacts: true
script:
- meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % $Env:CI_NODE_TOTAL + 1 } | Where-Object Name -EQ $Env:CI_NODE_INDEX | ForEach-Object { meson test -C build --no-rebuild $_.Group }
parallel: 10

test:fuzz-smoke-tests:
image: ubuntu:latest
stage: test
Expand Down

0 comments on commit 2530700

Please sign in to comment.