ocaml / ocaml/dune

"Unknown constructor vendored_dirs" when using OCaml syntax

Open
#3,382 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build preprocessing
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

This dune file works fine:

(vendored_dirs otherlib)

(library (libraries otherlib) (name toto))

This dune file triggers an error:

(* -*- tuareg -*- *)
;; {|(vendored_dirs otherlib)

(library (libraries otherlib) (name toto))|} |>  Jbuild_plugin.V1.send
$ dune build
File "_build/.dune/default/lib/dune", line 1, characters 1-14:
1 | (vendored_dirs otherlib)
     ^^^^^^^^^^^^^
Error: Unknown constructor vendored_dirs

Reproduction

In a fresh directory:

$ cat >dune <<EOF 
(* -*- tuareg -*- *)
;; {|(vendored_dirs otherlib)

(library (libraries otherlib) (name toto))|} |>  Jbuild_plugin.V1.send
EOF
$ dune build

Specifications

  • Version of dune (output of dune --version): tested 2.3.1 and latest master e778223b9b1c7f265de978902b97603a0f4bbf24
  • Version of ocaml (output of ocamlc --version) 4.08.1
  • Operating system (distribution and version): Debian bullseye

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduced dune file containing the OCaml syntax extension and run dune build in a fresh directory. Trace why the emitted (vendored_dirs otherlib) is rejected as an unknown constructor, then verify that the reproduction builds without this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.