Skip to content

fix(pkg): set OPAMSWITCH in package build environment#13888

Merged
Alizter merged 1 commit intoocaml:mainfrom
Alizter:push-vspstntrvqyz
Mar 23, 2026
Merged

fix(pkg): set OPAMSWITCH in package build environment#13888
Alizter merged 1 commit intoocaml:mainfrom
Alizter:push-vspstntrvqyz

Conversation

@Alizter
Copy link
Copy Markdown
Collaborator

@Alizter Alizter commented Mar 23, 2026

The relocatable compiler's (OCaml 5.5) process.sh script references $OPAMSWITCH. Since dune is not opam, set it to a value that allows the script to progress. It doesn't matter if this switch actually exists, since other mechanisms in the script will cause it to abort early and avoid cloning the compiler switch.

https://github.com/ocaml/ocaml/blob/trunk/tools/opam/process.sh

This is now being used in the opam file for the compiler:

https://github.com/ocaml/opam-repository/blob/63b7ba71be83567e54bb667df0f2bb374d74fb61/packages/ocaml-compiler/ocaml-compiler.5.5.0~alpha1/opam#L62

Copy link
Copy Markdown
Member

@rgrinberg rgrinberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test for this would be good.

Fixes ocaml#13887

The relocatable compiler's process.sh script references $OPAMSWITCH.
Since dune is not opam, set it to a value that allows the script to
progress. It doesn't matter if this switch actually exists, since
other mechanisms in the script will cause it to abort early and avoid
cloning the compiler switch.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter force-pushed the push-vspstntrvqyz branch from 2e16945 to c8a8ff2 Compare March 23, 2026 11:23
@Alizter Alizter merged commit a58457e into ocaml:main Mar 23, 2026
27 of 29 checks passed
@Alizter Alizter deleted the push-vspstntrvqyz branch March 23, 2026 16:11
@Alizter Alizter mentioned this pull request Mar 24, 2026
14 tasks
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.

Set OPAMSWITCH in dune when building compiler

2 participants