Skip to content

Switch to dune 3.23#2231

Open
vouillon wants to merge 7 commits into
masterfrom
dune-3.23
Open

Switch to dune 3.23#2231
vouillon wants to merge 7 commits into
masterfrom
dune-3.23

Conversation

@vouillon
Copy link
Copy Markdown
Member

@vouillon vouillon commented May 5, 2026

@vouillon vouillon force-pushed the dune-3.23 branch 4 times, most recently from 3c3054f to 0442ff6 Compare May 6, 2026 17:29
@vouillon vouillon marked this pull request as ready for review May 6, 2026 19:14
Comment thread compiler/tests-ocaml/basic-io/dune Outdated
@hhugo
Copy link
Copy Markdown
Member

hhugo commented May 7, 2026

dune 3.23.1 will hopefully restore compatibility with ocaml 4.13. See ocaml/dune#14443

@vouillon vouillon marked this pull request as draft May 7, 2026 08:17
@hhugo hhugo added the blocked label May 7, 2026
@hhugo hhugo mentioned this pull request May 18, 2026
6 tasks
@vouillon vouillon force-pushed the dune-3.23 branch 3 times, most recently from 4ee0d13 to 7c38303 Compare May 19, 2026 21:34
@vouillon vouillon removed the blocked label May 19, 2026
@hhugo hhugo marked this pull request as ready for review May 20, 2026 06:53
@hhugo
Copy link
Copy Markdown
Member

hhugo commented May 20, 2026

Can this be merged ?

@vouillon
Copy link
Copy Markdown
Member Author

Can this be merged ?

I think it is ready. But I'm wondering whether this should go in Js_of_ocaml 9.4. Maybe I can make a separate PR with just the last commit, which ensures a consistent behavior with all versions of dune?

@hhugo
Copy link
Copy Markdown
Member

hhugo commented May 20, 2026

Can this be merged ?

I think it is ready. But I'm wondering whether this should go in Js_of_ocaml 9.4. Maybe I can make a separate PR with just the last commit, which ensures a consistent behavior with all versions of dune?

I don't understand what you mean. With this PR, one now depend on dune.3.23.1.

@vouillon
Copy link
Copy Markdown
Member Author

We don't really need dune 3.23.1 for the next release. So, maybe we should wait a bit before merging this PR?

@hhugo
Copy link
Copy Markdown
Member

hhugo commented May 20, 2026

We don't really need dune 3.23.1 for the next release. So, maybe we should wait a bit before merging this PR?

I see what you mean. Changes in this PR are about lang dune 3.23 which changes sandboxing behavior for user's rules. We can hold on this PR for now. But we still need a fix, CI is currently broken on master with dune 3.23.1.

@hhugo
Copy link
Copy Markdown
Member

hhugo commented May 21, 2026

@vouillon, should we push the other commits now ? (gen-rules + updated deps in tests)

@vouillon vouillon force-pushed the dune-3.23 branch 2 times, most recently from 102d7c0 to 20acd27 Compare May 22, 2026 09:51
Dune 3.23 forces sandboxing on user rules, so gen.exe runs from
_build/.sandbox/<hash>/default/<dir> instead of the project tree.
The previous prefix walker (stop when parent ends with _build) then
yielded <hash>/default/<dir>/, which both shows up in the generated
;; comment and shifts the Hashtbl.hash-based name suffix, making the
runtest diff against the checked-in dune.inc fail.

Take the project-relative directory as argv.(1) (replacing the
previously unused library-name argument) so the prefix is stable
regardless of where dune runs the action.
vouillon added 6 commits May 22, 2026 17:49
The current release of ocaml-dune-lint is not compatible with dune 3.23.
Under dune 3.23 sandboxing, rules that run a *.bc.wasm.js file also
need to depend on the companion *.bc.wasm.assets/ directory so that
the .wasm files are copied into the sandbox.
Under dune 3.23 sandboxing, rules invoking js_of_ocaml or wasm_of_ocaml
with --toplevel need their .cmi files brought into the sandbox.

For locally built cmis, declare them as deps. For library cmis, add
a cmi_include_dirs.txt rule (mirroring the existing one for toplevel.bc)
that uses ocamlfind to produce -I flags, and pass the result via
read-strings.
Under dune 3.23 sandboxing, wc.ml needs to be brought into the
sandbox. Inline the dep with %{dep:wc.ml} on the command line.
It uses `js_of_ocaml --build-config` to manage config details.
oxcaml-dune-patches pins dune <= 3.21, but the project requires
dune >= 3.23. opam re-checks dependency constraints on every install,
so a one-shot --ignore-constraints-on=dune flag isn't enough.

Re-pin the package with the dune version constraint stripped, so
subsequent installs let dune resolve to 3.23.x normally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants