ocaml / ocaml/dune

First-class cross-compilation via dune package management

Open
#14,731 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cross-compilation package management
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Several months ago, @gridbugs drafted a document, Proposal for First-Class Cross-Compilation in Dune. The document proposes changes to Dune to allow cross-compiling projects, summarized as follows:

Dune’s existing cross-compilation support works by changing the findlib toolchain used to build the project. This requires all of the project’s library dependencies to be ported to separate opam packages which are configured to build with the desired toolchain (often in an overlay opam repo), and the installation of an OCaml cross-compiler into the environment visible to findlib (usually installed by opam).

Dune’s package-management features allow Dune to orchestrate the build of a project’s entire dependency closure, including the OCaml compiler. This presents an opportunity for Dune to automatically cross-compile a project’s library dependencies without the need for explicit ports of library packages, and for Dune to install the appropriate OCaml cross-compiler. The automation of the installation of a cross-compiler and the ability to cross-compile unmodified opam packages will be referred to as “First-Class Cross-Compilation”.

This issues is to track and expand discussion of, and planning around, that proposal.

Design work on this should also consider @samoht's RFC: Toolchains.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Proposal for First-Class Cross-Compilation in Dune and the RFC: Toolchains, then compare their proposed approaches with Dune's existing cross-compilation and package-management behavior. No repository files, tests, or implementation entry points are named; done means reaching and documenting an agreed design and plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.