Can you share your secret to make ocsigen-start work?

I want to write a reliable app and a full featured framework like ocsigen is really appealing me.
So far, I have been trying hard to install ocsigen-start for about two weeks. I read carefully the docs. I upgraded to opam2. I dealt with unsolvable conflicting dependencies. I studied ocsigen dependecies at https://opam.ocaml.org/packages/ocsigen-start/. I tried several compilers. I created and deleted many opam switches. I opam update && opam upgrade sometimes, when I was stuck (and hopefully it sometimes helped) and I run eval $(opam env) more than necessary.
I finally found a config when I could install ocsigen-start, all its depexts, and built it, with luck I guess. But links in the app were dead (exept for the self-referential link). I then tried to opam update && opam upgrade and for now compilation of a project is broken.
I know there are a lot of issues making opam to deal with conflicting dependencies, that the js world is fast changing, etc (it has been discussed here Ocsigen Start: How to really get up and running in 5 minutes?)

At the same time, I know some folks have a working installation with a correct set of dependencies out there. If you are one of them, (lucky you !) could you share your opam switch config that one could make it work out of the box using opam switch import command ? All you have to do is to run opam switch export <export.file.to.share> --switch <switch with working ocsigen-start> and share your precious <export.file.to.share> which looks like this :

opam-version: “2.0”
compiler: [
“base-bigarray.base”
“base-threads.base”
“base-unix.base”
“ocaml.4.07.0”
“ocaml-base-compiler.4.07.0”
“ocaml-config.1”
]
roots: [“depext.transition” “ocaml-base-compiler.4.07.0”]
installed: [
“astring.0.8.3”
“base.v0.12.2”
[…]
“yojson.1.7.0”
“zarith.1.9.1”
]

Could you share so your working opam switch config (with your os version to be a bit more exhaustive).
I would be so grateful and I am sure it would help someone else and prevent her or him giving up in the tough task of making ocsigen-start work, before it works really out of the box with opam and opam depext in 5 minutes.

I wish you a great evening.
Best !

1 Like

A lighter and cleaner solution: export only the dependencies to your package in a opam.locked file with opam lock ocsigen-start.

(and you can then import with opam install opam.locked --locked)

2 Likes

Thank you for your message. Indeed there are still some dependency problems with OCaml 4.08 and 4.09. I hope this will be solved very soon.

I just tried from scratch:
opam switch create 4.07.0
opam install ocsigen-start

It works without problem for me.
Does it work for you?

Do not hesitate to ask questions and/or report any problems (or unclear documentation).
Vincent

1 Like

Thank you for your answer ! The man page of opam-lock states that “This utility reads opam package definitions files”. I investigated my .opam directory (and used find command) to find it but I could not figure out any (nor opam-lock on its own). Do you know where it is supposed to be stored or how to find it ?
Best !

Apologies, opam lock is originally designed for development projects. Try doing a git clone of the repository and executing it inside.

I guess it will be simpler for people to just do a switch export.

1 Like

Thank you for your support Vincent ! I already tried this week, I just did it again to be sure. I just ran

opam switch create ocsi_start 4.07.0
eval $(opam env)
opam install ocsigen-start

I then I got the error message of failure to build eliom :

slight_smile:[ERROR] The compilation of eliom failed at
        "~/.opam/opam-init/hooks/sandbox.sh build make".

#=== ERROR while compiling eliom.6.7.0 ========================================#
# context     2.0.4 | linux/x86_64 | ocaml-base-compiler.4.07.0 | https://opam.ocaml.org/#c2d5ce87
# path        ~/.opam/ocsi_start/.opam-switch/build/eliom.6.7.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build make
# exit-code   2
# env-file    ~/.opam/log/eliom-28773-cc32ab.env
# output-file ~/.opam/log/eliom-28773-cc32ab.out
### output ###
# [...]
# ocamlfind ocamldep -package js_of_ocaml-ppx.deriving -package react,js_of_ocaml,reactiveData -package lwt_react,tyxml.functor,js_of_ocaml.tyxml,js_of_ocaml-lwt,js_of_ocaml-lwt.logger -package deriving.runtime,js_of_ocaml.deriving -package ocsigenserver.cookies,ocsigenserver.polytables,ocsigenserver.baselib.base -package js_of_ocaml.ppx -package js_of_ocaml-ppx.deriving,lwt_ppx,js_of_ocaml-lwt[...]
# ocamlfind ocamldep -package js_of_ocaml-ppx.deriving -package react,js_of_ocaml,reactiveData -package lwt_react,tyxml.functor,js_of_ocaml.tyxml,js_of_ocaml-lwt,js_of_ocaml-lwt.logger -package deriving.runtime,js_of_ocaml.deriving -package ocsigenserver.cookies,ocsigenserver.polytables,ocsigenserver.baselib.base -modules src/lib/client/eliom_config.mli > src/lib/client/eliom_config.mli.depends
# ocamlfind ocamldep -package js_of_ocaml-ppx.deriving -package react,js_of_ocaml,reactiveData -package lwt_react,tyxml.functor,js_of_ocaml.tyxml,js_of_ocaml-lwt,js_of_ocaml-lwt.logger -package deriving.runtime,js_of_ocaml.deriving -package ocsigenserver.cookies,ocsigenserver.polytables,ocsigenserver.baselib.base -modules src/lib/client/eliom_content_core.mli > src/lib/client/eliom_content_core[...]
# ocamlfind ocamldep -package js_of_ocaml-ppx.deriving -package react,js_of_ocaml,reactiveData -package lwt_react,tyxml.functor,js_of_ocaml.tyxml,js_of_ocaml-lwt,js_of_ocaml-lwt.logger -package deriving.runtime,js_of_ocaml.deriving -package ocsigenserver.cookies,ocsigenserver.polytables,ocsigenserver.baselib.base -package js_of_ocaml.ppx -package js_of_ocaml-ppx.deriving,lwt_ppx,js_of_ocaml-lwt[...]
# ocamlfind ocamldep -package js_of_ocaml-ppx.deriving -package react,js_of_ocaml,reactiveData -package lwt_react,tyxml.functor,js_of_ocaml.tyxml,js_of_ocaml-lwt,js_of_ocaml-lwt.logger -package deriving.runtime,js_of_ocaml.deriving -package ocsigenserver.cookies,ocsigenserver.polytables,ocsigenserver.baselib.base -package js_of_ocaml.ppx -package js_of_ocaml-ppx.deriving,lwt_ppx,js_of_ocaml-lwt[...]
# ocamlfind ocamldep -package js_of_ocaml-ppx.deriving -package react,js_of_ocaml,reactiveData -package lwt_react,tyxml.functor,js_of_ocaml.tyxml,js_of_ocaml-lwt,js_of_ocaml-lwt.logger -package deriving.runtime,js_of_ocaml.deriving -package ocsigenserver.cookies,ocsigenserver.polytables,ocsigenserver.baselib.base -package js_of_ocaml.ppx -package js_of_ocaml-ppx.deriving,lwt_ppx,js_of_ocaml-lwt[...]
# + ocamlfind ocamldep -package js_of_ocaml-ppx.deriving -package react,js_of_ocaml,reactiveData -package lwt_react,tyxml.functor,js_of_ocaml.tyxml,js_of_ocaml-lwt,js_of_ocaml-lwt.logger -package deriving.runtime,js_of_ocaml.deriving -package ocsigenserver.cookies,ocsigenserver.polytables,ocsigenserver.baselib.base -package js_of_ocaml.ppx -package js_of_ocaml-ppx.deriving,lwt_ppx,js_of_ocaml-l[...]
# File "src/lib/eliom_cookies_base.shared.ml", line 21, characters 28-39:
# Error: Deriver json does not support inline notation
# Command exited with code 2.
# Makefile:7: recipe for target 'all' failed
# make: *** [all] Error 10



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build eliom 6.7.0

(I only give the part that went wrong, all other packages were properly installed)

I already was able to install ocsigen-start from a 4.07.1 switch (involving some opam update and upgrade at some points), but links of built app were dead and compilation was broken after a simple opam update && opam upgrade, which I find a bit scary to choose to launch a project with it. I suspect this process of installing ocsigen-start is very sensitive to opam version (and of course the compiler version). Also maybe different os (I run an Ubuntu 18, and I also had such troubles on Debian stable) or local environment set opam installation priorities differently so that we cannot consistently just opam switch some compiler version and opam install ocsigen-start.
Could you share an opam export file of the switch you just created so that I can check if a simple switch import make it work ?
Best regards !

According to this recent issue a constraint is likely missing in the opam-repository. Maybe you can work around by first insalling js_of_ocaml version to 3.4:

opam install js_of_ocaml.3.4.0 
opam install ocsigen-start

(I didn’t try, make sure the second install does not upgrade js_of_ocaml)

1 Like

Ok indeed there is bug in js_of_ocaml 3.5.0. You need 3.4.0 :frowning:
The dependency is fixed in Eliom but still not released (release is in progress).

If you don’t want to wait for the release, try, with OCaml 4.07.1 (not 4.07.0)
opam pin add eliom https://github.com/ocsigen/eliom.git
opam install ocsigen-start

1 Like

Thank you for the tip ! I tried what you meant in a fresh 4.07.0 switch and it did not work : compilation of js_of_ocaml-lwt.3.5.0 aborted (I checked that js_of_ocaml did not upgrade), so ocsigen-start could not be installed. Here is the error message:

#=== ERROR while compiling js_of_ocaml-lwt.3.5.0 ==============================#
# context     2.0.4 | linux/x86_64 | ocaml-base-compiler.4.07.0 | https://opam.ocaml.org/#c2d5ce87
# path        ~/.opam/ocs_start/.opam-switch/build/js_of_ocaml-lwt.3.5.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p js_of_ocaml-lwt -j 4
# exit-code   1
# env-file    ~/.opam/log/js_of_ocaml-lwt-6917-625605.env
# output-file ~/.opam/log/js_of_ocaml-lwt-6917-625605.out
### output ###
# Error: This expression has type
# [...]
#          Js_of_ocaml__.Js.readonly_prop =
#            < get : Js_of_ocaml__.Js.js_string Js_of_ocaml__.Js.t >
#            Js_of_ocaml.Js.gen_prop
#        is not compatible with type 'b Js_of_ocaml.Js.gen_prop 
#        Type
#          Js_of_ocaml__.Js.js_string Js_of_ocaml__.Js.t =
#            Js_of_ocaml__.Js.js_string Js_of_ocaml.Js.t
#        is not compatible with type
#          Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t Js_of_ocaml.Js.Opt.t =
#            Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t Js_of_ocaml.Js.opt 
#        Types for method get are incompatible



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build js_of_ocaml-lwt 3.5.0
└─ 

I try to work it around on a 4.07.1 switch like @Vincent_Balat suggests and I report back what happens.

Hi again,
I just tried:

   $ opam switch create ocsigen_start4.07.1 4.07.1
   $ eval $(opam env)
   $ opam pin add eliom https://github.com/ocsigen/eliom.git
[eliom.6.9.1] synchronised from git+https://github.com/ocsigen/eliom.git
eliom is now pinned to git+https://github.com/ocsigen/eliom.git (version 6.9.2)

The following actions will be performed:
  ∗ install conf-gmp                      1          [required by conf-gmp-powm-sec, zarith]
 [...]
  ∗ install js_of_ocaml                   3.5.0      [required by eliom]
 [...]
  ∗ install eliom                         6.9.2*
===== ∗ 65 =====
 [...]
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><>
∗ installed conf-dbm.1.0.0
 [...]
∗ installed js_of_ocaml.3.5.0
 [...]
∗ installed eliom.6.9.2
Done.

   $ # notice that version 3.5 of js_of_ocaml had just been installed
   $ opam install ocsigen-start
[ERROR] The compilation of ocsigen-toolkit failed at "/home/milan/.opam/opam-init/hooks/sandbox.sh build make -j4".

#=== ERROR while compiling ocsigen-toolkit.2.3.2 ==============================#
# context     2.0.4 | linux/x86_64 | ocaml-base-compiler.4.07.1 | https://opam.ocaml.org/#c2d5ce87
# path        ~/.opam/ocsigen_start4.07.1/.opam-switch/build/ocsigen-toolkit.2.3.2
# command     ~/.opam/opam-init/hooks/sandbox.sh build make -j4
# exit-code   2
# env-file    ~/.opam/log/ocsigen-toolkit-25738-d7a85e.env
# output-file ~/.opam/log/ocsigen-toolkit-25738-d7a85e.out
### output ###
# [...]
# js_of_eliom -ppx -c -package calendar -package js_of_ocaml -package js_of_ocaml-ppx -package lwt_ppx -package js_of_ocaml-ppx.deriving -I _client/src/widgets/ -g src/widgets/ot_tip.eliom
# File "src/widgets/ot_swipe.eliom", line 110, characters 17-20:
# Warning 22: The type of this injected value contains a type variable that could be wrongly inferred.
# File "src/widgets/ot_size.eliom", line 63, characters 2-15:
# Error: Unbound module Lwt_js_events
# Makefile:125: recipe for target '_client/src/widgets/ot_size.cmo' failed
# make: *** [_client/src/widgets/ot_size.cmo] Error 2
# make: *** Attente des tâches non terminées....
# File "src/widgets/ot_swipe.eliom", line 123, characters 24-51:
# Error: Unbound module Lwt_js_events
# Makefile:125: recipe for target '_client/src/widgets/ot_swipe.cmo' failed
# make: *** [_client/src/widgets/ot_swipe.cmo] Error 2

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build ocsigen-toolkit 2.3.2
└─ 

Here the eliom pin command failed preventing to install js_of_ocaml 3.5.0 :zipper_mouth_face:

I tried to mix your two pieces of advice performing this:

opam switch create ocsi_start4.07.1 4.07.1
eval $(opam env)
opam install js_of_ocaml.3.4.0
opam install ocsigen-start
# compilation of js_of_ocaml-lwt.3.5.0 failed
opam install js_of_ocaml-lwt.3.4.0
opam install ocsigen-start
# compilation of eliom.6.7.0 failed
opam install eliom
opam install ocsigen-start
# successful installation
eliom-distillery -name myapp4 -template os.pgocaml
cd myapp4
make db-init
make db-create
make db-schema
make test.byte

The app was correctly exposed to localhost:8080, but links are inactive (like last time I succeeded built it).
I have a js_of_ocaml.3.4.0 and a 4.07.1 compiler, and I still fail making it working.
Please @Vincent_Balat, when you have time, could you share a working config performing a switch export <file.to.share> --switch <switch with working ocsigen-start> as you seem not to have problem with ocsigen-start installation ? I am sure it would help me going out of this dependency nightmare :slight_smile:
(I can of course share mine if you are interested in troubleshooting dependency configurations in order to investigate)

2 or 3 days ago, ocsigen-start could be installed without any problem with OCaml 4.07.1 (it was js_of_ocaml-compiler 3.4.0). But I didn’t build an Ocsigen app.

Today I can see “upgrade js_of_ocaml-compiler 3.4.0 to 3.5.0”. All packages are correctly compiled.
Without any pinned packaged, I can install ocsigen-start.2.7.0 with OCaml 4.07.1

The app is correctly build and lauched but I can see that the lateral menu bar is disabled.
So I checked a running app: it uses ocsigen-start.2.3.0 with OCaml 4.07.1
So pin to ocsigen-start.2.3.0 (as detailled in the page you mentionned) and you should be up and running.

The opam update command is really dangerous because even if the packages can be compiled we don’t really know if the framework is really working until we see the errors.
That’s why I don’t use opam update once I get a working setup, or I pin the main package to the working version (e.g. ocsigen-start.2.3.0).

1 Like

Hello RogerT ! Thank you for your help :slight_smile:
I tried what you advised and it did not work on my workstation. In case I did something wrong here is what I did exactly:

opam switch create ocsigen_start.2.3.0_4.07.1 4.07.1
eval $(opam env)
opam pin add ocsigen-start 2.3.0
# compilation of eliom.6.7.0 failed
opam install eliom
opam pin add ocsigen-start 2.3.0
eliom-distillery -name myapp5 -template os.pgocaml
cd myapp5
make db-init
make db-create
make db-schema
make test.byte

The app was exposed to localhost but links still did not work. Did I do something wrong or what should I do ? (To be exact, I tried this process twice and the second time make db-init failed, I also tried some other combinations of command to try to work arround but it failed each time)
Have a good evening !

What is your OS?

Can you publish the result of:

$ opam list
$ opam list --roots
$ opam list --pinned

I’ll have a look at it back to my PC.

You are not supposed to do twice make db-init. Once the DB is up and running, the Ocsigen app lives by itself, just using the DB through port 3000.

You can also stop (or even delete) the DB.
Use make db-status to know how is the DB that is required by the ocsigen app.
Read the documentation about how you should use these DB commands.
Manage both the DB and the ocsigen app.

Ocsigen is a very powerful framework but it’s (it was) not easy for beginners. I think you are not far from getting a working ocsigen-start app.

1 Like

js_of_ocaml 3.5.1 is out.

Not yet on opam.
Compiling ocsigen-start.2.7.0 is fine.
Building an app returns a syntax error.

Can the Ocsigen team constrain the dependencies of Ocsigen Start to something tested?
It’s not acceptable to break an Ocsigen setup with just opam update && opam upgrade. If you want people to use Ocsigen.

Again, the only solution I found is not to opam update or to pin the root package to the working version (but it’s not enough because of the way dependencies are defined. It would be more reliable to pin all packages that make a setup working. In fact, the simplest is to backup a working ocsigen setup with opam switch export. Then opam switch import is enough to get up and running).

1 Like

opam pin add ocsigen-start 2.3.0
Same error syntax

opam pin remove ocsigen-start
opam update
opam upgrade

gives a message:

upgrade ocsigen-start 2.3.0 to 2.7.0

During the compilation there is a message related to (existing) ocsigen-start 2.9.1 but 2.7.0 is compiled.

Hum…

@ruyblast here is a working setup with ocsigen-start.2.4.0 (ocaml.4.7.1 psql 11.5)
Packages compilation: ok
Ocsigen app build: ok
Ocsigen app lateral menu bar: ok (clickable)

Can you test it on your machine?
(create a file ocsigen-start.2.4.0_setup and do opam switch import ocsigen-start.2.4.0_setup)

 opam-version: "2.0"
compiler: [
  "base-bigarray.base"
  "base-threads.base"
  "base-unix.base"
  "ocaml.4.07.1"
  "ocaml-base-compiler.4.07.1"
  "ocaml-config.1"
]
roots: [
  "ocaml-base-compiler.4.07.1" "ocsigen-start.2.4.0" "opam-depext.1.1.3"
]
installed: [
  "astring.0.8.3"
  "base.v0.12.2"
  "base-bigarray.base"
  "base-bytes.base"
  "base-threads.base"
  "base-unix.base"
  "base64.3.2.0"
  "bigarray-compat.1.0.0"
  "biniou.1.2.1"
  "calendar.2.04"
  "camlp4.4.07+1"
  "cmdliner.1.0.4"
  "cohttp.2.3.0"
  "cohttp-lwt.2.3.0"
  "cohttp-lwt-unix.2.3.0"
  "conduit.2.0.1"
  "conduit-lwt.2.0.1"
  "conduit-lwt-unix.2.0.1"
  "conf-dbm.1.0.0"
  "conf-gmp.1"
  "conf-gmp-powm-sec.1"
  "conf-libpcre.1"
  "conf-m4.1"
  "conf-npm.1"
  "conf-openssl.1"
  "conf-perl.1"
  "conf-pkg-config.1.1"
  "conf-zlib.1"
  "cppo.1.6.6"
  "cryptokit.1.13"
  "cstruct.5.0.0"
  "csv.2.2"
  "dbm.1.2"
  "deriving.0.8.1"
  "domain-name.0.3.0"
  "dune.1.11.3"
  "easy-format.1.3.2"
  "eliom.6.7.0"
  "fieldslib.v0.12.0"
  "fmt.0.8.8"
  "hex.1.4.0"
  "ipaddr.4.0.0"
  "ipaddr-sexp.4.0.0"
  "jbuilder.transition"
  "js_of_ocaml.3.4.0"
  "js_of_ocaml-camlp4.3.1.0"
  "js_of_ocaml-compiler.3.4.0"
  "js_of_ocaml-lwt.3.4.0"
  "js_of_ocaml-ocamlbuild.3.1.0"
  "js_of_ocaml-ppx.3.4.0"
  "js_of_ocaml-ppx_deriving_json.3.4.0"
  "js_of_ocaml-tyxml.3.4.0"
  "jsonm.1.0.1"
  "logs.0.7.0"
  "lwt.4.3.0"
  "lwt_camlp4.1.0.0"
  "lwt_log.1.1.1"
  "lwt_ppx.1.2.3"
  "lwt_react.1.1.3"
  "lwt_ssl.1.1.3"
  "macaddr.4.0.0"
  "macaque.0.7.4"
  "magic-mime.1.1.2"
  "mmap.1.1.0"
  "num.1.2"
  "oasis.0.4.11"
  "ocaml.4.07.1"
  "ocaml-base-compiler.4.07.1"
  "ocaml-compiler-libs.v0.12.1"
  "ocaml-config.1"
  "ocaml-migrate-parsetree.1.4.0"
  "ocamlbuild.0.14.0"
  "ocamlfind.1.8.1"
  "ocamlify.0.0.1"
  "ocamlmod.0.0.9"
  "ocamlnet.4.1.6"
  "ocplib-endian.1.0"
  "ocsigen-i18n.3.4.0"
  "ocsigen-start.2.4.0"
  "ocsigen-toolkit.2.3.2"
  "ocsigenserver.2.15.0"
  "opam-depext.1.1.3"
  "parsexp.v0.12.0"
  "pcre.7.4.1"
  "pgocaml.3.2"
  "ppx_derivers.1.2.1"
  "ppx_deriving.4.4"
  "ppx_fields_conv.v0.12.0"
  "ppx_sexp_conv.v0.12.0"
  "ppx_tools.5.1+4.06.0"
  "ppx_tools_versioned.5.2.3"
  "ppxfind.1.3"
  "ppxlib.0.8.1"
  "re.1.9.0"
  "react.1.2.1"
  "reactiveData.0.2.2"
  "resource-pooling.0.7"
  "result.1.4"
  "rresult.0.6.0"
  "safepass.3.0"
  "seq.base"
  "sexplib.v0.12.0"
  "sexplib0.v0.12.0"
  "ssl.0.5.9"
  "stdio.v0.12.0"
  "stdlib-shims.0.1.0"
  "stringext.1.6.0"
  "topkg.1.0.1"
  "tyxml.4.3.0"
  "uchar.0.0.2"
  "uri.3.0.0"
  "uri-sexp.3.0.0"
  "uutf.1.0.2"
  "xml-light.2.4"
  "yojson.1.7.0"
  "zarith.1.9.1"
]
1 Like

My os is an Ubuntu 18.04.3. Here are results of the commands you asked:

$ opam list
# Packages matching: installed
# Name                        # Installed # Synopsis
astring                       0.8.3       Alternative String module for OCaml
base                          v0.12.2     Full standard library replacement for 
base-bigarray                 base
base-bytes                    base        Bytes library distributed with the OCa
base-threads                  base
base-unix                     base
base64                        3.2.0       Base64 encoding for OCaml
bigarray-compat               1.0.0       Compatibility library to use Stdlib.Bi
biniou                        1.2.1       Binary data format designed for speed,
calendar                      2.04        Library for handling dates and times i
camlp4                        4.07+1      Camlp4 is a system for writing extensi
cmdliner                      1.0.4       Declarative definition of command line
cohttp                        2.4.0       An OCaml library for HTTP clients and 
cohttp-lwt                    2.4.0       CoHTTP implementation using the Lwt co
cohttp-lwt-unix               2.4.0       CoHTTP implementation for Unix and Win
conduit                       2.0.2       A network connection establishment lib
conduit-lwt                   2.0.2       A portable network connection establis
conduit-lwt-unix              2.0.2       A network connection establishment lib
conf-gmp                      1           Virtual package relying on a GMP lib s
conf-gmp-powm-sec             1           Virtual package relying on a GMP lib w
conf-libpcre                  1           Virtual package relying on a libpcre s
conf-libssl                   1           Virtual package relying on an OpenSSL 
conf-m4                       1           Virtual package relying on m4
conf-npm                      1           Virtual package relying on npm install
conf-perl                     1           Virtual package relying on perl
conf-pkg-config               1.1         Virtual package relying on pkg-config 
conf-sqlite3                  1           Virtual package relying on an SQLite3 
conf-zlib                     1           Virtual package relying on zlib
cppo                          1.6.6       Code preprocessor like cpp for OCaml
cryptokit                     1.14        A library of cryptographic primitives.
cstruct                       5.0.0       Access C-like structures directly from
csv                           2.3         A pure OCaml library to read and write
deriving                      0.8.1       Extension to OCaml for deriving functi
domain-name                   0.3.0       RFC 1035 Internet domain names
dune                          1.11.4      Fast, portable and opinionated build s
dune-configurator             1.0.0
easy-format                   1.3.2       High-level and functional interface to
eliom                         6.9.1       Client/server Web framework
fieldslib                     v0.12.0     Syntax extension to define first class
fmt                           0.8.8       OCaml Format pretty-printer combinator
hex                           1.4.0       Library providing hexadecimal converte
ipaddr                        4.0.0       A library for manipulation of IP (and 
ipaddr-sexp                   4.0.0       A library for manipulation of IP addre
jbuilder                      transition  This is a transition package, jbuilder
js_of_ocaml                   3.4.0       Compiler from OCaml bytecode to Javasc
js_of_ocaml-camlp4            3.1.0       Compiler from OCaml bytecode to Javasc
js_of_ocaml-compiler          3.5.0       Compiler from OCaml bytecode to Javasc
js_of_ocaml-lwt               3.4.0       Compiler from OCaml bytecode to Javasc
js_of_ocaml-ocamlbuild        3.5.0       Compiler from OCaml bytecode to Javasc
js_of_ocaml-ppx               3.4.0       Compiler from OCaml bytecode to Javasc
js_of_ocaml-ppx_deriving_json 3.4.0       Compiler from OCaml bytecode to Javasc
js_of_ocaml-tyxml             3.4.0       Compiler from OCaml bytecode to Javasc
jsonm                         1.0.1       Non-blocking streaming JSON codec for 
logs                          0.7.0       Logging infrastructure for OCaml
lwt                           4.4.0       Promises and event-driven I/O
lwt_camlp4                    1.0.0       Camlp4 syntax extension for Lwt (depre
lwt_log                       1.1.1       Lwt logging library (deprecated)
lwt_ppx                       1.2.4       PPX syntax for Lwt, providing somethin
lwt_react                     1.1.3       Helpers for using React with Lwt
lwt_ssl                       1.1.3       OpenSSL binding with concurrent I/O
macaddr                       4.0.0       A library for manipulation of MAC addr
macaque                       0.7.4       Macaque (Macros for Caml Queries) is a
magic-mime                    1.1.2       Map filenames to common MIME types
mmap                          1.1.0       File mapping functionality
num                           1.2         The legacy Num library for arbitrary-p
oasis                         0.4.11      Tooling for building OCaml libraries a
ocaml                         4.07.1      The OCaml compiler (virtual package)
ocaml-base-compiler           4.07.1      Official release 4.07.1
ocaml-compiler-libs           v0.12.1     OCaml compiler libraries repackaged
ocaml-config                  1           OCaml Switch Configuration
ocaml-migrate-parsetree       1.4.0       Convert OCaml parsetrees between diffe
ocamlbuild                    0.14.0      OCamlbuild is a build system with buil
ocamlfind                     1.8.1       A library manager for OCaml
ocamlify                      0.0.1       Include files in OCaml code
ocamlmod                      0.0.9       Generate OCaml modules from source fil
ocamlnet                      4.1.6       Internet protocols (HTTP, CGI, e-mail 
ocplib-endian                 1.0         Optimised functions to read and write 
ocsigen-i18n                  3.4.0       I18n made easy for web sites written w
ocsigen-start                 2.3.0       pinned to version 2.3.0
ocsigen-toolkit               2.3.2       Reusable UI components for Eliom appli
ocsigenserver                 2.15.0      A full-featured and extensible Web ser
parsexp                       v0.12.0     S-expression parsing library
pcre                          7.4.1       Bindings to the Perl Compatibility Reg
pgocaml                       3.2         Interface to PostgreSQL databases
ppx_derivers                  1.2.1       Shared [@@deriving] plugin registry
ppx_deriving                  4.4         Type-driven code generation for OCaml 
ppx_fields_conv               v0.12.0     Generation of accessor and iteration f
ppx_sexp_conv                 v0.12.0     [@@deriving] plugin to generate S-expr
ppx_tools                     5.1+4.06.0  Tools for authors of ppx rewriters and
ppx_tools_versioned           5.2.3       A variant of ppx_tools based on ocaml-
ppxfind                       1.3         Tool combining ocamlfind and ppx
ppxlib                        0.8.1       Base library and tools for ppx rewrite
re                            1.9.0       RE is a regular expression library for
react                         1.2.1       Declarative events and signals for OCa
reactiveData                  0.2.2       Declarative events and signals for OCa
resource-pooling              0.8         Library for pooling resources like con
result                        1.4         Compatibility Result module
rresult                       0.6.0       Result value combinators for OCaml
safepass                      3.0         Facilities for the safe storage of use
seq                           base        Compatibility package for OCaml's stan
sexplib                       v0.12.0     Library for serializing OCaml values t
sexplib0                      v0.12.0     Library containing the definition of S
sqlite3                       4.4.1       SQLite3 bindings for OCaml
ssl                           0.5.9       Bindings for OpenSSL
stdio                         v0.12.0     Standard IO library for OCaml
stdlib-shims                  0.1.0       Backport some of the new stdlib featur
stringext                     1.6.0       Extra string functions for OCaml
topkg                         1.0.1       The transitory OCaml software packager
tyxml                         4.3.0       TyXML is a library for building correc
uchar                         0.0.2       Compatibility library for OCaml's Ucha
uri                           3.0.0       An RFC3986 URI/URL parsing library
uri-sexp                      3.0.0       An RFC3986 URI/URL parsing library
uutf                          1.0.2       Non-blocking streaming Unicode codec f
xml-light                     2.4         Xml-Light is a minimal XML parser & pr
yojson                        1.7.0       Yojson is an optimized parsing and pri
zarith                        1.9.1       Implements arithmetic and logical oper
$ opam list --roots
# Packages matching: root
# Name              # Installed # Synopsis
eliom               6.9.1       Client/server Web framework
ocaml-base-compiler 4.07.1      Official release 4.07.1
ocsigen-start       2.3.0       pinned to version 2.3.0
$ opam list --pinned
# Packages matching: pinned
# Name        # Installed # Synopsis
ocsigen-start 2.3.0       pinned to version 2.3.0

I indeed did not notice that I had to stop and delete a db before running another app. I will take care not doing that in the future and study the documentation on this point, thanks a lot for your advice !

The app is now running in my browser with working links, db, users, etc. I am so grateful, thanks a lot for your help :grinning:
For beginners, here I post the exact commands I ran to get it working from your (@RogerT) exported opam file:

opam pin add ocsigen_start 2.4.0 # if not, previous pinned version stays pinned
opam switch import ocsigen-start.2.4.0_setup --switch ocsigen_start.2.4.0
opam switch ocsigen_start.2.4.0
eval $(opam env)
sudo apt-get install nodejs-dev node-gyp libssl1.0-dev # without it I add pb on my machine with node-gyp, but it is certainly not the case on other machines
sudo apt-get install npm # same
opam depext ocsigen-start.2.4.0
eliom-distillery -name myapp9 -template os.pgocaml
cd myapp9
make db-init
make db-create
make db-schema
make test.byte

Thank you all for your help :slight_smile:
Best regards !

So you’re up and running, in less than two days. It was harder for beginners with older ocsigen-start versions.

You have to manage the DB of each ocsigen app.
You can run several ocsigen apps but you have to define a different port for each app (8080 8081 80…) in the file Makefile.options
Same thing with psql DBs: you should define a port for each app (3000 3001…).
If you restart your workstation, of course, you will have to do make db-start because it has been stopped (do make db-status to know more about the DB status).
Sometimes, you may have a process still working on port 3000 that doesn’t allow to init or start a DB. Killing the process is enough to free the port 3000 (I let you find how to do that, unix stuff).
Of course, you should backup/restore/delete each ocsigen app DB in a way that makes sense.

I would first select the switch then import the setup.

And doing this should be enough:

$ opam switch create 4.07.1
$ opam install depext
$ opam depext ocsigen-start
$ opam switch import ocsigen-start.2.4.0_setup  # see published setup file

I don’t remember if I needed to install manually node/nodejs stuff. It should be installed while building an app for the first time with make test.byte|opt

Also, have a look at opam documentation to learn how to set it up so you don’t need anymore to do eval $(opam env) each time you do opam switch 4.x.x (which is very boring).

Now you can enjoy Ocsigen web app development.

1 Like