opam icon indicating copy to clipboard operation
opam copied to clipboard

Make OpamFile.OPAM.effectively_equal return true if a checksum is added

Open kit-ty-kate opened this issue 1 year ago • 1 comments

https://github.com/ocaml/opam-repository/pull/25960 changed a large portion of files in opam-repository.

OpamFile.OPAM.effective_part takes only the first checksum when computing the effective equality https://github.com/ocaml/opam/blob/master/src/format/opamFile.ml#L3575

However that PR added the new checksum at the top so opam detects the changed files as not equal. I believe we should get rid of effective_part entirely and detect if there is a common checksum when detecting changes in effectively_equal

kit-ty-kate avatar Jul 08 '24 14:07 kit-ty-kate

Rather than a common checksum, I think it ought to be that A effectively-equals B iff all the checksums of A are present-and-equal in B or all the checksums of B are present-and-equal in A (i.e. they’re only effectively equal if one package has strictly more checksums than the other). Paging https://github.com/ocaml/opam/pull/5258#issuecomment-1224097541 back in, should we be worrying properly about checksum strength - if a package was installed where only MD5 checksums were available, shouldn’t we trigger a rebuild when stronger checksums are added?

dra27 avatar Jul 15 '24 08:07 dra27