alavrik / piqi

Piqi – universal schema language: JSON, XML, Protocol Buffers data validation and conversion
http://piqi.org
Apache License 2.0
246 stars 36 forks source link

Commit changes in order that, when piqi is built the ocaml interpreter can load it at runtime #49

Closed KennethAdamMiller closed 9 years ago

KennethAdamMiller commented 9 years ago

An rather irksome bug has been plagueing me for the past 3 days. It was impossible to load the piqi library at runtime, and after a lengthy process to get it to work I found out what it was.

I couldn't well specify to OCamlMakefile that -custom should not be used and still get the requisite dependencies of the .so file out cleanly. It has an option for compiling a toplevel for just this library, but that's not a sufficient solution. Oasis is the appropriate tool for building a custom toplevel much more cleanly and what I'm familiar with, but I'm not in the business of telling people what to do. So, what I did was put a small hot fix in the makefile so it would be done correctly. It works, and I tested it as best I could.

alavrik commented 9 years ago

Thank you so much for tracking this down! The actual change turned out to be trivial. Everything seems to be working with utop now. Can you please test it and if everything checks out I'll push a new piqilib opam release right away. Note that the bytecode library is build by running make ocaml and installed by make ocaml-install.