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

Nullify positions of the extensions fields in OpamFile.OPAM.effective_part #6029

Closed kit-ty-kate closed 2 weeks ago

kit-ty-kate commented 2 weeks ago

Fixes #6028

Prior to https://github.com/ocaml/opam/pull/5636, opam did not traverse the extension fields when testing equality. Prior to https://github.com/ocaml/opam-repository/pull/25861, very few packages actually had the x-env-path-rewrite field so the problem did not occur. Users with a fresh install cache saved after an install will also not immediately notice this issue (see https://github.com/ocaml/opam/issues/6031)

The issue was that the extension field carries all the positions of the original file and opam files of installed packages are saved in their normalised form which changes the positions of the fields, so when OpamFile.OPAM.effectively_equal is called it would see a difference in the extension field.

rjbou commented 2 weeks ago

Failing CI is from benchmark test broken.