Giter VIP home page Giter VIP logo

Comments (10)

murmour avatar murmour commented on June 29, 2024

And yes, the OCAMLLIB environment variable has a correct value of C:\OCaml\lib.

from ocaml-installer.

msprotz avatar msprotz commented on June 29, 2024

Urgh. I can't rely on OPAM to install camlp4 properly because you still need a silly patch to make camlp4 compile on Windows... see camlp4/camlp4#41 (comment)

Or maybe you can try it? The issue says that you should be able to do it...?

from ocaml-installer.

murmour avatar murmour commented on June 29, 2024

I have built and installed the 4.02 branch of Camlp4 (by pinning the git repo), and camlp4 -where returns the correct path now: /cygdrive/c/OCaml/bin/camlp4. However, I still can't install type_conv, getting the same error message as before:

#=== ERROR while installing type_conv.113.00.02 ===============================#
# opam-version 1.2.2
# os           cygwin
# command      make
# path         /home/mrm/.opam/system/build/type_conv.113.00.02
# compiler     system (4.02.3)
# exit-code    2
# env-file     /home/mrm/.opam/system/build/type_conv.113.00.02/type_conv-2464-ffb3fd.env
# stdout-file  /home/mrm/.opam/system/build/type_conv.113.00.02/type_conv-2464-ffb3fd.out
# stderr-file  /home/mrm/.opam/system/build/type_conv.113.00.02/type_conv-2464-ffb3fd.err
### stdout ###
# [...]
# pkg_camlp4_extend: ................................... C:/OCaml/lib/camlp4
#
# ./setup.exe -build
# mkdir 'C:\wodi32\home\mrm\.opam\system\build\type_conv.113.00.02\_build'
# ''ocamlfind ocamlc unix.cma -I 'C:\OCaml\lib\ocamlbuild' 'C:\OCaml\lib\ocamlbuild/ocamlbuildlib.cma' -linkpkg myocamlbuild.ml 'C:\OCaml\lib\ocamlbuild/ocamlbuild.cmo' -o myocamlbuild.exe
# mkdir src
# ''C:/wodi32/home/mrm/.opam/system/bin/ocamlfind.EXE ocamldep -syntax camlp4o -package camlp4.quotations -package camlp4.extend -modules src/pa_type_conv.mli > src/pa_type_conv.mli.depends
# Exit code 2 while executing this command:
#   ''C:/wodi32/home/mrm/.opam/system/bin/ocamlfind.EXE ocamldep -syntax camlp4o -package camlp4.quotations -package camlp4.extend -modules src/pa_type_conv.mli > src/pa_type_conv.mli.depends
# Makefile:21: ошибка выполнения рецепта для цели «build»
### stderr ###
# Camlp4: Uncaught exception: DynLoader.Error ("Camlp4OCamlRevisedParser.cmo", "file not found in path")
#
# File "src/pa_type_conv.mli", line 1:
# Error: Error while running external preprocessor
# Command line: camlp4 "-I" "C:/OCaml/lib/camlp4" "-I" "C:/OCaml/lib/camlp4" "-I" "C:/OCaml/lib/camlp4" "-I" "C:/OCaml/lib/camlp4" "-parser" "o" "-parser" "op" "-printer" "p" "-parser" "Camlp4QuotationCommon" "-parser" "Camlp4OCamlRevisedQuotationExpander" "-ignore" "foo" "-parser" "Camlp4GrammarParser"  "src/pa_type_conv.mli" > C:\wodi32\tmp\ocamlpp6a61ab
#
# E: Failure("Command 'C:\\OCaml\\bin\\ocamlbuild.EXE -classic-display -no-log -no-links -install-lib-dir C:\\OCaml\\lib\\ocamlbuild -byte-plugin src/pa_type_conv.cma src/pa_type_conv.cmxa src/pa_type_conv.a src/pa_type_conv.cmxs -use-ocamlfind -tag debug' terminated with error code 2")
# make: *** [build] Ошибка 1

As if Camlp4 couldn't locate C:/OCaml/lib/camlp4/Camlp4Parsers...

from ocaml-installer.

murmour avatar murmour commented on June 29, 2024

The root of the problem seems to be neither in OASIS nor in ocamlbuild:

$ camlp4 -I "C:/OCaml/lib/camlp4" "-parser" "o"
Camlp4: Uncaught exception: DynLoader.Error ("Camlp4OCamlRevisedParser.cmo", "file not found in path")

from ocaml-installer.

msprotz avatar msprotz commented on June 29, 2024

huh. the dynloader should try to load a cmxs, shouldn't it?

from ocaml-installer.

murmour avatar murmour commented on June 29, 2024

camlp4 is a byte-compiled executable, so it needs a .cmo.

from ocaml-installer.

murmour avatar murmour commented on June 29, 2024

Suddenly, this works:

camlp4 -I "C:/OCaml/lib/camlp4" "-parser" Camlp4Parsers/Camlp4OCamlRevisedParser.cmo

And even without specifying the search path:

camlp4 "-parser" Camlp4Parsers/Camlp4OCamlRevisedParser.cmo

Puzzling. Seems like a yet another path-handling-related bug in Camlp4.

from ocaml-installer.

murmour avatar murmour commented on June 29, 2024

This did the trick:

export CAMLP4LIB=C:/OCaml/lib/camlp4

I'm not sure how or why does it work, but the installer can also set this variable, at least as a temporary workaround. Something is probably wrong with handling those paths in Camlp4, but I haven't figured that out yet.

from ocaml-installer.

msprotz avatar msprotz commented on June 29, 2024

Can you submit a pull request?

(I'm short on time right now.)

Thanks,

Jonathan

from ocaml-installer.

murmour avatar murmour commented on June 29, 2024

Hello. I haven't figured out how to add this environment variable into the installation script (I'm not familiar with NSIS), and I didn't have time to test the modified installer, so I put that "export" line into my .bashrc and it didn't bother me after that.

from ocaml-installer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.