ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.21k stars 348 forks source link

Fix incorrect package installed state written on error #5922

Open dra27 opened 3 months ago

dra27 commented 3 months ago

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.

dra27 commented 3 months ago

In the 2.2 project as I haven't yet determined if this is a regression or long-standing.