ocaml / ocaml

The core OCaml system: compilers, runtime system, base libraries
https://ocaml.org
Other
5.52k stars 1.11k forks source link

ocamlbuild infer tag breaks mezzo #6793

Closed vicuna closed 7 years ago

vicuna commented 9 years ago

Original bug ID: 6793 Reporter: @damiendoligez Assigned to: @gasche Status: closed (set by @xavierleroy on 2016-12-07T10:47:30Z) Resolution: fixed Priority: high Severity: major Version: 4.02.2+dev / +rc1 Target version: 4.02.2+dev / +rc1 Fixed in version: 4.02.2+dev / +rc1 Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues Child of: #6237

Bug description

Commit 15698 introduced an infer tag for menhir but this breaks mezzo: ocamlbuild tries to launch the following command:

menhir --explain --infer -la 1 --table --ocamlc 'ocamlfind ocamlc --infer -g -annot -bin-annot -strict-sequence -package yojson -package menhirLib -package ulex -package pprint -package fix -package unix -package functory -package str -package ocamlbuild -I parsing -I utils -I lib -I interpreter -I ocamlbuild -I typing -I stdlib -I mezzolib -I compiler -I corelib -I tests/unit' --infer parsing/grammar.mly

and ocamlc gets a --infer on its command line, so it fails.

Steps to reproduce

Just install mezzo with opam.

vicuna commented 9 years ago

Comment author: @damiendoligez

I just noticed that the original PR for this change was #6237.

vicuna commented 9 years ago

Comment author: @damiendoligez

Note: this problem appears in 4.02, although #6237 claims the patch was only in trunk.

vicuna commented 9 years ago

Comment author: @gasche

The "infer" tag is only a symptom: this breakage is caused by the fact that ocamlbuild passes menhir an "-ocamlc ..." command that uses all the tags of the current .mly files, rather than tags appropriate to compile ocaml files.

vicuna commented 9 years ago

Comment author: @gasche

This should be fixed (in trunk and 4.02). I decided to try to apply a clean fix to 4.02 instead of just reverting the breakage-provoking commit, but we may revert that decision if it turns out the patch has unintended consequences (in any case it only changes the behaviour of ocamlbuild on menhir-project).