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

Wojciech Meyer wojciech.meyer at gmail.com
Sun Mar 17 19:18:53 GMT 2013


Hi Gabriel,

all is needed for testing ocamlbuild and local patches for the compiler,
thank you.

Other useful thing in general for OPAM would be something like:

opam patch add <ordered list_of_patches>
opam patch reset

then we are able quickly test some local patches without touching
command line and invoking makefiles.

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.


More information about the Platform mailing list