If I have a local Git repo on some branch/commit, is there a reliable way to make opam install it locally.
These options all work if you have never installed it before:
opam install . --yes
opam pin . --yes
However if you then add a new commit or switch branch they sometimes work, but it just seems to arbitrarily decide that nothing has changed and it won't do anything. Is there any way to force it to recompile and reinstall?
I have tried
opam reinstall . --yes
and adding --working-dir, but --working-dir seems to have no effect. In general opam is very confusing.
Is there something that works sanely like cargo install --path . --force for Rust?
Opam behaves oddly but not arbitrarily with respect to a dependency which is pinned to a local directory which is cloned by git. By default it will only pick up a change if that change has been committed.
The --working-dir option is intended to enable uncommitted changes to be picked up, although I have never used it. One point about it is that it appears its effect only lasts until the next explicit update, at which point as I understand it you have to reapply the option: but as I say I have never used it.