Does OCaml 4.12.1+ no longer support MinGW static linking?

In the Grain project, we have been building binaries for Mac, Linux, and Windows. To do this on Windows, we need to use this dune stanza:

(executable
 (name grainc)
 (public_name grainc)
 (package grain)
 (modules grainc)
 (modes exe)
 (flags
  (:standard -ccopt -- -ccopt -static))
 (libraries grain grain_diagnostics binaryen dune-build-info))

The important part are the -ccopt -- -ccopt -static flags, which statically links in the libraries provided through MinGW (this avoids our users needing to know about MinGW at all).

This currently works great on OCaml 4.12.0; however, if I try to upgrade to OCaml 4.12.1 or 4.13 or 4.14, our builds begin to fail.

Is this no longer supported by OCaml? Are we doing something blatantly wrong and should change to something else?

1 Like

What error are you getting?

I’ve added the error log to my issue at Does OCaml 4.12.1+ no longer support MinGW static linking? · Issue #11531 · ocaml/ocaml · GitHub