Skip to content

Clarify the Windows CI build/host/targets environments#29036

Merged
jmid merged 4 commits intoocaml:masterfrom
MisterDA:windows-ci
Dec 8, 2025
Merged

Clarify the Windows CI build/host/targets environments#29036
jmid merged 4 commits intoocaml:masterfrom
MisterDA:windows-ci

Conversation

@MisterDA
Copy link
Contributor

@MisterDA MisterDA commented Dec 8, 2025

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.

See also #28856, https://github.com/ocaml/ocaml/blob/trunk/README.win32.adoc, and ocaml/setup-ocaml#950.

No need to put the os in the matrix as the job only runs on Windows.
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.
@jmid
Copy link
Member

jmid commented Dec 8, 2025

Thanks, I'm all for clearer terminology!

I'm less sure about removing the x86_32 gcc packages.

ATM, the workflows will also trigger, e.g., on changes to or submission of conf-mingw...i686 packages.

I've used that in the past to catch MSys2 package names or conditions that were off.
For example on #28939 the change to conf-mingw-w64-glade-i686.1 triggered in
https://github.com/ocaml/opam-repository/actions/runs/19554200045/job/55992819322
caused removal of arch-x86_64 and installation of arch-x86_32.
I'm worried that removing the x86_32 gcc package removes this check and thus leaves those 32-bit options less checked.

@MisterDA
Copy link
Contributor Author

MisterDA commented Dec 8, 2025

I'm less sure about removing the x86_32 gcc packages.
ATM, the workflows will also trigger, e.g., on changes to or submission of conf-mingw...i686 packages.

That's a great point that I had totally missed, I'll remove this change from the PR. Thanks!

@raphael-proust
Copy link
Contributor

LGTM thanks!!

Copy link
Member

@jmid jmid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jmid jmid merged commit 95f7875 into ocaml:master Dec 8, 2025
4 checks passed
@MisterDA MisterDA deleted the windows-ci branch December 8, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants