dune icon indicating copy to clipboard operation
dune copied to clipboard

Cannot befriend Menhir and ocamllex with `include_subdirs unqualified`

Open hirrolot opened this issue 11 months ago • 2 comments

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.

hirrolot avatar Mar 22 '24 14:03 hirrolot

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.

emillon avatar Mar 26 '24 12:03 emillon

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

anmonteiro avatar Apr 03 '24 06:04 anmonteiro