Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/diskuv/dkml-workflows-monorepo-example

Example for dkml-workflows for an Opam Monorepo and Dune build workflow
https://github.com/diskuv/dkml-workflows-monorepo-example

Last synced: 8 days ago
JSON representation

Example for dkml-workflows for an Opam Monorepo and Dune build workflow

Awesome Lists containing this project

README

        

# dkml-workflows-monorepo-example

> **Attention**: This example is not ready for public use yet! Even though this example
> looks like it is working, the `.opam.locked` file was hand-edited. The fix
> is being tracked in [issue opam-monorepo#327](https://github.com/ocamllabs/opam-monorepo/issues/327).

An [Opam Monorepo](https://github.com/ocamllabs/opam-monorepo#readme) example for the
[dkml-workflows] collection of GitHub Action, GitLab CI/CD and desktop workflows. DKML helps you
distribute native OCaml applications on the most common operating systems.
In particular [dkml-workflows] builds:
* Windows libraries and executables with the traditional Visual Studio compiler, avoiding hard-to-debug runtime issued caused by compiler incompatibilities
* macOS libraries and executables for both Intel and ARM64 (Apple Silicon) architectures
* Linux libraries and executables on an ancient "glibc" C library, letting you distribute your software to most Linux users
while avoiding the alternative approach of [static linking the system C library](https://gavinhoward.com/2021/10/static-linking-considered-harmful-considered-harmful/)

The full list of examples is:

| Example | Who For |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [dkml-workflows-monorepo-example](https://github.com/diskuv/dkml-workflows-monorepo-example) | **Not ready for public use yet!**
You want to cross-compile ARM64 on Mac Intel.
You are building [Mirage unikernels](https://mirage.io/). |
| [dkml-workflows-regular-example](https://github.com/diskuv/dkml-workflows-regular-example) | Everybody else |
> Before using these examples be sure to read the [advantages and disadvantages of setup-dkml][dkml-workflows].
> One particular limitation is that, as of today, [dkml-workflows] only supports OCaml 4.12.1.

Expect to wait approximately:

| Build Step | First Time | Subsequent Times |
| -------------------------------------------------------- | ---------- | ---------------- |
| build / win32-windows_x86 | `33m` | `8m` |
| build / win32-windows_x86_64 | `35m` | `11m` |
| build / macos-darwin_all | `26m` | `6m` |
| build / manylinux2014-linux_x86 (CentOS 7, etc.) | `20m` | `5m` |
| build / manylinux2014-linux_x86_64 (CentOS 7, etc.) | `16m` | `5m` |

You can see an example workflow at https://github.com/diskuv/dkml-workflows-monorepo-example/actions/workflows/package.yml

[1] `setup-dkml/macos-darwin_all` is doing double-duty: it is compiling x86_64 and arm64 systems.

For news about Diskuv OCaml,
[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/diskuv.svg?style=social&label=Follow%20%40diskuv)](https://twitter.com/diskuv) on Twitter.

## Differences from the Opam Regular build flow

* Opam Monorepo `pull` was used to pre-download all the Opam packages into the `duniverse/` directory
* The `dkml-base-compiler` and `conf-dkml-cross-toolchain` packages are used to get a cross-compiler for
macOS.
* The [dune-universe](https://github.com/dune-universe/opam-overlays.git) Opam repository was added so
that all Opam packages use Dune as their only build tool

## Outstanding Issues before Public Release

### Opam Monorepo Issues

* Accept `dkml-base-compiler.4.12.1~v1.0.0` instead of just `ocaml-base-compiler.M.N.O`
* `conf-dkml-cross-toolchain` needs to be installed before any of the Dune packages are built; it
provides the ocamlfind toolchains. Is this just `x-opam-monorepo-opam-provided`?

Tracked in [issue opam-monorepo#327](https://github.com/ocamllabs/opam-monorepo/issues/327)

## Sponsor


OCSF logo

Thanks to the OCaml Software Foundation
for economic support to the development of Diskuv OCaml.

## Status

| What | Branch/Tag | Status |
| ---------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Builds and tests | | [![Builds and tests](https://github.com/diskuv/dkml-workflows-monorepo-example/actions/workflows/build.yml/badge.svg)](https://github.com/diskuv/dkml-workflows-monorepo-example/actions/workflows/build.yml) |
| Static checks | | [![Static checks](https://github.com/diskuv/dkml-workflows-monorepo-example/actions/workflows/static.yml/badge.svg)](https://github.com/diskuv/dkml-workflows-monorepo-example/actions/workflows/static.yml) |

[dkml-workflows]: https://github.com/diskuv/dkml-workflows#dkml-workflows