Dk 2.1.2 - Please upgrade!

THE DkML DISTRIBUTION HAS BEEN SUNSET

End-of-life is December 31, 2026.

The announcement at https://discuss.ocaml.org/t/ann-sunsetting-of-dkml-distribution/17530 has full details.

UPGRADING YOUR OUT-OF-DATE VERSION

In PowerShell do:

winget remove dkml

You’ll see Uninstall failed with exit code: 4294967295 but otherwise it should succeed.

Then do:

winget install dkml

NOTES FOR YOUR CURRENTLY OUT-OF-DATE VERSION

Errata

  1. The installer does not yet check that all OCaml programs are stopped before upgrading or uninstalling. If you get Permission denied then stop OCaml manually: close Visual Studio Code, stop any dune build, and stop any opam install / opam exec. And then forcibly kill the processes in PowerShell:

    1..6 | % {  @("bash","sh","with-dkml","ocamllsp","git","opam","dune","ocamlrun") | % { taskkill /F /IM "$_.exe" }; Start-Sleep 1 }
  2. During opam install, when a package tries to run a non-OCaml executable (for example, the conf-python-3 package runs python3), the deprecation logic will pause the program for 15 seconds. You might see in the logs:

    ### output ###
    # WARNING: `with-dkml "python3"` is deprecated. Use `dk Ml.Use -- "python3"` instead.
    # The program will continue in 15 seconds ...

    You will need to wait for the next version for this performance gap to be fixed.

Release Notes

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 stops opam, dune and other OCaml processes since, on Windows, in-use executables can’t be deleted or updated.

Deprecated Commands in 2.1.2

The deprecated commands still work, but will pause for 15 seconds after displaying the new command on the standard error.

Old CommandNew CommandExample
dkml initdk Ml.Switchdk Ml.Switch init
dk Ml.Newsdk Ml.News show
dkml versiondk Ml.Versiondk Ml.Version show
with-dkml bashdk Ml.Usedk Ml.Use -- bash

Minor Changes

  • The appropriate host-arch-x86_32/host-arch-x86_64 package is automatically added during dkml init on Windows. This makes DkML more consistent with opam 2.2.

  • The appropriate dkml-host-abi-windows_x86_64/windows_x86/... package is automatically added during dkml init. The former dkml-abi switch variable is now called dkml-host-abi, and is set by the new dkml-host-abi package.

  • Multiple target ABIs can be selected with, for example, dkml-target-abi-darwin_arm64 when the host ABI is dkml-host-abi-darwin_x86_64.

  • The msys2-clang64 package is automatically added during dkml init on Windows. This makes DkML more consistent with opam 2.2.

  • The Bytecode installer, which was deprecated, has now been removed from the distribution.

  • The dkml init --system command no longer adds the following Opam global variables. Instead, the presence of host-arch-x86_32 (etc.) is used for opam filters in conf-withdkml.2 and conf-sqlite3.3.1+cpkgs, which makes DkML more consistent with opam 2.2.

    Global VariableTypical Value
    msystemCLANG64
    msystem-carchx86_64
    msystem-chostx86_64-w64-mingw32
    msystem-prefix/clang64
    mingw-chostx86_64-w64-mingw32
    mingw-prefix/clang64
    mingw-package-prefixmingw-w64-clang-x86_64

Upgraded Packages

PackageFromTo
opam2.2.0-alpha-202212282.2.0
sqlite35.1.0+msvc5.2.0
msys20.1.00.1.0+dkml
conf-pkg-config2+cpkgs3+cpkgs
dkml-host-abi-* (1)1
  • (1) - windows_x86_64 and the other DkML ABIs defined by dkml-c-probe

Patches

PackageWhatIssue
ocaml.4.14.2Backport: Linear-time closure computationhttps://github.com/ocaml/ocaml/pull/12222