//proto-ocamlbyHebilicious

proto-ocaml

0
0
0
1
Rust

OCaml plugin

OCaml WASM plugin for proto.

This plugin installs a realistic OCaml baseline:

  • opam
  • ocaml-base-compiler
  • dune

It manages an isolated opam root inside each proto installation and activates the
switch environment automatically when invoked through proto.

Installation

Add the following to .prototools:

[plugins]
ocaml = "github://hebilicious/proto-ocaml"

[tools.ocaml]
version = "5.4.1"

Or add it explicitly:

proto plugin add ocaml github://hebilicious/proto-ocaml

Usage

# install latest stable compiler
proto install ocaml

# install a specific compiler version
proto install ocaml 5.4.1

# run tools from the managed switch
proto run ocaml -- ocaml -version
proto run ocaml -- dune --version

Version Detection

The plugin checks version files in this order:

  1. .ocaml-version
  2. dune-project

Supported .ocaml-version formats:

5.4.1
5.4
ocaml-base-compiler.5.4.1
stable

The dune-project parser supports explicit compiler constraints in package
dependency stanzas, for example:

(package
 (name app)
 (depends
  (ocaml (>= 5.1) (< 5.5))
  dune))

Supported Platforms

  • Linux x64
  • Linux arm64
  • macOS x64
  • macOS arm64
  • Windows x64

Notes

  • The plugin installs dune by default.
  • It does not install additional tools such as ocaml-lsp-server,
    ocamlformat, utop, or odoc.
  • *.opam auto-detection is intentionally not implemented because current proto
    plugin version detection only supports fixed filenames.

Contributing

rustup target add wasm32-wasip1
cargo build --target wasm32-wasip1
cargo test
./tests/e2e/run.sh

Releases

This repository uses release-plz to manage
version bumps and release pull requests.

Merging changes into main updates or creates the automated release PR.
Merging that release PR creates the version tag, and the same main workflow
publishes the GitHub release artifact for that tag.

Find me
[beta]v0.20.0