I’ve been looking for a solution that won’t require keeping a terminal session open, and while the accepted approach here gets me close, it doesn’t quite work out. If I use @ejgallego’s function as is, then it doesn’t pick up my opam switch environment. But if I prefix the build command with
opam exec -- <...> then it seems to not be depositing the build artifacts in the correct location!
I’ll keep noodling around on this, but if anyone knows a better way off the top of their heads I’d be grateful for it.
Ultimately, I’d like an emacs integration with
dune --watch, that will give me push notifications when something in the project breaks, rather than having to pull that info out by telling dune to build manually. But I’d be happy if I could get a clean build/fix cycle working inside of emacs for a start