Skip to content

[FEATURE REQUEST] opam package: Use the distribution-provided binaryen #2131

@shym

Description

@shym

The opam package for the wasm_of_ocaml compiler depends on binaryen-bin which builds the binaryen tools v119 from source. This yields the following issues:

  • many distributions nowadays contain a more recent version of binaryen, so building an old version from source is undesirable most of the times,
  • the CI workflow itself is cheating opam with a fake install to work around this,
  • the binaryen-bin package contains only some of the tools so, I’m not mistaken, you can easily end up in a situation where this shadows some of distribution-provided tools with older ones but not all, which can easily be confusing.

We’ve created a conf-binaryen package to be able to depend on the distribution-provided binaryen. It would be nice to change the dependency to conf-binaryen | binaryen-bin.
Obviously, some not-yet-obsolete distributions bundle older versions than 119 (not that many according to Repology but it’s the case of Ubuntu 24.04 LTS).

I assume here that 119 is the minimal version required for wasm_of_ocaml. With conf-binaryen, we followed the common usage of conf- packages of not tying its version number to the one of the installed binaryen tools and there didn’t seem to be a common pattern to enforce a version of the installed tools.

So switching to conf-binaryen might require:

  1. either to be able to detect that the installed binaryen is too old when it’s to be invoked (or checking its version if the invocation failed?),
  2. or warn the user in the documentation about that (but developers using wasm are probably all using a fairly recent version of binaryen anyway).

(I wasn’t so sure about how to do 1. properly, ie what could break with an older binaryen, so I didn’t prototype this)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions