Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to_checksums with None values in dicts and recursion #4579

Open
wants to merge 1 commit into
base: 5.0.x
Choose a base branch
from

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Jul 17, 2024

#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

@Flamefire Flamefire force-pushed the fix-to_checksums-5 branch from cc6e27a to fb20fd2 Compare July 17, 2024 10:47
@boegel boegel added bug fix EasyBuild-5.0 EasyBuild 5.0 labels Jul 31, 2024
@boegel boegel changed the title Fix to_checksums with None values in dicts and recursion - 5.0x Fix to_checksums with None values in dicts and recursion Jul 31, 2024
@boegel boegel changed the title Fix to_checksums with None values in dicts and recursion Fix to_checksums with None values in dicts and recursion Jul 31, 2024
@boegel boegel added this to the 5.0 milestone Jul 31, 2024
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.

Fixes easybuilders#4142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Blockers
Development

Successfully merging this pull request may close these issues.

2 participants