[ANN] opam-bin: binary packages for opam, beta release


I am happy to announce the first public release of opam-bin, a
framework to create, use and share binary packages with opam:


With opam-bin, you can :

  • build binary packages while installing their source counterpart with opam
  • automatically reuse previously created binary packages instead of
    compiling them again
  • export and share your binary packages as part of opam repositories
    for other users/computers to use

opam-bin is a framework in 3 parts :

This is the first public release, it should be considered as a “beta
release”, though we have tested it a lot in the last days.

opam-bin is a collaborative work between OCamlPro and Origin Labs.

Enjoy !


Somewhat related - setting up more opam mirrors:

It would be amazing to be able to mirror both opam source and binary packages.

1 Like

Little update: the binary repository for OCaml 4.10.0 has been expanded to contain a set of 1800+ binary packages:



That sounds very promising. I’ll have a look at using it for the next liquidsoap release!

opam-bin generate binary packages with no dependencies if all of them are tagged as build. That’s the case if your package only contains executables and no libraries.

For example, alt-ergo is splitted in 3 packages alt-ergo-parsers, alt-ergo-libs and alt-ergo, and the last one contains only the executables, so i modified to tag all deps as build and now, the binary package has no dep and can be installed directly in an empty switch.

You still need to provide binary packages for several architectures/libc, it can be a bit tedious.

1 Like

I wonder if I have overlooked some instructions somewhere that someone could point me to. I’m interested in adapting a workflow based on creating an archive of an opam repo using extract_mini_repository.sh to use opam-bin to avoid rebuilding the packages from source. Does anyone already have a modification of that script/workflow that can produce a standalone snapshot containing binary packages? Is this an expected/reasonable use case for opam-bin?

1 Like

Hi Josh,

I think it’s actually much simpler with opam-bin:

  1. remove ~/.opam/plugins/opam-bin/repo
  2. install a switch with all the packages you want for your repo
  3. the result is ~/.opam/plugins/opam-bin/repo

You can share it, it should contain all the packages and their dependencies.



I just noticed that the version 0.9.4 that I uploaded on the public opam-repo has a bug and does not create binary packages if sharing is disabled in opam-bin config. I am going to create a new version to fix this stupid bug.