eliom icon indicating copy to clipboard operation
eliom copied to clipboard

Eliomopt doesn't work with subdirectories

Open rand00 opened this issue 9 years ago • 1 comments

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_http_error(_) (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 avatar Oct 22 '16 17:10 rand00

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

rand00 avatar Oct 22 '16 20:10 rand00