easybuild-framework icon indicating copy to clipboard operation
easybuild-framework copied to clipboard

Fix `to_checksums` with `None` values in dicts and recursion

Open Flamefire opened this issue 1 year ago • 0 comments

#4159 rebased to 5.0x

Having a 'src': None entry in a dict for checksums is as valid as having a None entry directly in the list. However the current function didn't handle it and crashed. Fix that as well as a few corner cases especially in the recursive case by introducing a new function for handling checksum entries in the checksum list and limiting the recursiveness.

It will now throw an EasyBuildError similar to e.g. to_dependency instead of trying to continue and fail at a random other place.
I extended the testcases to cover the original issue (None as a value in a dict) and some more correct and error cases

Please carefully review and check if you can come up with any valid or invalid checksums entry that might break using the new function. Especially regarding the YEB compatibility this was pretty hard as for lists of strings you cannot know if those are 2 checksums without a type that should both match or a checksum and type. In EC-files (Python) one can use a tuple for that but then again it is hard to tell if that tuple is a checksum and type or 2 alternative checksums.

Fixes #4142

  • [ ] Requires #4578 (contained here)
  • [ ] https://github.com/easybuilders/easybuild-docs/pull/104

Flamefire avatar Jul 17 '24 10:07 Flamefire