From 02d5dd97d1ada2014b8570e8ee4e85a3d2e4bd81 Mon Sep 17 00:00:00 2001 From: Kate Date: Tue, 4 Nov 2025 21:20:14 +0000 Subject: [PATCH 1/2] Document how to create a switch with some OCaml compiler configure-time options Co-authored-by: Florian Angeletti --- doc/pages/Usage.md | 12 ++++++++++++ master_changes.md | 1 + 2 files changed, 13 insertions(+) diff --git a/doc/pages/Usage.md b/doc/pages/Usage.md index 551f856a222..a467f4bbf21 100644 --- a/doc/pages/Usage.md +++ b/doc/pages/Usage.md @@ -121,6 +121,18 @@ or set of opam packages. Creating a new switch requires re-compiling OCaml, unless you use the `ocaml-system` package, that relies on the global OCaml installation. +When using the default [opam-repository](https://github.com/ocaml/opam-repository/), +if you want to tweak the configuration of the compiler, you can switch to the option variant with: +``` +opam switch create ocaml-variants.+options ... +``` + +where `` is a space separated list of `ocaml-option-*` packages. +For instance, to create a switch with OCaml 5.4.0 with both `flambda` and `no-flat-float-array` enabled: +``` +opam switch create 5.4.0+flambda+nffa ocaml-variants.5.4.0+options ocaml-option-flambda ocaml-option-no-flat-float-array +``` + ### opam pin This command allows one to pin a package to a specific version, but has been diff --git a/master_changes.md b/master_changes.md index 71c61b0555f..cc18992027e 100644 --- a/master_changes.md +++ b/master_changes.md @@ -114,6 +114,7 @@ users) ## Github Actions ## Doc + * Document how to create a switch with some OCaml compiler configure-time options [#6777 @kit-ty-kate - fix #6645] ## Security fixes From c3a986513b423f8ea511101b607fb9ce805114c0 Mon Sep 17 00:00:00 2001 From: "R. Boujbel" Date: Mon, 10 Nov 2025 15:46:59 +0100 Subject: [PATCH 2/2] Update doc/pages/Usage.md Co-authored-by: David Allsopp --- doc/pages/Usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/pages/Usage.md b/doc/pages/Usage.md index a467f4bbf21..e2bed12f9c1 100644 --- a/doc/pages/Usage.md +++ b/doc/pages/Usage.md @@ -127,7 +127,7 @@ if you want to tweak the configuration of the compiler, you can switch to the op opam switch create ocaml-variants.+options ... ``` -where `` is a space separated list of `ocaml-option-*` packages. +where `` is a space-separated list of `ocaml-option-*` packages. For instance, to create a switch with OCaml 5.4.0 with both `flambda` and `no-flat-float-array` enabled: ``` opam switch create 5.4.0+flambda+nffa ocaml-variants.5.4.0+options ocaml-option-flambda ocaml-option-no-flat-float-array