Thanks for the pointer, @rgrinberg! Your work on this feature should be a big help when it is done.
However, for the time being, it sounds like the real answer to my question is, “You are mistaken. There is no easy and elegant way to achieve this workflow at the moment. You have to either wait for future development, or develop a much deeper understanding of jbuilder and roll your own solution”.
Needless to say, I am a bit disappointed. But I do understand that the OCaml ecosystem is under development and steadily evolving. (I suspect that I switched out solvuu-build
for jbuilder
too quickly: I was able to achieve this workflow in the former without much hassle. solvuu-build
realizes this through .ocamlinit
generation rather than via a custom toplevel.)
I have spent about a week puzzling out how to move my project to jbuilder
. This has been interesting, and rewarding, but I am eager to make some concrete progress before devoting another week to learning more of the intricacies of the build system.
For a very hacky solution to my current problem, I believe that this ugly command
$ jbuilder clean && cd lib && jbuilder clean && jbuilder build @install && jbuilder install && cd .. && jbuilder build myutop.bc && ./myutop
combined with a #require "mylibrary"" in the project's
.ocamlinit`, will serve as a band-aid.
I’ll be watching your PR for the introduction of a better solution, tho!
I wonder if anyone here would be interested or surprised to learn that I am feeling nostalgic for SML/NJ’s Compilation Manager. I think I was able to get going with that substantially quicker than I have with any of the three OCaml build systems I’ve tried out…
. (Of course, I believe one pays a price in lack of features.)