Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ocamlbuild] Order of include dirctories get modified

17 views
Skip to first unread message

unk...@gmail.com

unread,
Nov 2, 2015, 6:31:31 PM11/2/15
to
I'm trying to build Flowtype (see https://github.com/facebook/flow) but fail because it seems there is some problem with the order the include directories are passed to ocamlc.opt. (See https://github.com/facebook/flow/issues/1013 for more details on the issue in the Flowtype bugtracker).

In short: The following command is executed
ocamlbuild -no-links -I src/commands -I src/common -I src/dts -I src/embedded -I src/parser -I src/parsing -I src/server -I src/stubs -I src/typing -I hack/deps -I hack/dfind -I hack/find -I hack/globals -I hack/heap -I hack/parsing -I hack/procs -I hack/search -I hack/socket -I hack/stubs -I hack/third-party/avl -I hack/third-party/core -I hack/utils -I hack/third-party/inotify -I hack/fsnotify_linux -lib unix -lib str -lflags "hack/third-party/inotify/inotify_stubs.o hack/heap/hh_shared.o hack/hhi/hhi_elf.o hack/utils/files.o hack/utils/get_build_id.gen.o hack/utils/get_build_id.o hack/utils/handle_stubs.o hack/utils/nproc.o hack/utils/realpath.o hack/utils/sysinfo.o src/embedded/flowlib_elf.o -cclib -l -cclib elf " src/flow.native

Which results in a call of.

+ /usr/bin/ocamlc.opt -c -w A -warn-error A -w -27-32-34-45 -w -4-6-29-35-44-48-50 -I src/server -I hack/search -I hack/deps -I hack/heap -I hack/fsnotify_linux -I hack/stubs -I hack/dfind -I hack/find -I hack/procs -I hack/parsing -I hack/globals -I hack/socket -I hack/utils -I hack/third-party/avl -I hack/third-party/inotify -I hack/third-party/core -I src/parser -I src/common -I src/embedded -I src/commands -I src/stubs -I src/dts -I src/typing -I src/parsing -o src/server/autocompleteService_js.cmo src/server/autocompleteService_js.ml
File "src/server/autocompleteService_js.ml", line 128, characters 14-29:
Error: Unbound value Debug.json_of_t

See that the order of the passed in include directories has changed. In the call to ocamlbuild the flag -I src/typing was before -I hack/stubs. In both src/typing and hack/stubs there is a debug.ml and the one in src/typing should be the one that gets used, but due to the changed order of include directories hack/stubs has precedence.

What could I do to force ocamlbuild to keep the order of the include directories?
0 new messages