Skip to content

[3.23.1] backport #14443 - #14465

Merged
Alizter merged 1 commit into
3.23.1-rcfrom
backport-14443
May 11, 2026
Merged

Alizter merged 1 commit into
3.23.1-rcfrom
backport-14443

Conversation

@shonfeder

Copy link
Copy Markdown
Member

Backport #14443 onto 3.23.1-rc

…itches (#14443)

The secondary compiler fallback in bootstrap.ml was broken in two ways:

1. It invoked `ocamlfind -toolchain secondary ocaml`, but `ocamlfind`
does not support the `ocaml` toplevel as a subcommand. Only compiler
tools like `ocamlc` and `ocamlopt`. We now query `ocamlfind -toolchain
secondary query ocaml -format "%d"` to locate the secondary compiler's
bin directory and invoke `ocaml` and `ocamllex` from there directly.

2. The secondary `ocaml` toplevel would pick up the primary switch's
`unix.cma` and `dllunix.so`, which are ABI-incompatible. We now pass
`-I` for the secondary compiler's lib directory and set
`CAML_LD_LIBRARY_PATH` to its stublibs directory.

The opam constraint is restored to the historical pattern, allowing dune
to be installed on switches with OCaml >= 4.02 via ocamlfind-secondary:

```
  ("ocaml" {>= "4.14"} | ("ocaml" {>= "4.02" & < "4.14~~"} & "ocamlfind-secondary"))
```

Tested on OCaml 4.02.3 and 4.13.1 switches with ocaml-secondary-compiler
4.14.2.

- Fixes #13908

(cherry picked from commit 9e65007)
Signed-off-by: Shon Feder <[email protected]>
@shonfeder shonfeder mentioned this pull request May 9, 2026
20 tasks done
@shonfeder
shonfeder requested a review from Alizter May 9, 2026 02:48
@robinbb robinbb assigned robinbb and unassigned robinbb May 9, 2026
@Alizter
Alizter merged commit 5718977 into 3.23.1-rc May 11, 2026
30 checks passed
@Alizter
Alizter deleted the backport-14443 branch May 11, 2026 19:04
@Alizter Alizter added this to the 3.23.1 milestone Jul 8, 2026
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.

3 participants