opam
opam copied to clipboard
Fix incorrect package installed state written on error
If a package needs to be rebuilt because of upstream changes, an error in the rebuild causes a cache indicating that it's installed to be written. Something appears to be wrong in OpamClient.parallel_apply, but I haven't got to the bottom of exactly what.
What I have written is a test! Spotted while debugging #5921 - because errors during fetch also trigger this. Note in the commit history that erasing .opam-switch/packages/cache causes opam to do the right thing on the second upgrade.
In the 2.2 project as I haven't yet determined if this is a regression or long-standing.
Superseded by https://github.com/ocaml/opam/pull/6213