ocsigen / eliom

Multi-tier framework for programming web and mobile applications in OCaml.
http://eliom.org
Other
298 stars 52 forks source link

Eliomopt doesn't work with subdirectories #408

Open rand00 opened 7 years ago

rand00 commented 7 years ago

Don't know if this is the case with eliomc. The documentation of the compilation workflow states:

[eliomc & js_of_eliom] are wrappers around ocamlfind, ocamlc and js_of_ocaml.

... Which should make it possible to supply -I <dir> args as with ocamlfind ocamlopt etc.

When running the following script, making use of eliomopt, I get a "succesfully" compiled cmxs and a running server - but when visiting the registered path on localhost, I get the following in my browser:

Not Found Error 404 Ocsigen_extensions.Ocsigen_httperror() (Ocsigen running in debug mode)

It all works without having source files in src.

#! /bin/bash

set -e
export ELIOM_SERVER_DIR=./server
export ELIOM_CLIENT_DIR=./client 
if [[ -e public/app.js ]]; then \
    rm public/app.js
fi

eliomopt -ppx -shared -o server/src/app.cmxs -I src 
js_of_eliom -ppx -o client/app.js src/bar.ml src/app.eliom
ln -s $PWD/$ELIOM_CLIENT_DIR/app.js public/
ocsigenserver.opt -v -c config/server_eliomopt.xml
rand00 commented 7 years ago

Ok just found out that the ocamlbuild plugin doesn't support subdirectories with depth>1 -> The statements

<src/**>: include
<src/dir2/**>: include

are 'ignored' in the _tags file unlike plain ocamlbuild.

Would be really nice if there were just one + simple build option (ie. not OASIS) that one could start with without having to resort to depth=0/1 directory layout