Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for building with Dune #546

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Niggelgame
Copy link

This is built upon the development of #345 to support building (most of) Compcert with the Dune build system.

It resolves the issues mentioned in the original draft, especially building for all architectures, while keeping all the mentioned advantages of dune.

Each architecture is built in the respective _build/ directory (dune calls these context), by overwriting the TARGET_PLATFORM environment variable. This variable controls which platform code is then used to compile and extract the Coq/ML sources.
The "default" context relies on a set TARGET_PLATFORM enviroment variable. A specific context can be built by running
dune build _build/<context>. If no context is specified (i.e. dune build), all platforms are build at once.

The project is split up into 4 packages: compcert (The compiler package producing the binary), MenhirLib, Flocq and documentation (generates documentation using coq2html). All of them are build by default. By not specifying MenhirLib or Flocq, dune will try to find them in the coq library search path. To build only specified packages, run dune with the -p flag, e.g. dune build _build/arm -p compcert.

To allow windows-native builds, the configure script is running a translated OCaml version of the original script (with some limited features missing, which I would be open to implement as well - see TODOs in tools/configure.ml).
It also generates the _CoqProject file, which references to the "default" build context files (After building all contexts, just switching this reference allows for quick platform changes without full recompilation in development).

The runtime is still compiled using the Makefile.

At the moment the original Makefile build system is partially broken (due to some moved files & changed imports), which I would be open to fix if wanted.

I would be happy to hear some thoughts.

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.

1 participant