easybuilders / easybuild-framework

EasyBuild is a software installation framework in Python that allows you to install software in a structured and robust way.
https://easybuild.io
GNU General Public License v2.0
149 stars 202 forks source link

checksum dict with a checksum value of None doesn't work #4142

Open akesandgren opened 1 year ago

akesandgren commented 1 year ago

This failes with --check-contrib, -D, and --new-pr

checksums = [
    {'v2.12.4.tar.gz': '31c1f4f91efbdb74619cebb36f57f999d6f1a57bb6f87b13e60d21e670c38f68'},
    {'CCCoreLib-20220714.tar.gz': None},
]

--check-contrib and -D fails on the above with

ERROR: Failed to process easyconfig /afs/hpc2n.umu.se/home/a/ake/Projects/git-repos/easybuild/easybuild_common/custom/easyconfigs/c/CloudCompare/CloudCompare-2.12.4-foss-2021b.eb: Converting type of [{'v2.12.4.tar.gz': '31c1f4f91efbdb74619cebb36f57f999d6f1a57bb6f87b13e60d21e670c38f68'}, {'CCCoreLib-20220714.tar.gz': None}] (<class 'list'>) to (<class 'list'>, (('elem_types', (<class 'str'>, <class 'tuple'>, (<class 'dict'>, (('elem_types', (<class 'str'>,)), ('key_types', (<class 'str'>,)))), (<class 'list'>, (('elem_types', (<class 'str'>, <class 'tuple'>, (<class 'dict'>, (('elem_types', (<class 'str'>,)), ('key_types', (<class 'str'>,)))))),)))),)) using <function to_checksums at 0x7fb0e86b4ee0> failed: 'NoneType' object is not iterable
boegel commented 1 year ago

related to #4150

Flamefire commented 1 year ago

Working on that and found more issues with that function

Flamefire commented 1 year ago

Ok got 2 PRs ready which should fix this and related issues. Turned out it was way harder than anticipated due to support of YEB files that don't have tuples.

Flamefire commented 1 year ago

I think we should first discuss and settle on a specification of checksums. I started a PR at https://github.com/easybuilders/easybuild/pull/853 to serve as a basis for discussion. E.g. currently it is not documented, that you can use a dict at all and hence the meaning of a None entry or a missing key/filename is even less clear.

FWIW: Not only the check fails but None as a value is currently not supported by the checksum check function and would yield a cryptic error. The same as not having the filename listed in the dict (before #4150 gets merged)