Oh, ok, I … think that makes sense. Let me try to explain back to you:
(1) opam install doesn’t merely -install-: it runs the “build” and “install” stanzas of the opam file.
(2) So your first “opam install’ built and install the package from sources. But it doesn’t build in-place: it copies to a build-tree over in opam-managed space.
(3) so you updated the source and built using dune, in the local source-tree.
(4) then you tried opam install again. But that doesn’t work, b/c it is already installed. The -package- is already installed in step #2. So you need to uninstall the package, make sure it’s unpinned, and then opam install again.
Does that make sense? [I’m expressing what I believe to be true; I could be very wrong, but this is the working model I use of how opam works] I think you’re thinking of opam install as kind of like “make install”, but really it’s more “apt-get install” (combined a build).
Maybe what you want to do is a “dune install” ?
So often when I’m developing, I want to stay in the actual source directory: I want to build, then install, then maybe modify something, rebuild, reinstall, etc. I use Makefiles, but I suspect the same workflow cycle works with dune. I do:
(a) “make all install”
(b) [modify some files]
(c) “make all install”
(d) maybe I realized I need to do very pervasive fixup/change, so I do “make uninstall”, then “make clean”, then “make all install”
etc. None of this touches the opam-managed files, and eventually when I want to do an opam install I’m careful to do a make uninstall first. A few times, I’ve gotten into a situation where there both a make install and an opam install version of a package, and that can get confusing.
Does this help?