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

The per-switch installed cache's content is subtly different after an install vs. after a restore #6031

Open kit-ty-kate opened 2 weeks ago

kit-ty-kate commented 2 weeks ago

https://github.com/ocaml/opam/blob/872015f6367d42cf92121e3a206a4d58372915dc/tests/reftests/effectively-equal.test#L220 from https://github.com/ocaml/opam/pull/6029 shows that, unless the cache is removed, the content of the cache is filled with data directly coming from the repository. However when the cache is regenerated it is filled with content from <switch>/.opam-switch/packages/*/opam which happens to be reformatted (normalised), thus the content of (at least) OpamFile.OPAM.extensions is different as it contains some positional informations.

This is not a critical bug by any means but we might want to look at it at some point. I'm not sure either what would be the correct fix for this (not storing normalised files vs. not storing positional information vs. ...)