Skip to content

Github action to build releases with Dune package management#668

Merged
djs55 merged 6 commits into
moby:masterfrom
tarides:dune-pkg
May 26, 2026
Merged

Github action to build releases with Dune package management#668
djs55 merged 6 commits into
moby:masterfrom
tarides:dune-pkg

Conversation

@Leonidas-from-XIV
Copy link
Copy Markdown
Contributor

@Leonidas-from-XIV Leonidas-from-XIV commented May 25, 2026

This PR is an update of the earlier #653 from @gridbugs and incorporates many of Steve's improvements that I have lately upstreamed recently.

As such the main parts are:

  1. A Github action that uses setup-dune to download and install Dune, build the dependencies, the project and finally distribution tarballs that are uploaded to the release page on GitHub.
  2. A lock directory that encodes a solution to building vpnkit without having to set up an OPAM switch, using entirely the Dune package management functionality. Unfortunately the package versions required are quite old (this is being worked on in Upgrading Mirage Packages #646) thus it requires the opam repository archive repository. Unfortunately that repository caps the Dune version at 3.19.1 thus making it impossible to use a modern dune with them (reported by @gridbugs in Upper bounds on the "dune" package prevent dune package management from solving dependencies ocaml/opam-repository-archive#30, possible workaround in Dune discussed in dune should ignore upper bounds on dune ocaml/dune#14637). Thus this PR uses https://github.com/tarides/moby-vpnkit-opam-repository-archive which is a fork of the opam-repository-archive with the Dune constraint removed.

An example can be seen in my testing fork on https://github.com/tarides/moby-vpnkit/releases/tag/2026-05-25.1 where the release was created using the GitHub UI and it automatically triggered the run of this release action which used the locked solution and uploaded the generated tarball to the release automatically. The build took 5 minutes on platforms with fast Github Action runners and a bit under 20 minutes on platforms with slower runners.

cc @djs55

Closes #653.

gridbugs and others added 6 commits May 26, 2026 11:29
This adds a dune lockdir to the project and a github action where
pushing a tag causes a vpn binary distribution to be built for linux and
macos, and released to the github "releases" page.

Also fixes a few minor issues which prevented the project from building
with the locked versions of dependencies.

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
@Leonidas-from-XIV Leonidas-from-XIV marked this pull request as ready for review May 26, 2026 09:58
@Leonidas-from-XIV
Copy link
Copy Markdown
Contributor Author

I've fixed the issue I discovered yesterday (broke docker build because there's no Dune 3.19 in the base image) in #669, so after rebasing I think this one should be ready to review.

@djs55 djs55 merged commit 18edfda into moby:master May 26, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants