caml-list - the Caml user's mailing list
 help / Atom feed
From: Kenichi Asai <>
To: Gabriel Scherer <>
Cc: caml users <>
Subject: Re: [Caml-list] Local switch using opam 2
Date: Sat, 13 Apr 2019 20:15:15 +0900
Message-ID: <> (raw)
In-Reply-To: <>

Dear Gabriel,

> Our short-term plan is to merge opam file in the OCaml compiler distribution so
> that "opam pin ." or "opam install ." or "opam switch create ." works as for
> any other opam packages. There is an in-progress proposal by Leo White in
> ; before that gets finished and
> integrated, please feel free to download the patch proposed and use it locally.

Thank you.  It worked.  For record, I write what I did:

- create a directory containing the OCaml distribution
- change it as I want
- at the top directory of the OCaml distribution,
  * place ocaml-variants.opam as found in the above pull request
  * opam switch create . --empty
  * opam install .

However, I found that this local switch is valid only in the above
directory and I cannot set it as my default OCaml compiler.

So, I looked around the .opam directory and found this low-level thing
that corresponds to what I did for opam 1.2:

cd ~/.opam/repo
rm state.cache  -- necessary to include the following new variant info
cd default/packages/ocaml-variants/
mkdir ocaml-variants.4.04.0+my-own-variant
cd ocaml-variants.4.04.0+my-own-variant

Then, I place the opam file in this directory that designates the
base OCaml compiler and the url of the patch I want to apply.  I could
find many examples of opam files under


I then execute:

opam switch install 4.04.0+my-own-variant

and it worked as though it is one of the standard ocaml variants.

Kenichi Asai

      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10  0:35 Kenichi Asai
2019-04-10  9:08 ` Gabriel Scherer
2019-04-13 11:15   ` Kenichi Asai [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror

AGPL code for this site: git clone public-inbox