Skip to content

Commit 7e51596

Browse files
committed
Windows CI: clarify build and target/host environments
It's confusing to list jobs environments as Cygwin/MSYS2 as in the Autoconf terminology these are the build environments, but the job is targeting native Windows (*not* Cygwin or MSYS2) using MinGW-w64. Here's the usual reminder: there are three OCaml ports (targets) to Windows: - Cygwin/MSYS2; - MinGW-w64; - MSVC. All three ports use Cygwin/MSYS2 as their *build* environment. Nowadays both Cygwin and MSYS2 use `x86_64-pc-cygwin` as their triplet. Without cross-compilation, the host and target environments are identical. Currently the opam CI for Windows does *not* check Cygwin, MSYS2, or MSVC targets, but only MinGW-w64 on x86_64. As of 5.4, OCaml has *not* been ported to Windows ARM64. Cygwin/MSYS2 provide a POSIX emulation layer, so testing them as target does *not* guarantee a native Windows compatibility. MinGW-w64 and MSVC are totally different compilers and have a different CLI API, ABI, and support different C/C++ dialects and extensions. Testing one does *not* guarantee compatibility with the other. I hope that clearly identifying the build and host/target environments will help remove any ambiguity around what platform is actually being tested. As I suspect users tend to care more about the target than the build environment, I've chosen to display the job name reversed (as target-host-build rather than the usual build-host-target) to make it easier to identify the job when its name is truncated in the UI.
1 parent bf4e23e commit 7e51596

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/windows.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ env:
1010
MSYS: winsymlinks:native
1111
jobs:
1212
build:
13+
name: "target/host: x86_64-w64-mingw32, build: ${{ matrix.build_env }}"
1314
strategy:
1415
fail-fast: false
1516
matrix:
16-
windows_env:
17+
build_env:
1718
- cygwin
1819
- msys2
1920
runs-on: windows-latest
@@ -35,10 +36,10 @@ jobs:
3536
path: |
3637
D:\opam\bin
3738
D:\opamroot
38-
key: ${{ runner.os }}-${{ matrix.windows_env }}-opam-${{ hashFiles('install.ps1') }}
39+
key: ${{ runner.os }}-${{ matrix.build_env }}-opam-${{ hashFiles('install.ps1') }}
3940

4041
- name: Add MSys2 to PATH and install prerequisites
41-
if: matrix.windows_env == 'msys2'
42+
if: matrix.build_env == 'msys2'
4243
run: |
4344
"C:\msys64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
4445
C:\msys64\usr\bin\pacman.exe --noconfirm -Syuu # Core update (in case any core packages are outdated)
@@ -56,7 +57,7 @@ jobs:
5657
5758
- name: Init opam
5859
if: steps.cache-opam.outputs.cache-hit != 'true'
59-
run: opam init --yes --no-setup ${{ matrix.windows_env == 'msys2' && '--cygwin-local-install' || '' }} .
60+
run: opam init --yes --no-setup ${{ matrix.build_env == 'msys2' && '--cygwin-local-install' || '' }} .
6061

6162
- name: Restrict testing to available compilers
6263
if: steps.cache-opam.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)