Examples of building ocaml code and using ocaml tools.
$ opam switch install <environment name of your choice> -alias-of <compiler name>
$ eval $(opam config env)
$ opam switch <env name> && eval $(opam config env)
$ opam source <package name>
This will just checkout the code at whatever revision would be built by default for your ocaml version.
First, tell opam where to look for the package:
$ opam pin <package name> <path>
You'll be prompted to install now. You can later run:
$ opam install <package name>
Or you can rebuild following a change with:
$ opam update <package name>
I'm not sure there's a way to add a "local" compiler definition. I think you need to make your own local opam repository and define the compiler there.
-
Make your repo and add some definitions. I copied a compiler definition from the prop repos, and modified it slightly.
-
Register the repo with opam. I think I used
local
for .$ opam repo add <name> <path>
-
Now you can access the compiler you defined there.
-
If you change anything in the repo, you can update the
opam update
.