Skip to content

Commit

Permalink
meson: add Windows CI
Browse files Browse the repository at this point in the history
There are a couple of oddities here. We don't attempt to build e.g.
contrib, because that doesn't seem to work at the moment. Also notice
that each command is its own step. This happens because github actions
runs in powershell, which doesn't seem to let you abort on the first
failure.
  • Loading branch information
eli-schwartz committed Dec 16, 2022
1 parent 7f29c18 commit 937e9d3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/dev-short-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,27 @@ jobs:
meson test -C builddir/ --print-errorlogs
meson install -C builddir --destdir staging/
meson-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install packages
run: pip install --pre meson
- name: Initialize the MSVC dev command prompt
uses: ilammy/msvc-dev-cmd@674ff850cbd739c402260838fa45b7114f750570

This comment has been minimized.

Copy link
@Cyan4973

Cyan4973 Jan 1, 2024

Contributor

Why is this dependency needed ?

This comment has been minimized.

Copy link
@eli-schwartz

eli-schwartz Jan 2, 2024

Author Contributor

Wiring up the Microsoft compiler for use as a compiler toolchain is a fiddly endeavor. You need to interactively run a batch script and have it set inscrutable variables, in addition to adding some things to PATH. This action "msvc-dev-cmd" sets that up for you and propagates it to future steps.

It may be possible to do without it. Is using it a concern?

This comment has been minimized.

Copy link
@Cyan4973

Cyan4973 Jan 2, 2024

Contributor

We try to go for the least amount of dependencies on the CI.
It's not a blind decision though.
Sometimes, a dependency might be convenient, but could also be replaced by one or two lines of script. In which case, it's better to reduce dependency.
Other times, the dependency brings some fairly important capability which would cost too much complexity to maintain locally, in which case it's better to keep the dependency.
Not knowing about this one, I'm looking for your advise.

This comment has been minimized.

Copy link
@eli-schwartz

eli-schwartz Jan 2, 2024

Author Contributor

Current versions of meson can both:

  • detect MSVC when no other compiler is installed (but github actions has a couple questionable GCCs installed on Windows, including the broken Strawberry Perl one)
  • be told to force setting up MSVC in much the same way this Actions dependency works

It's a bit annoying that using this builtin functionality requires also using meson compile to redetect MSVC when compiling. Running ninja isn't enough, since cl.exe isn't on %PATH%. But that's not too bad.

We can try that out with: eli-schwartz/zstd@923cf3d

- name: Configure with Meson
run: |
meson setup build/meson/ builddir/ -Dbin_tests=true
- name: Build with Meson
run: |
ninja -C builddir/
- name: Test with Meson
run: |
meson test -C builddir/ --print-errorlogs
- name: Install with Meson
run: |
meson install -C builddir --destdir staging/
cmake-visual-2019:
runs-on: windows-2019
strategy:
Expand Down

0 comments on commit 937e9d3

Please sign in to comment.