{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/dune/issues/305","repository_url":"https://api.github.com/repos/ocaml/dune","labels_url":"https://api.github.com/repos/ocaml/dune/issues/305/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/dune/issues/305/comments","events_url":"https://api.github.com/repos/ocaml/dune/issues/305/events","html_url":"https://github.com/ocaml/dune/issues/305","id":270984054,"number":305,"title":"jbuilder doesn't support menhir with --infer","user":{"login":"vsiles","id":7124672,"avatar_url":"https://avatars0.githubusercontent.com/u/7124672?v=4","gravatar_id":"","url":"https://api.github.com/users/vsiles","html_url":"https://github.com/vsiles","followers_url":"https://api.github.com/users/vsiles/followers","following_url":"https://api.github.com/users/vsiles/following{/other_user}","gists_url":"https://api.github.com/users/vsiles/gists{/gist_id}","starred_url":"https://api.github.com/users/vsiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsiles/subscriptions","organizations_url":"https://api.github.com/users/vsiles/orgs","repos_url":"https://api.github.com/users/vsiles/repos","events_url":"https://api.github.com/users/vsiles/events{/privacy}","received_events_url":"https://api.github.com/users/vsiles/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-11-03T13:49:33Z","updated_at":"2018-03-06T09:43:15Z","closed_at":null,"author_association":"NONE","body":"Hi ! I'm trying to move from ocamlbuild to jbuilder, but I can't invoke menhir with the --infer flag:\r\n\r\n```\r\n$ jbuilder build foobar.exe\r\n      menhir parser.{ml,mli} (exit 1)\r\n(cd _build/default && .../menhir --infer --explain parser.mly)\r\nFile \"parser.mly\", line 3, characters 13-19\r\nError: Unbound module Syntax\r\n```\r\n\r\nThe following configuration \r\n\r\n```(jbuild_version 1)\r\n(menhir\r\n ((flags (--explain))\r\n  (modules (parser))))\r\n\r\n(ocamllex (lexer))\r\n\r\n(executable\r\n    ((name foobar)\r\n     (libraries (core))))\r\n```\r\nworks but \r\n\r\n```(jbuild_version 1)\r\n(menhir\r\n ((flags (--infer --explain))\r\n  (modules (parser))))\r\n\r\n(ocamllex (lexer))\r\n(executable\r\n    ((name foobar)\r\n     (libraries (core))))\r\n```\r\ndoesn't.\r\n\r\nThe 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.\r\n\r\nFor the record, my parser.mly starts with:\r\n```\r\n%{\r\n  open Lexing\r\n  module S = Syntax\r\n%}\r\n```\r\n\r\nand I use `S.Fobaar` in the mly file ([see here](https://github.com/vsiles/tiger/tree/master/src))\r\nI'm using jbuilder 1.0+beta14 on ubuntu 16.04.3\r\n"},"comment":{"url":"https://api.github.com/repos/ocaml/dune/issues/comments/370722650","html_url":"https://github.com/ocaml/dune/issues/305#issuecomment-370722650","issue_url":"https://api.github.com/repos/ocaml/dune/issues/305","id":370722650,"user":{"login":"vsiles","id":7124672,"avatar_url":"https://avatars0.githubusercontent.com/u/7124672?v=4","gravatar_id":"","url":"https://api.github.com/users/vsiles","html_url":"https://github.com/vsiles","followers_url":"https://api.github.com/users/vsiles/followers","following_url":"https://api.github.com/users/vsiles/following{/other_user}","gists_url":"https://api.github.com/users/vsiles/gists{/gist_id}","starred_url":"https://api.github.com/users/vsiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsiles/subscriptions","organizations_url":"https://api.github.com/users/vsiles/orgs","repos_url":"https://api.github.com/users/vsiles/repos","events_url":"https://api.github.com/users/vsiles/events{/privacy}","received_events_url":"https://api.github.com/users/vsiles/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T09:43:15Z","updated_at":"2018-03-06T09:43:15Z","author_association":"NONE","body":"Ok ! Great to here you're working on it :)"}}
{"actor":{"display_login":"vsiles"}}