Skip to content

pkg: dune tools install ocamlformat can fail to put ocamformat on the path for dune build @fmt #12839

@shonfeder

Description

@shonfeder

Expected Behavior

$ dune tools install ocamlformat
$ dune build @fmt 
# works

Actual Behavior

$ dune tools install ocamlformat
$ dune build @fmt
Error: Program ocamlformat not found in the tree or in PATH
 (context: default)
-> required by _build/default/bin/.formatted/main.ml
-> required by alias bin/.formatted/fmt
-> required by alias bin/fmt

Reproduction

$ dune init proj foo
$ cd foo
$ cat > dune-workspace <<EOF\n(lang dune 3.21)\n(pkg enabled)\nEOF\n
$ dune tools install ocamlformat
$ dune build @fmt 

Specifications

  • Version of dune (output of dune --version):
  • Version of ocaml (output of ocamlc --version):
  • Operating system (distribution and version):
$ dune --version
"Nightly build 2025-11-30T02:57:20Z, git revision
f783f81731da4ecb307981bc61117f07c1b3b953"
      System Version: macOS 15.7.2 (24G325)
      Kernel Version: Darwin 24.6.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions