Version française
Home     About     Download     Resources     Contact us    
Browse thread
ocamlbuild .inferred.mli problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hezekiah M. Carty <hcarty@a...>
Subject: ocamlbuild .inferred.mli problem
I have been unable to get ocamlbuild to preprocess a single .ml file
when creating an inferred interface file.  Here is some simple code
to illustrate the problem:

test.ml:
value f x = x + 2;

_tags:
<test.ml>: pp(camlp4r)

To build it:
$ ocamlbuild test.cma
  ^^^ This works without issue

$ ocamlbuild test.inferred.mli
 ^^^ This produces the following output/error:
---BEGIN PASTE---
+ /home/hcarty/Applications/godi/bin/ocamlc.opt -i test.ml >
test.inferred.mli
File "test.ml", line 1, characters 0-5:
Unbound value value
Command exited with code 2.
Compilation unsuccessful after building 2 targets (1 cached) in
00:00:00.
---END PASTE---

I have tried various changes with the _tags line, such as:
<test.{ml,mli,inferred.mli}>
and others, but have had no success.

I have also tried creating a myocamlbuild.ml to get around this, but
using something like this in myocamlbuild.ml:

flag ["use_openin"]
  (S [A "-I"; A "+camlp4"; A "-pp"; A "camlp4o pa_openin.cmo"]);;

along with a matching flag in _tags causes havoc, with each of the
items on the list being repeated twice and quoted, leading to shell
errors.

I'm using revised syntax here as a simple example.  I originally ran
in to this issue while trying to build a library which uses the
pa_openin camlp4 extension.

Any suggestions or pointers on how to proceed with this?

Thanks,
Hez