[ANN] DkML 2.1.2 and opam 2.2.0

The major focus of DkML 2.1.2 is shipping it with opam 2.2 and having some coexistence between DkML and opam 2.2 on Windows. You can skip this post if you don’t develop on Windows.

TLDR: Upgrade with winget upgrade dkml. Use opam-real to use pure opam 2.2 but only after installing Visual Studio 2022 (confer: release notes); example: opam-real switch create 5.2.0+msvc. Use dk Ml.Switch init to create DkML 4.14.2 switch. DkML has better MSVC package support today, while pure opam 2.2 has latest OCaml 5 and is the standard going forward; now you choose both without compromise.

Major changes:

  • Uses opam 2.2.0. You can directly use unmodified opam 2.2 with opam-real switch create 5.2.0+msvc. Or continue to use dk Ml.Switch init (or the deprecated dkml init) to create a DkML 4.14.2 switch which supports more native MSVC Windows packages (for now) but does not have the latest and experimental OCaml language features.
  • Support Windows SDK 11 (10.0.22621.0) and VC 17.9 and 17.10 (14.39/4x) added to allowed list. This makes it easier to coexist with opam 2.2 which requires Visual Studio 2022, and supports latest GitLab CI with its preinstallation of Visual Studio 2022.
  • The ocaml/opam-repository tag was advanced to Aug 15, 2024.
  • You can continue to use dkml.exe and with-dkml.exe but both are deprecated. The new (unified) executable is dk.exe. See “Deprecated Commands” in the release notes.
  • Once every two weeks DkML news about new versions, errata, uninstalling, etc. will be shown on a webpage. It is triggered from the now deprecated dkml init, the replacement dk Ml.Switch init and the with-dkml proxy commands, and can be disabled with dk Ml.News disable. In particular, use dk Ml.News to show the news if you are experiencing problems with DkML.
  • The patches to the OCaml compiler are now dual-licensed with OCaml’s LGPL 2.1 exception and Apache 2.0. All other source (especially the build scripts) for the DkML compiler is licensed solely with Apache 2.0. This is a follow-up to https://github.com/ocaml/ocaml/issues/13177.
  • The uninstaller/upgrader stops opam, dune and other OCaml processes since, on Windows, in-use executables can’t be deleted or updated. This feature is not foolproof yet.

Full release notes are at DkML 2.1.2 · DkML / Distributions / DkML · GitLab.

Enjoy! And thanks to OCSF for supporting Windows in the last couple of gap years.

Bug reports: GitHub users or GitLab users.

4 Likes

If I may clarify this slightly: neither opam nor opam-repository require Visual Studio 2022. Switches using the MSVC port of the forthcoming OCaml 5.3 require Visual Studio 2022, but it’s not necessary if one only creates mingw-w64 (GCC)-based switches or only wants MSVC switches for OCaml 4.14 and earlier.

For completeness for users who already have an existing VS 2019, what is the command line incantation to do that?


Unrelated: DkML uses wget not curl, so there is no urgency getting opam 2.2.1 into DkML.

This is supposed to work with any version of Visual Studio which has the C compiler and requires libraries installed[1]:

opam switch create 4.14-msvc system-msvc ocaml.4.14.2

  1. cf. issues linked in ocaml-windows/papercuts#7 for improving the diagnostics when that’s not the case ↩︎

1 Like

DkML 2.1.3 was released. The major changes are:

Upgrading is:

winget remove dkml # Ignore "exit code: 4294967295"
winget install dkml

The full release notes are at DkML 2.1.3 · DkML / Distributions / DkML · GitLab.