2.8 KiB
A fast, portable and opinionated build system
Jbuilder is a build system that was designed to simplify the release
of Jane Street packages. It should however cover the needs of a wide
range of OCaml packages. It reads metadata from jbuild
files
following a very simple s-expression syntax.
Jbuilder comes with a manual. If you want to get started without reading too much, look at the quick start guide.
Overview
Jbuilder is fast, has very low-overhead and supports parallel builds
on all platforms. It has no system dependencies: all you need to build
jbuilder and packages using jbuilder is OCaml. You don't need
make
or bash
as long as the packages themselves don't use bash
explicitely.
This hasn't been tested yet, but in theory one should be able to install OCaml on Windows with a binary installer and then use only the Windows Console to build Jbuilder and packages using Jbuilder.
Features
Multi-package development
Jbuilder supports multi-package development by simply dropping
multiple repositories into the same directory. You just need to create
an empty file jbuild-workspace
to mark the root of your workspace.
Multi-context builds
Jbuilders supports multi-context builds, such as building against several opam roots/switches simultaneously. This helps maintaining packages across several versions of OCaml and gives cross-compilation for free; when you need a program to run on the host, you simply use the one from the corresponding host context.
Defining several packages in one repository
Jbuilder supports building several packages from the same repository. When building via opam, it is able to correctly use already installed libraries instead of the one present in the tarball.
The magic invocation is jbuilder build-package <package>
which starts
by filtering out everything that is part of another opam package.
Develop with jenga, release with jbuilder
Jbuilder is intended as a fast release build system. Eventually we'll have jenga rules that are able to understand the jbuilder rules. This means that one will be able to use jenga as a confortable development build system that knows how to do polling builds or talk to emacs and use jbuilder to release packages with as few requirements as possible.
Status
Jbuilder is still in its infancy and in active development. The CLI is still basic and not well documented.
However, most of the core functionality is already implemented. What you can do right now is write some jbuild files, and invoke jbuilder at the root of your project as follows:
$ jbuilder <package>.install
Building the .install
file will build all the things that need to be
installed.
Roadmap
See /gitea/matthieu/dune/ROADMAP.org for the current plan. Help on any of these points is welcome!