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

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

Open akesandgren opened this issue 2 years ago • 4 comments

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

akesandgren avatar Dec 15 '22 13:12 akesandgren

related to #4150

boegel avatar Jan 04 '23 09:01 boegel

Working on that and found more issues with that function

Flamefire avatar Jan 04 '23 10:01 Flamefire

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 avatar Jan 10 '23 17:01 Flamefire

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)

Flamefire avatar Jan 12 '23 14:01 Flamefire