Dune 3.25 Tightens OCaml Build Isolation and Unifies Dependency Versions Across Platforms

The OCaml ecosystem received a significant build-system update on November 12, 2026, when the Dune team released Dune 3.25.0. The release changes how build actions discover installed packages, adds filesystem write restrictions on supported Linux kernels and improves package-version selection across platforms. The work addresses a challenge shared with Rust’s evolving Cargo dependency controls: software must declare and manage the inputs needed to build reliably.

From implicit dependencies to declared inputs

A build system translates source files, package definitions and compiler options into executable programs or libraries. If a test or generator can silently access a package installed by a different build step, the dependency graph becomes incomplete. The build might pass on a developer’s workstation and fail on a clean continuous-integration worker because the latter lacks the incidental package.

Dune 3.25 removes the shared installation staging area from the environment exposed to build actions. Actions requiring packages now need explicit package dependencies, including when a documentation test loads a library or a rule calls another installed tool. The declared packages and their library dependency closure determine the relevant environment. Developers migrating an existing project should review failed tests and generators for undeclared requirements rather than restoring unrestricted access to every installed package.

The following OCaml Workshop presentation explains the earlier introduction of package management directly into Dune:

Operating-system enforcement

Projects selecting Dune language version 3.25 gain additional write restrictions for sandboxed actions on Linux systems supporting Landlock ABI version 3 or later. Landlock is a kernel mechanism that allows processes to restrict their own access to filesystem resources. The release limits writes to designated sandbox, temporary and action-trace locations, together with the documented device-directory exception. The protection is conditional on the operating system and project configuration; it does not establish complete network isolation or guarantee that arbitrary third-party code is safe.

Build isolation also matters when teams accelerate their toolchains. Our coverage of parallel Rust compiler checking illustrates why dependency correctness must remain independent of execution order. Dune now allows RPC build requests to proceed concurrently rather than placing them in a queue, while watch servers can accept additional forwarded requests. The release also displays batch-build duration and average process parallelism. No universal speedup is claimed by the changelog.

The following earlier tutorial introduces a typical Dune project workflow:

One dependency version across platforms

Portable lock directories now select a package version that satisfies every requested platform, failing when no common version exists. Consider a library that requires one release on Linux but an incompatible release on another platform. Rejecting the inconsistent lock configuration exposes the conflict before separate builds produce incompatible artifacts. Teams should still test each target because platform-specific compiler, system-library and runtime differences remain possible.

Generated files are now read-only even for projects using older Dune language versions, and shell completion has been expanded. The official first-program tutorial documents the basic compile-and-run workflow. The following historical introduction covers Jbuilder, the predecessor name of Dune, rather than the new release:

The release’s compatibility changes warrant staged adoption. The experience of Rust’s recent iterator regression correction demonstrates why maintainers should distinguish new features from migration risk. Dune users can evaluate clean builds, test outcomes and repeatability across supported targets, much as SmartChart’s expanded Python toolchain depends on repeatable execution and valid inputs. The November update strengthens the structure of OCaml builds; actual performance and compatibility remain project-specific.

Cover reference: OCaml Workshop 2025 presentation thumbnail, historical context.

We volunteer daily to ensure the credibility of the information on this platform is Verifiably True. If you would like to support to help further secure the integrity of our research initiatives, please scan the QR code below.

BitcoinVersus.Tech donation QR code

Leave a Reply