Skip to content

Conversation

@jmid
Copy link
Member

@jmid jmid commented Nov 21, 2025

This is the promised second PR out of 3, that solves MSys2 side conditions, as announced in #28939.

TLDR: since opam.2.2 MSys uses os = "win32" and os-distribution = "msys2" meaning that the MSys2 side-conditions for conf-packages are subtly wrong, see for example #28769 (review).

This second PR combs over and corrects the following conf-packages:
- conf-gtksourceview3
- conf-libevent
- conf-libffi
- conf-liblz4
- conf-libpcre2-8
- conf-libpcre
- conf-libssl
- conf-ncurses

@jmid
Copy link
Member Author

jmid commented Nov 21, 2025

CI spotted a couple of things, confirming that MSys2 CI was a good idea to add! 😄

First off, conf-libpcre was not installable!
https://github.com/ocaml/opam-repository/actions/runs/19573412563/job/56052318655?pr=28944

Testing conf-libpcre.2
  [ERROR] Package conflict!
    * Missing dependency:
  No solution found, exiting
      - conf-libpcre >= 2 -> conf-mingw-w64-pcre-i686 | conf-mingw-w64-pcre-x86_64
      unmet availability conditions: 'os = "win32" & os-distribution = "cygwin"'
      unmet availability conditions: 'os = "win32" & os-distribution = "cygwin"'
conf-libpcre.2 is not installable. Skip.

This turns out to be due to too strict availability guards, preventing anything but Cygwin-MinGW...

Secondly, conf-ncurses is failing:

Testing conf-ncurses.1
  The following actions will be performed:
  === install 2 packages
    - install conf-mingw-w64-ncurses-x86_64 1 [required by conf-ncurses]
    - install conf-ncurses                  1
  <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  [ERROR] The compilation of conf-mingw-w64-ncurses-x86_64.1 failed at "pkgconf --personality=x86_64-w64-mingw32 ncurses".
  #=== ERROR while compiling conf-mingw-w64-ncurses-x86_64.1 ====================#
  # context     2.4.1 | win32/x86_64 | ocaml.5.4.0 | file://D:/a/opam-repository/opam-repository
  # path        D:\opamroot\default\.opam-switch\build\conf-mingw-w64-ncurses-x86_64.1
  # command     C:\msys64\mingw64\bin\pkgconf.exe --personality=x86_64-w64-mingw32 ncurses
  # exit-code   1
  # env-file    D:\opamroot\log\conf-mingw-w64-ncurses-x86_64-9376-21713b.env
  # output-file D:\opamroot\log\conf-mingw-w64-ncurses-x86_64-9376-21713b.out
  <><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  +- The following actions failed
  | - build conf-mingw-w64-ncurses-x86_64 1
  +- 
  - No changes have been performed
  # To update the current shell environment, run: (& opam env) -split '\r?\n' | ForEach-Object { Invoke-Expression $_ }
conf-ncurses.1 failed to build.

Looking at https://packages.msys2.org/packages/mingw-w64-x86_64-ncurses
I've discovered that the MSys2 package doesn't offer an ncurses.pc pkg-config file: 😮

/mingw64/lib/pkgconfig/formw.pc
/mingw64/lib/pkgconfig/menuw.pc
/mingw64/lib/pkgconfig/ncurses++w.pc
/mingw64/lib/pkgconfig/ncursesw.pc
/mingw64/lib/pkgconfig/panelw.pc

As such, this is actually working as intended, telling us there is no such file.
I'm uncertain how to fix this as I am no ncurses expert, and hence I don't know if "ncursesw" (what appear to be a wide variant) is good enough, if it is an MSys2 packaging failure, or if we should simply mark it as unavailable... 🤔
Polite ping @mtelvers as you added this originally. WDYT?

@jmid
Copy link
Member Author

jmid commented Nov 21, 2025

The MSys2 MinGW CI rerun is failing on

  • conf-mingw-w64-gtksourceview3-i686 because the package is not available on i686 as also noted in the file
    # no i686 package available at https://packages.msys2.org/base/mingw-w64-gtksourceview3
  • conf-libpcre2-8.1 is failing as the Windows support is added to conf-libpcre2-8.2.
    As such it is an expected failure.
    However I'm unsure why testing conf-mingw-w64-pcre-i686.1 causes
    downgrade conf-libpcre2-8 2 to 1 [upstream or system changes]
    and ultimately leading to this 🤔

@jmid
Copy link
Member Author

jmid commented Nov 25, 2025

Looking at https://packages.msys2.org/packages/mingw-w64-x86_64-ncurses I've discovered that the MSys2 package doesn't offer an ncurses.pc pkg-config file: 😮

/mingw64/lib/pkgconfig/formw.pc
/mingw64/lib/pkgconfig/menuw.pc
/mingw64/lib/pkgconfig/ncurses++w.pc
/mingw64/lib/pkgconfig/ncursesw.pc
/mingw64/lib/pkgconfig/panelw.pc

As such, this is actually working as intended, telling us there is no such file. I'm uncertain how to fix this as I am no ncurses expert, and hence I don't know if "ncursesw" (what appear to be a wide variant) is good enough, if it is an MSys2 packaging failure, or if we should simply mark it as unavailable... 🤔

From https://invisible-island.net/ncurses/ncurses.faq.html#how_big_is_it

The ncurses and ncursesw libraries are reasonably source-compatible. That is, an application written for “ncurses” will build with “ncursesw”. But it will behave differently in response to your locale settings. (Some distributors, who do not care about the differences, have chosen to merge the names together as “ncurses”).

As such, in 4b915fb I've gone for testing for ncursesw on MSys2.

@jmid jmid force-pushed the conf-msys2-fixes-part2 branch from 44bec17 to 4a07cf5 Compare November 25, 2025 22:45
@jmid
Copy link
Member Author

jmid commented Nov 25, 2025

OK, the MSys2 workflow is now down to the two failures already described here: #28944 (comment)

I believe this should be good to go. I'll let the opam-ci finish and post a summary of it tomorrow morning.

@jmid
Copy link
Member Author

jmid commented Nov 26, 2025

OK, there are bunch of revdep failures that can be addressed in separate PRs.
None of them are caused by the Windows changes here though.

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.

1 participant