Giter VIP home page Giter VIP logo

Comments (7)

cyocum avatar cyocum commented on July 18, 2024

Ok, the answer is to use ocamlfind instead in all cases like this:

ocamlfind ocamlc -thread -syntax camlp4o -package eliom.server

However, the documentation states that this will not allow you to have client code, only server side code. Is there a workaround for this?

from eliom.

balat avatar balat commented on July 18, 2024

I'm usually using server only .ml files for database interaction and I don't see this problem (using the default makefile). Using pgocaml's syntax in .eliom files may cause problems with the syntax extension indeed. But your error message seems to speak about a missing dependency on batteries in pgocaml's meta ...

If you find a fix or a workaround we would be happy to integrate it.

from eliom.

michaeljforster-zz avatar michaeljforster-zz commented on July 18, 2024

I'm using the same package versions as the OP and the default Makefile with the following changes to Makefile.options:

# Source files for the server
SERVER_FILES := $(wildcard *.eliomi *.eliom *.ml)
...
# OCamlfind packages for the server
SERVER_PACKAGES := pgocaml pgocaml.syntax

The error occurs during the generation of dependencies:

$ make byte
Makefile:216: .depend: No such file or directory eliomdep -server -package pgocaml \
-package pgocaml.syntax -package core database.ml > _deps/database.ml.server
Camlp4: Uncaught exception: DynLoader.Error \
 ("/home/mjf/.opam/4.01.0/lib/pgocaml/pa_pgsql.cma", \
 "error while linking /home/mjf/.opam/4.01.0/lib/pgocaml/pa_pgsql.cma.\nReference \
 to undefined global `Batteries'")

However, upgrading to the development version of Ocsigen (at the time of writing) appears to fix it:

$ opam repository add opamocsigen http://ocsigen.org/opam
$ opam update
 ...
$ opam upgrade
...
$ make clean
$ rm -f .depends
$ rm -f _deps/*
$ make
$ Makefile:216: .depend: No such file or directory
eliomdep -server -package pgocaml -package pgocaml.syntax -package core \
mti_admin.eliom > _deps/mti_admin.eliom.server
eliomdep -server -package pgocaml -package pgocaml.syntax -package core \
database.ml > _deps/database.ml.server
...

from eliom.

balat avatar balat commented on July 18, 2024

Thank you. If it works with the devt version I guess it's ok.
We will try to release it asap (january I hope. We still have one missing
feature).

If you want to make it work with the stable version, a solution may be to use
pgocaml syntax only in .ml files (not in .eliom), compiled only for server
side (?).

Vincent

I'm using the same package versions as the OP and the default Makefile with
the following changes to Makefile.options:

Source files for the server

SERVER_FILES := $(wildcard *.eliomi *.eliom *.ml)
...

OCamlfind packages for the server

SERVER_PACKAGES := pgocaml pgocaml.syntax

The error occurs during the generation of dependencies:

$ make byte
Makefile:216: .depend: No such file or directory eliomdep -server

-package pgocaml \ -package pgocaml.syntax -package core database.ml >
_deps/database.ml.server Camlp4: Uncaught exception: DynLoader.Error
("/home/mjf/.opam/4.01.0/lib/pgocaml/pa_pgsql.cma",
"error while linking
/home/mjf/.opam/4.01.0/lib/pgocaml/pa_pgsql.cma.\nReference \ to undefined
global `Batteries'")

However, upgrading to the development version of Ocsigen (at the time of
writing) appears to fix it:

$ opam repository add opamocsigen http://ocsigen.org/opam
$ opam update
 ...
$ opam upgrade
...
$ make clean
$ rm -f .depends
$ rm -f _deps/*
$ make
$ Makefile:216: .depend: No such file or directory
eliomdep -server -package pgocaml -package pgocaml.syntax -package core

\ mti_admin.eliom > _deps/mti_admin.eliom.server
eliomdep -server -package pgocaml -package pgocaml.syntax -package core
\ database.ml > _deps/database.ml.server
...


Reply to this email directly or view it on GitHub:
#20 (comment)

from eliom.

hhugo avatar hhugo commented on July 18, 2024

closing because eliom 4 has been released

from eliom.

ZhengxunWu avatar ZhengxunWu commented on July 18, 2024

I'm usually using server only .ml files for database interaction and I don't see this problem (using the default makefile). Using pgocaml's syntax in .eliom files may cause problems with the syntax extension indeed. But your error message seems to speak about a missing dependency on batteries in pgocaml's meta ...

If you find a fix or a workaround we would be happy to integrate it.

Hi, I use .ml fiel for database interaction but cannot compile due to syntax error. could you give me some details about how you compile it and identify the syntax? i will really really appreciate your help..thank you in advance this problem really give me headache

from eliom.

balat avatar balat commented on July 18, 2024

We strongly recommend to use PPX syntax for PGOCaml.
Some examples can be found in Ocsigen Start's template.

For example:
https://github.com/ocsigen/ocsigen-start/blob/master/template.distillery/demo_pgocaml_db.ml

from eliom.

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.