Fix to_checksums with None values in dicts and recursion#4579
Merged
bartoldeman merged 1 commit intoeasybuilders:5.0.xfrom Jan 13, 2025
Merged
Fix to_checksums with None values in dicts and recursion#4579bartoldeman merged 1 commit intoeasybuilders:5.0.xfrom
to_checksums with None values in dicts and recursion#4579bartoldeman merged 1 commit intoeasybuilders:5.0.xfrom
Conversation
cc6e27a to
fb20fd2
Compare
to_checksums with None values in dicts and recursion
2 tasks
fb20fd2 to
069dc9d
Compare
This was referenced Dec 18, 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
069dc9d to
d74419f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#4159 rebased to 5.0x
Having a
'src': Noneentry in a dict for checksums is as valid as having aNoneentry 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
EasyBuildErrorsimilar to e.g.to_dependencyinstead 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
checksumsentry 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
checksumseasyconfig parameter easybuild-docs#104