opam
opam copied to clipboard
Opam does install package despite download hash error
In a local patch opam repo I did a mistake in setting the download hash (I used the wrong type). Opam did detect the error but installed the package anyway. Is this expected behavior?
[ERROR] In the opam file for coq-unicoq.1.3+8.11:
- At
/Users/msoegtrop/.opam/repo/patch_coq-platform_.8.11.2.alpha1/packages/coq-unicoq/coq-unicoq.1.3+8.11/opam:22:145:
while expecting checksum: Invalid_argument("OpamHash.of_string")
'url.checksum' has been ignored.
The following actions will be performed:
- install coq-unicoq 1.3+8.11
opam version = 2.0.7.
It is the expected behavior as it is an parsing error and the field is not mandatory, so a wrong checksum (because of an parse error) results on a missing checksum.
I must say I don't find this very agreeable. It is easy to overlook this - I tend to install 50 opam packages en batch. Are there good reasons for this choice or is it more that this is what the implementation does without explicitly handling it otherwise?
This definitely needs to be fixed, but we'll address this for opam 2.2 as part of a wider check of the checksums!