Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camlp4 parser paths are hard-coded #6605

Closed
vicuna opened this issue Oct 8, 2014 · 2 comments
Closed

camlp4 parser paths are hard-coded #6605

vicuna opened this issue Oct 8, 2014 · 2 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Oct 8, 2014

Original bug ID: 6605
Reporter: florent.becker
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2017-09-24T15:31:43Z)
Resolution: fixed
Priority: normal
Severity: minor
OS: linux
OS Version: nixos
Target version: later
Fixed in version: 4.03.0+dev / +beta1
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues

Bug description

The path to camlp4 is hard-coded as "+camlp4/…" in ocamlbuild, which makes it impossible to build some packages using it (at least optcomp) when camlp4 is installed into another directory than the compilers' stdlib. At least optcomp is affected.

Steps to reproduce

Install camlp4 (version 4.02) with a LIBDIR and PKGDIR other than the path to the compilers' stdlib, then try to compile optcomp.

Compilation fails with:

ocamlfind ocamlc -c -I +camlp4 -I +camlp4/Camlp4Parsers -I +camlp4/Camlp4Printers -I +camlp4/Camlp4Filters -g -I src -package camlp4 -package camlp4.lib -syntax camlp4o -package camlp4.quotations.o -I src -o src/optcomp_o.cmo src/optcomp_o.ml

  • ocamlfind ocamlc -c -I +camlp4 -I +camlp4/Camlp4Parsers -I +camlp4/Camlp4Printers -I +camlp4/Camlp4Filters -g -I src -package camlp4 -package camlp4.lib -syntax camlp4o -package camlp4.quotations.o -I src -o src/optcomp_o.cmo src/optcomp_o.ml
    File "src/optcomp_o.ml", line 12, characters 38-67:
    Error: Unbound module Camlp4OCamlRevisedParser
@vicuna
Copy link
Author

vicuna commented Oct 8, 2014

Comment author: @gasche

We were aware of this before the 4.02 release, but the problem is that many part of the ecosystem assume that the path +camlp4 is usable -- not only ocamlbuild, and by far. Some solutions were proposed, but the safer and less invasive was to just make sure that distribution packagers would keep installed camlp4 in LIB_DIR as expected by the tools.

This is not to say that this is not an issue. It is, but you must leave it some time for the ecosystem to evolve and, for now, assume that camlp4 must be installed at the same place it had in the previous releases.

@vicuna
Copy link
Author

vicuna commented Jan 6, 2016

Comment author: @gasche

There were two changes to this logic in trunk which should fix the problem.

In
#117
Vincent Laporte proposed to replace +camlp4 by the result of (ocamlfind query camlp4), with a fallback on +camlp4.

In
ocaml/ocamlbuild@826f4e1
I changed this logic to use (camlp4 -where) instead of relying on ocamlfind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants