# \[ANN\] DkML Workflows 2.0.x

**URL:** <https://discuss.ocaml.org/t/ann-dkml-workflows-2-0-x/13033>\
**Category:** Ecosystem\
**Tags:** dkml, announce\
**Created:** [September 16, 2023, 4:42pm UTC](https://discuss.ocaml.org/t/ann-dkml-workflows-2-0-x/13033 "2023-09-16T16:42:38Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jbeckford](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jbeckford/32/3027_2.png) [@jbeckford](https://discuss.ocaml.org/u/jbeckford)\
**Post date:** [September 16, 2023, 4:42pm UTC](https://discuss.ocaml.org/t/ann-dkml-workflows-2-0-x/13033/1 "2023-09-16T16:42:38Z")

</div>

DkML Workflows are GitHub Actions, GitLab CI/CD and desktop scripts. Version 2.0.3 is [available today by clicking here](https://github.com/diskuv/dkml-workflows#dkml-workflows). Who is this for?

- If you want to compile _and distribute_ binaries for Windows, Linux and macOS, then the `compilers` workflows may be a good choice for you.
- If you are a _package maintainer_ and want to test that your package compiles with Visual Studio _MSVC_, the Windows `compilers` workflow is a good choice.

I personally use the [setup-ocaml](https://github.com/marketplace/actions/set-up-ocaml) GitHub Action for testing OCaml code, and _additionally_ use DkML Workflows to distribute binaries in my own software like the [Windows/Linux/macOS diskuvbox binaries](https://github.com/diskuv/diskuvbox/releases).

The problems I was trying to solve:

- It has to work with MSVC. It is really easy to distribute binaries on Windows if you use MSVC.
- I grew really really tired of debugging issues remotely in vendor locked GitHub Actions. GitLab CI/CD is not as bad but still not good. I needed the ability to easily run the CI/CD directly on PCs.
- I am not a fan of static linking. IMHO, static linking is an overly complex solution in search of a problem that is only present on Linux (probably due to the [600+ Linux distributions](https://truelist.co/blog/linux-statistics/)). And among other things it complicates security. But …
- I _do_ like static linking’s “easy to deploy” feature: you can static link an executable on your Linux desktop and `scp` to a Linux server. (See “Changes” below)
- I wanted to generate Apple Silicon binaries on Apple x86\_64 CI/CD hardware.

**Changes with 2.0.3** :

- Finally implemented the “easy to deploy” feature. Now the steps for a working CI/CD pipeline are just: 1) edit `.gitignore`, 2) edit `.gitattributes` and 3) copy-and-paste into your terminal.
- Make use of the standardized, upgradable `./dk` script to do all the fetching and creation of scripts.

_Nomenclature: DkML Workflows is a part of DkML, helps to maintain the Windows ecosystem, and has been supported financially by the OCaml Software Foundataion, but is separate from the DkML Installer many people are aware of. I’ll try to distinguish them going forward._

Here is a feature comparison:

| `compilers` | `setup-ocaml` | Consequence |
| --- | --- | --- |
| dkml-base-compiler | ocaml-base-compiler | `compilers` **only supports 4.14.0 today**. `setup-ocaml` supports all versions and variants of OCaml including OCaml 5 |
| GitHub Local Action | GitHub Marketplace Action | `compilers` uses local scripts to implement the GitHub build logic, while `setup-ocaml` is distributed through GitHub Marketplace which is easier to use |
| GitLab CI/CD Local Include | _not supported_ | `compilers` supports GitLab CI/CD |
| Personal Computer Scripts | _not supported_ | `compilers` can generates scripts to simulate CI on your personal computer for troubleshooting |
| MSVC + MSYS2 | GCC + Cygwin | On Windows `compilers` can let your native code use ordinary Windows libraries without ABI conflicts. You can also distribute your executables without the license headache of redistributing or statically linking `libgcc_s_seh` and `libstdc++` |
| dkml-base-compiler | ocaml-base-compiler | On macOS, `compilers` cross-compiles to ARM64 with `dune -x darwin_arm64` |
| CentOS 7 and Linux distros from 2014 | Latest Ubuntu | On Linux, `compilers` builds with an old GLIBC. `compilers` dynamically linked Linux executables will be highly portable as GLIBC compatibility issues should be rare, and compatible with the unmodified LGPL license used by common OCaml dependencies like [GNU MP](https://gmplib.org/manual/Copying) |
| 1 yrs | 4 yrs | `setup-ocaml` is officially supported and well-tested. |
| Some pinned packages | No packages pinned | `compilers`, for some packages, must pin the version so that cross-platform patches (especially for Windows) are available. With `setup-ocaml` you are free to use any version of any package |
| diskuv/diskuv-opam-repository | fdopen/opam-repository | Custom patches for Windows are sometimes needed. `compilers` uses a much smaller set of patches. `setup-ocaml` uses a large but deprecated set of patches. |

---

_[View the full topic](https://discuss.ocaml.org/t/ann-dkml-workflows-2-0-x/13033)._
