-
Notifications
You must be signed in to change notification settings - Fork 470
jbuilder doesn't support menhir with --infer #305
Copy link
Copy link
Closed
ocaml/opam-repository
#12774Description
Hi ! I'm trying to move from ocamlbuild to jbuilder, but I can't invoke menhir with the --infer flag:
$ jbuilder build foobar.exe
menhir parser.{ml,mli} (exit 1)
(cd _build/default && .../menhir --infer --explain parser.mly)
File "parser.mly", line 3, characters 13-19
Error: Unbound module Syntax
The following configuration
(menhir
((flags (--explain))
(modules (parser))))
(ocamllex (lexer))
(executable
((name foobar)
(libraries (core))))
works but
(menhir
((flags (--infer --explain))
(modules (parser))))
(ocamllex (lexer))
(executable
((name foobar)
(libraries (core))))
doesn't.
The issue is described in menhir manual: by using --infer, some calls to ocamlc are done to typecheck the file, so some modules have to be compiled before the parser. It is advised to use --depend to get the correct dependencies.
For the record, my parser.mly starts with:
%{
open Lexing
module S = Syntax
%}
and I use S.Fobaar in the mly file (see here)
I'm using jbuilder 1.0+beta14 on ubuntu 16.04.3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels