Page
Library
Module
Module type
Parameter
Class
Class type
Source
ocaml-sbom is an SBOM generator for OCaml projects or subprojects that use the Opam package manager.
.opam or .opam.locked files)Opam (>= 2.2.0) is required to build ocaml-sbom from source. Build it and install it with (coming soon!)
$ opam install ocaml-sbomTo run ocaml-sbom, you'll need opam even if you obtained a pre-built ocaml-sbom executable. However, you only need the bare opam command. No need to install an OCaml compiler or any Opam packages.
The target project must ship with one or several Opam files. These are typically placed at the project root and have the .opam extension. Lockfiles may be present. They have the .opam.locked extension and are picked up automatically by ocaml-sbom. The tool provides options to require or to ignore lockfiles, see ocaml-sbom --help.
First, generate the SBOM in ocaml-sbom's internal format. This may take a few minutes:
$ ocaml-sbom -o myproject.ocaml-sbom --verboseAn overlay file named ocaml-sbom.overlay.json is used if present. Its format is specified by https://github.com/LexiFi/ocaml-sbom/blob/main/lib/types/ocaml_sbom_overlay.atd. See ocaml-sbom overlay --help for examples.
Then export to your preferred SBOM format:
$ ocaml-sbom export myproject.ocaml-sbom -o myproject.cdx --format cyclonedx-1.6or
$ ocaml-sbom export myproject.ocaml-sbom -o myproject.spdx --format spdx-3.0