Skip to content

Conversation

@jmid
Copy link
Member

@jmid jmid commented Nov 20, 2025

This PR fixes a bunch of MSys2 side-conditions for conf-packages:
- conf-ao
- conf-cairo
- conf-freetype
- conf-glade
- conf-gnomecanvas
- conf-gnutls
- conf-gtk2
- conf-gtk3

It is the first of 3 such expected PRs.

Quoting #28806:

This reveals why conf-libpcre isn't working under MinGW MSys #28769 (review):
os-distribution is "msys2" there, not "cygwin", causing the wrong build command to trigger.
Looking more into this, I found that this changed in ocaml/opam#5843 with opam.2.2.
It however means I have some conf-file correcting to do... 😅

Recalling https://github.com/ocaml/opam-repository/wiki/Depexts-os-distribution---os-family-values
consider a build condition such the following from conf-ao:

build: [
  ["pkgconf" {os = "win32" & os-distribution = "cygwin"}
     "--personality=i686-w64-mingw32" {os = "win32" & os-distribution = "cygwin" & host-arch-x86_32:installed}
     "--personality=x86_64-w64-mingw32" {os = "win32" & os-distribution = "cygwin" & host-arch-x86_64:installed}
   "pkg-config" {os != "win32" | os-distribution != "cygwin"}
   "--print-errors" "--exists" "ao"]
]

On MSys2 with os = "win32" and os-distribution = "msys2" this would thus run either

  • pkgconf --personality=i686-w64-mingw32 pkg-config --print-errors --exists ao or
  • pkgconf --personality=x86_64-w64-mingw32 pkg-config --print-errors --exists ao

with an unwanted pkg-config in there in the middle! 😮

The reason there's a bunch of correction to do, is I based several MinGW-PRs on the template PR: #26072
That PR predates opam.2.2 (it was prepared prior to the release I believe) where os-distribution changed to "msys2" from "cygwin".

With os = "win32" we consider 3 possible os-distributions: cygwin, msys2, cygwinports
https://github.com/ocaml/opam-repository/wiki/Depexts-os-distribution---os-family-values
The shortest fix to catch the former 2 with these side-conditions is thus to use
os = "win32" & os-distribution != "cygwinports" like we already do in the depends field.

@jmid jmid force-pushed the conf-msys2-fixes-part1 branch from 6790b2a to 3fe58f4 Compare November 20, 2025 22:52
@jmid
Copy link
Member Author

jmid commented Nov 20, 2025

This further revealed that the glade package names were a bit off for MSys2:
According to https://packages.msys2.org/base/mingw-w64-libglade

(this could of course have changed since #26812)

@jmid
Copy link
Member Author

jmid commented Nov 20, 2025

So the MSys2 workflow is failing

  [ERROR] The compilation of conf-mingw-w64-glade-i686.1 failed at "pkgconf --personality=i686-w64-mingw32 libglade-2.0".
  [ERROR] The compilation of conf-mingw-w64-gtk2-i686.1 failed at "pkgconf --personality=i686-w64-mingw32 gtk+-2.0".

The former is as mentioned above because no i686 glade package is available on MSys2 as noted in the file in the above commit 704e9bf.

The latter is because no i686 gtk2 package is available as noted in the file in commit 1059bfa.

As such, this is now working as expected.

I'll await the completion of the opam-ci workflow before commenting on that.

@jmid
Copy link
Member Author

jmid commented Nov 21, 2025

CI summary for opam-ci:

  • a ton of frama-c revdeps failures
  • other revdeps failures for ocamlgraph_gtk, why3-ide, camlimages, proverif
  • distribution errors on Centos, OpenSuse, and macOS

None of these were caused by the MSys2 side-condition fixes of this PR.
As this PR is already a bit heavy to run, I'd rather we address the surfaced errors in separate follow-up PRs to avoid needless CI strain. The run confirms that the side-condition fixes didn't break anything for other distributions.

@mseri
Copy link
Member

mseri commented Nov 23, 2025

Thanks. Let's merge this indeed

@mseri mseri merged commit b3c731b into ocaml:master Nov 23, 2025
1 of 3 checks passed
@jmid jmid deleted the conf-msys2-fixes-part1 branch November 23, 2025 10:59
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.

2 participants