From 41f8fff63687de56a8693a8add4ad1af9e8060b5 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Thu, 8 Jan 2026 17:44:08 +0100 Subject: [PATCH 1/7] Wip regroup locks in single file --- dune-workspace.ci | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 dune-workspace.ci diff --git a/dune-workspace.ci b/dune-workspace.ci new file mode 100644 index 0000000..b70f807 --- /dev/null +++ b/dune-workspace.ci @@ -0,0 +1,67 @@ +(lang dune 3.20) + +(pkg enabled) + +(context + (default + (lock_dir dune.lock))) + +(lock_dir + (path dune.lock) + (repositories overlay upstream alpha mbarbin)) + +(context + (default + (name default-5.4) + (lock_dir dune-5.4.lock))) + +(lock_dir + (path dune-5.4.lock) + (repositories overlay upstream alpha mbarbin) + (constraints + (ocaml + (= 5.4.0)))) + +(context + (default + (name default-5.3) + (lock_dir dune-5.3.lock))) + +(lock_dir + (path dune-5.3.lock) + (repositories overlay upstream mbarbin) + (constraints + (ocaml + (= 5.3.0)))) + +(context + (default + (name default-5.2) + (lock_dir dune-5.2.lock))) + +(lock_dir + (path dune-5.2.lock) + (repositories overlay upstream mbarbin) + (constraints + (ocaml + (= 5.2.1)))) + +(context + (default + (name default-4.14) + (lock_dir dune-4.14.lock))) + +(lock_dir + (path dune-4.14.lock) + (repositories overlay upstream mbarbin) + (constraints + (ocaml + (= 4.14.2)))) + +(repository + (name mbarbin) + (url "git+https://github.com/mbarbin/opam-repository.git")) + +(repository + (name alpha) + (url "git+https://github.com/kit-ty-kate/opam-alpha-repository.git")) From 094ed57baa4170cb8ed7f9033f8a8310ca7b34cc Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Thu, 8 Jan 2026 17:44:40 +0100 Subject: [PATCH 2/7] Add bug report --- repro.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 repro.md diff --git a/repro.md b/repro.md new file mode 100644 index 0000000..27cf79a --- /dev/null +++ b/repro.md @@ -0,0 +1,10 @@ +At rev: 41f8fff63687de56a8693a8add4ad1af9e8060b5 + +```sh +$ dune-pkg build --workspace=dune-workspace.ci --display=short --only-packages=fpath-sexp0 +... +File "dune.lock/ocaml-compiler.5.4.0.pkg", line 9, characters 8-15: +Error: Logs for package ocaml-compiler +/usr/bin/install: cannot create regular file '/home/mathieu/.cache/dune/toolchains/ocaml-compiler.5.4.0-913d1c0e16c16baef7f099ae5b9afd32/target/bin/ocamlc.byte': File exists +gmake: *** [Makefile:2670: install] Error 1 +``` From 5e322a3a65d98f030856f5e41d581992d2e2406b Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Thu, 8 Jan 2026 17:45:29 +0100 Subject: [PATCH 3/7] Add bug report --- dune-workspace.ci | 8 -------- repro.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/dune-workspace.ci b/dune-workspace.ci index b70f807..25bcea0 100644 --- a/dune-workspace.ci +++ b/dune-workspace.ci @@ -2,14 +2,6 @@ (pkg enabled) -(context - (default - (lock_dir dune.lock))) - -(lock_dir - (path dune.lock) - (repositories overlay upstream alpha mbarbin)) - (context (default (name default-5.4) diff --git a/repro.md b/repro.md index 27cf79a..8aee011 100644 --- a/repro.md +++ b/repro.md @@ -8,3 +8,35 @@ Error: Logs for package ocaml-compiler /usr/bin/install: cannot create regular file '/home/mathieu/.cache/dune/toolchains/ocaml-compiler.5.4.0-913d1c0e16c16baef7f099ae5b9afd32/target/bin/ocamlc.byte': File exists gmake: *** [Makefile:2670: install] Error 1 ``` + +---- + +```sh +$ dune-pkg build --workspace=dune-workspace.ci --display=short --only-packages=fpath-sexp0 +Internal error, please report upstream including the contents of _build/log. +Description: + ("[gen_rules] did not specify rules for the context", + { context_name = "_private" }) +Raised at Stdune__Code_error.raise in file "stdune__Code_error.ml", line 11, + characters 30-62 +Called from Fiber__Scheduler.exec in file "fiber__Scheduler.ml", line 77, + characters 8-11 +-> required by ("gen-rules", In_build_dir "_private/default") +-> required by ("gen-rules", In_build_dir "_private/default/.lock") +-> required by ("load-dir", In_build_dir "_private/default/.lock") +-> required by + ("build-file", In_build_dir "_private/default/.lock/dune-4.14.lock") +-> required by ("", ()) +-> required by ("", ()) +-> required by ("gen-rules", In_build_dir "default-4.14") +-> required by ("load-dir", In_build_dir "default-4.14") +-> required by + ("build-alias", { dir = In_build_dir "default-4.14"; name = "default" }) +-> required by ("toplevel", ()) + +I must not crash. Uncertainty is the mind-killer. Exceptions are the +little-death that brings total obliteration. I will fully express my cases. +Execution will pass over me and through me. And when it has gone past, I +will unwind the stack along its path. Where the cases are handled there will +be nothing. Only I will remain. +``` From 629b7a0e3ce67120b4c9edd827e3017649995abf Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Thu, 8 Jan 2026 17:46:53 +0100 Subject: [PATCH 4/7] Add default context --- dune-workspace.ci | 4 ++++ repro.md | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/dune-workspace.ci b/dune-workspace.ci index 25bcea0..a620e56 100644 --- a/dune-workspace.ci +++ b/dune-workspace.ci @@ -2,6 +2,10 @@ (pkg enabled) +(context + (default + (lock_dir dune-5.4.lock))) + (context (default (name default-5.4) diff --git a/repro.md b/repro.md index 8aee011..92849c1 100644 --- a/repro.md +++ b/repro.md @@ -1,3 +1,5 @@ +# Repro 1 + At rev: 41f8fff63687de56a8693a8add4ad1af9e8060b5 ```sh @@ -11,6 +13,10 @@ gmake: *** [Makefile:2670: install] Error 1 ---- +# Repro 2 + +At rev: 5e322a3a65d98f030856f5e41d581992d2e2406b + ```sh $ dune-pkg build --workspace=dune-workspace.ci --display=short --only-packages=fpath-sexp0 Internal error, please report upstream including the contents of _build/log. From 229176cd06276d1fef6861dea37992b8a12686ed Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Thu, 8 Jan 2026 17:48:40 +0100 Subject: [PATCH 5/7] Add another report --- repro.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/repro.md b/repro.md index 92849c1..12f43f7 100644 --- a/repro.md +++ b/repro.md @@ -46,3 +46,36 @@ Execution will pass over me and through me. And when it has gone past, I will unwind the stack along its path. Where the cases are handled there will be nothing. Only I will remain. ``` + +# Repro 3 + +At rev: 629b7a0e3ce67120b4c9edd827e3017649995abf + +```sh +$ dune-pkg build --workspace=dune-workspace.ci --display=short --only-packages=fpath-sexp0,fpath-base +File "default/.lock/_unknown_", line 1, characters 0-0: +Error: Couldn't solve the package dependency formula. +Selected candidates: astring.0.8.5 base.v0.17.3 base-unix.base csexp.1.5.2 + dune-configurator.3.20.2 fpath.0.7.3 fpath-base.dev + fpath-sexp0.dev ocaml_intrinsics_kernel.v0.17.1 + ocamlbuild.0.16.1+dune ocamlfind.1.9.8+dune + sexplib0.v0.17.0 topkg.1.1.1 fpath-base&fpath-sexp0 +- dune -> dune.3.22 + User requested = 3.22 +- ocaml -> (problem) + No usable implementations: + ocaml.5.5.0: + Package does not satisfy constraints of local package fpath-sexp0 + ocaml.5.4.1: + Package does not satisfy constraints of local package fpath-sexp0 + ocaml.5.4.0: + Package does not satisfy constraints of local package fpath-sexp0 + ocaml.5.3.1: + Package does not satisfy constraints of local package fpath-sexp0 + ocaml.5.3.0: + Package does not satisfy constraints of local package fpath-sexp0 + ... +``` + +The error is confusing, I would expect it to explain that `fpath-base` is not +available in the context `4.14` which is built by default. From 05816c57006a11b8a061cd94526a0709f486cd5a Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Thu, 8 Jan 2026 17:49:36 +0100 Subject: [PATCH 6/7] Add dune version and a question --- repro.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/repro.md b/repro.md index 12f43f7..d50cc81 100644 --- a/repro.md +++ b/repro.md @@ -1,3 +1,13 @@ +# Dune version + +`dune-pkg` is a nightly built dune available in my PATH: + +```sh +$ dune-pkg --version +"Nightly build 2026-01-08T02:56:04Z, git revision +ddefc9902ce3fbc7dcfadda5c2c8594d236868c0" +``` + # Repro 1 At rev: 41f8fff63687de56a8693a8add4ad1af9e8060b5 @@ -79,3 +89,9 @@ Selected candidates: astring.0.8.5 base.v0.17.3 base-unix.base csexp.1.5.2 The error is confusing, I would expect it to explain that `fpath-base` is not available in the context `4.14` which is built by default. + +# Question? + +If `dune build` builds all context available, but not all packages are available +on all contextes (like this is the case here), question is: how do you organize +your CI? From dda37bc9d9a6fa693269802bc069d014d9333e63 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Fri, 9 Jan 2026 10:39:05 +0100 Subject: [PATCH 7/7] Add 2 more repro using build _build// --- repro.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/repro.md b/repro.md index d50cc81..70f4489 100644 --- a/repro.md +++ b/repro.md @@ -95,3 +95,80 @@ available in the context `4.14` which is built by default. If `dune build` builds all context available, but not all packages are available on all contextes (like this is the case here), question is: how do you organize your CI? + +# Repro 4 + +At rev: 05816c57006a11b8a061cd94526a0709f486cd5a + +```sh +$ dune-pkg build --workspace=dune-workspace.ci _build/default-5.3/@all --display=short --only-packages=fpath-sexp0 +Error: Don't know how to build _build/default-5.3/@all +``` + +# Repro 5 + +At rev: 05816c57006a11b8a061cd94526a0709f486cd5a + +```sh +$ dune-pkg build --workspace=dune-workspace.ci _build/default-5.3/@all --display=short +File "default/.lock/_unknown_", line 1, characters 0-0: +Error: Couldn't solve the package dependency formula. +Selected candidates: astring.0.8.5 base.v0.17.3 base-bytes.base + base-unix.base base64.3.5.2 bigstringaf.0.10.0 brr.0.0.8 + camlp-streams.5.0.1 checkseum.0.5.2 cmdliner.2.1.0 + cppo.1.8.0 crunch.4.0.0 csexp.1.5.2 decompress.1.5.3 + dune-build-info.3.20.2 dune-configurator.3.20.2 + dyn.3.20.2 either.1.0.0 fix.20250919 fmt.0.11.0 + fpath.0.7.3 fpath-base.dev fpath-base-dev.dev + fpath-base-tests.dev fpath-sexp0.dev gen.1.1 + jane-street-headers.v0.17.0 js_of_ocaml.6.2.0 + js_of_ocaml-compiler.6.2.0 js_of_ocaml-toplevel.6.2.0 + jst-config.v0.17.0 logs.0.10.0 lwt.5.9.2 mdx.2.5.1 + menhir.20250912 menhirCST.20250912 menhirLib.20250912 + menhirSdk.20250912 ocaml-compiler-libs.v0.17.0 + ocaml-version.4.0.3 ocaml_intrinsics_kernel.v0.17.1 + ocamlbuild.0.16.1+dune ocamlfind.1.9.8+dune + ocamlformat.0.28.1 ocamlformat-lib.0.28.1 + ocp-indent.1.9.0 ocplib-endian.1.2 octavius.1.2.2 + odoc.3.1.0 odoc-parser.3.1.0 optint.0.3.0 + ordering.3.20.2 pp.2.0.0 ppx_assert.v0.17.0 + ppx_base.v0.17.0 ppx_blob.0.9.0 ppx_cold.v0.17.0 + ppx_compare.v0.17.0 ppx_derivers.1.2.1 + ppx_enumerate.v0.17.0 ppx_expect.v0.17.3 + ppx_globalize.v0.17.2 ppx_hash.v0.17.0 ppx_here.v0.17.0 + ppx_inline_test.v0.17.1 ppx_js_style.v0.17.1 + ppx_optcomp.v0.17.1 ppx_sexp_conv.v0.17.1 ppxlib.0.37.0 + ppxlib_jane.v0.17.4 ptime.1.2.0 re.1.14.0 result.1.5 + sedlex.3.7 seq.base sexplib0.v0.17.0 sherlodoc.3.1.0 + stdio.v0.17.0 stdlib-shims.0.3.0 time_now.v0.17.0 + topkg.1.1.1 tyxml.4.6.0 uucp.17.0.0 uuseg.17.0.0 + uutf.1.0.4 yojson.3.0.0 + fpath-base&fpath-base-dev&fpath-base-tests&fpath-sexp0 +- bisect_ppx -> (problem) + Rejected candidates: + bisect_ppx.2.8.3: Requires cmdliner >= 1.0.0 & < 2.0.0 + bisect_ppx.2.8.2: + Package does not satisfy constraints of local package fpath-base-dev + bisect_ppx.2.8.1: + Package does not satisfy constraints of local package fpath-base-dev + bisect_ppx.2.8.0: + Package does not satisfy constraints of local package fpath-base-dev + bisect_ppx.2.7.1: + Package does not satisfy constraints of local package fpath-base-dev + ... +- dune -> dune.3.22 + User requested = 3.22 +- ocaml -> (problem) + No usable implementations: + ocaml.5.5.0: + Package does not satisfy constraints of local package fpath-sexp0 + ocaml.5.4.1: + Package does not satisfy constraints of local package fpath-sexp0 + ocaml.5.4.0: + Package does not satisfy constraints of local package fpath-sexp0 + ocaml.5.3.1: + Package does not satisfy constraints of local package fpath-sexp0 + ocaml.5.3.0: + Package does not satisfy constraints of local package fpath-sexp0 + ... +```