opam 2.0 FAQ

Louis Gesbert edited this page Oct 4, 2016 · 3 revisions

This document is intended to keep record of the feedback, ideas and useful workflows that come from testers of the opam 2.0 preview release (alpha4), as well as suggestions to improve these workflows

npm-like workflow

Quoting the example "npm-like" workflow from the OCaml Workshop presentation, if you wanted to compile some package using a local switch with all its dependencies, you could do:

# from project source root
opam switch create ./ <compiler>     # e.g. "4.03.0"
opam pin add <project-name> .
opam install <project-name> --inplace-build

Then rebuild with opam upgrade <project-name> --inplace-build.

Custom OCaml compiler

Just create an empty switch, and pin the OCaml implementation package to your compiler source dir:

opam switch create ocaml-foo --empty
opam pin add ocaml-variants.4.03.0+foo ./

Optionally, you can mark your compiler as "base package", which will make sure opam never proposes to remove it:

opam switch set-base ocaml-variants
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.