Skip to content

Conversation

@Sudha247
Copy link

@Sudha247 Sudha247 commented Dec 2, 2025

This lets Dune package management use build concurrency, which is currently not the case. Currently, when we build the OxCaml compiler with Dune package management, it fails to pick up concurrency and builds on a single thread because of multiple levels of Dune being present. (Dune package on the outside, and the OxCaml compiler itself using Dune to build the compiler). This issue is described here: ocaml/dune#12737.

This could be fixed in Dune by decoupling the environment variable INSIDE_DUNE and build concurrency. We have an open PR for the same: ocaml/dune#12800. However, this alone doesn't fix the issue as the older version of Dune used by the OxCaml compiler doesn't have this fix. A solution until this gets merged into Dune and the version of Dune is updated in OxCaml is to manually unset the environment variable before building. This patch proposes to do that. This brings the build time on par with the opam build. This is building the hello-oxcaml project.

Before patch (Dune package management):

/usr/bin/time dune build
2505.62user 257.63system 32:00.89elapsed 143%CPU (0avgtext+0avgdata 1222984maxresident)k
4851624inputs+19836216outputs (2828major+79527647minor)pagefaults 0swaps

After patch (Dune package management):

/usr/bin/time dune build
3790.35user 348.55system 14:04.00elapsed 490%CPU (0avgtext+0avgdata 1284192maxresident)k
735656inputs+19340176outputs (1111major+81321721minor)pagefaults 0swaps

Opam build:

$ opam sw create 5.2.0+ox
# To update the current shell environment, run: eval $(opam env --switch=test-ox-2)
3700.47user 329.54system 14:21.62elapsed 467%CPU (0avgtext+0avgdata 1223352maxresident)k
2977536inputs+18396640outputs (2227major+79833064minor)pagefaults 0swaps

This lets Dune package management use build concurrency

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
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