ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.62k stars 401 forks source link

Cannot befriend Menhir and ocamllex with `include_subdirs unqualified` #10301

Open hirrolot opened 6 months ago

hirrolot commented 6 months ago

My lib/dune is the following:

(library (name foo))

(include_subdirs unqualified)

(menhir
 (modules parser)
 (flags --explain --dump))

(ocamllex lexer)

But the issue is that I have parser.mly and lexer.mll in the surface/ directory. When running dune build, I receive the following error:

File "lib/dune", line 16, characters 0-52:
16 | (menhir
17 |  (modules parser)
18 |  (flags --explain --dump))
Error: No rule found for lib/parser.mly
File "lib/dune", line 20, characters 0-16:
20 | (ocamllex lexer)
     ^^^^^^^^^^^^^^^^
Error: No rule found for lib/lexer.mll

How do I tell Dune that it should search for parser.mly and lexer.mll in lib/surface/, not lib/?

My Dune version is 3.14.2.

emillon commented 6 months ago

I'm a bit surprised to see menhir pop up here because it should have been fixed in #8949. I'll try to repro, thanks.

anmonteiro commented 6 months ago

added a reproduction here https://github.com/ocaml/dune/pull/10371