[opam-devel] [ocaml-platform] A small script for compiler hackers: create short-lived opam switches out of any git branch

Thomas Gazagnaire thomas at ocamlpro.com
Mon Mar 18 16:21:24 GMT 2013

> Compiler patches don't exist at the moment within OPAM, but I like Gabriel's
> approach of taking an existing tree (that's, e.g., a git repo) and moving
> it into the OPAM space.  You can just use the underlying VCS to track your
> patches and branches without requiring more complexity in OPAM.

Not true :-)

You can use

patches: [ ... ]

in your compiler files as well. See: https://github.com/OCamlPro/opam/blob/master/src/core/opamFile.ml#L1167

The patch can be local or available via HTTP.


> -anil
>> Gabriel Scherer <gabriel.scherer at gmail.com> writes:
>>> As part of the slowly-evolving benchmark work, I have developed a
>>> script to turn any repository that quacks like an OCaml compiler and
>>> can run "make world.opt" into an OPAM compiler switch.
>>> https://github.com/gasche/opam-compiler-conf
>>> The intended use case is to change something, recompile what need be,
>>> get a compiler switch for that, and install one or two packages for
>>> testing something. You could envision, for example, OPAM being used in
>>> the internal loop of a bisection process. In this case it is important
>>> that OPAM does not recompile the compiler on its side (so the usual
>>> technique of making a tarball of the compiler source and letting OPAM
>>> do its job from there is not pleasant in that situation); the scripts
>>> makes use of voodoo OPAM compiler options (thanks to Thomas in
>>> https://github.com/OCamlPro/opam/pull/519 ) to have it just run "make
>>> install" each time "opam switch reinstall" is called.
>>> This is a quick&dirty shell script that works on my machine. No
>>> guarantee that it will work on yours. It also assumes that the
>>> version-control system (VCS) used is git, and calls "git branch" to
>>> infer the name of the compiler switch to use. Eventual patches to
>>> support other VCSs (or, for example, infer the switch name from the
>>> directory name) would be welcome.
>> _______________________________________________
>> Platform mailing list
>> Platform at lists.ocaml.org
>> http://lists.ocaml.org/listinfo/platform
> _______________________________________________
> opam-devel mailing list
> opam-devel at lists.ocaml.org
> http://lists.ocaml.org/listinfo/opam-devel

More information about the opam-devel mailing list