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

Gabriel Scherer gabriel.scherer at gmail.com
Sun Mar 17 18:38:40 GMT 2013


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.


More information about the Platform mailing list