Hmm, running that last command manually doesn’t segfault so maybe it’s an opam bug, I’ll signal it but not quite sure how to reproduce on other laptops
I cloned a fresh repo, created a fresh switch with the same invariant. Installed the same git version. Then did some modifications and tried to reinstall with --working-dir. I don’t get a segfault but I get:
[ERROR] The compilation of soteria-c.dev failed at "dune build -p soteria-c -j 15
--promote-install-files=false @install"
# Error: The package soteria-c does not have any user defined stanzas attached
# to it. If this is intentional, add (allow_empty) to the package definition in
# the dune-project file
# -> required by _build/default/soteria-c.install
# -> required by alias install
works perfectly fine. I also have several dune files with library or executable stanzas that contain (package soteria-c).
The only diff is that I added some let () = failwith "" at the end of the main executable of the package to check if it would crash as expected after installation.
I’ve submitted an issue but I don’t even know if that one is reproducible (or if it’s even a bug)
This isn’t since it doesn’t point to the segfault you experienced but talks about another subject (the default behaviour of opam pin).
Could you try running opam reinstall soteria-c --switch=bfa-install --working-dir --debug-level=3 and paste here the relevant bit at the end (last handful of lines)?
The OP seems to be wanting to use opam as a development-time tool: to install interim versions of code, modify, then repeat. But this is what a build-system is for, and opam isn’t a build-system. Or at least, that’s what I believe. And dune (or make) as a build system is perfectly capable of doing these things.
Which doesn’t mean you can’t do it with opam: just that, well, it’s a lot more cumbersome and slow.
opam is useful to test the install of your packages and the effect of their ongoing development on other dependent packages.
For that one-shot opam install or sticky opam pin are tremendously useful as a development time-tool: to install interim versions of code, modify, then repeat. And this what a package manager is for, and opam is a package manager.