Hi all,
I've been moving to the most recent piqi / piqi-ocaml revisions (trying to rebase the changes I did on an older revision, before the split), and I now run into an issue that I did not have before. I've tried to nail it down to a simple case:
I have 2 .proto files. First one, called "id.proto" contains:
package test;
message Id
{
required int64 id = 1; // Unique ID
}
Second one, called "example.proto" contains:
package test;
import "id.proto";
message example
{
required Id id = 1;
}
I use piqi of-proto --normalize to generate the piqi files, and then piqic-ocaml --pp --multi-format the generate the _
piqi.ml and _
piqi_ext.ml files. This works fine.
Next, I've created a simple Ocaml program:
let x = Example_piqi.default_example () in
Example_piqi_ext.print_example x
Compiling this works fine, however when running it I get this error: Fatal error: exception Piqi_common.Error(_, "imported piqi module is not found: "id"")
I've tried going through the Piqi code, and I noticed there is a global cache of modules which gets used when the _piqi_ext.ml file is evaluated (at start-up) during the parsing of the piqi value from the _piqi.ml file. I have the impression that it cannot find the "id" module at that time, and then will try to look (on disk) in some paths for the .piqi file, which is something that I did not expect (I would have though the .piqi files only need to be there at code-generation-time, not at runtime)
Any ideas on what is causing this?
thanks,
Koen