Skip to content

Commit fda1fa2

Browse files
authored
Merge pull request #4798 from lexming/warn-nonreprod-sources
add warning about possible checksum verification failure on non-reproducible sources
2 parents 1449822 + be26cf3 commit fda1fa2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

easybuild/framework/easyblock.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,16 +399,24 @@ def get_checksum_for(self, checksums, filename=None, index=None):
399399
self.log.debug("Cannot get checksum without a file name")
400400
return None
401401

402-
if sys.version_info[0] >= 3 and sys.version_info[1] < 9:
402+
if chksum_input_git is not None:
403403
# ignore any checksum for given filename due to changes in https://github.com/python/cpython/issues/90021
404404
# tarballs made for git repos are not reproducible when created with Python < 3.9
405-
if chksum_input_git is not None:
405+
if sys.version_info[0] >= 3 and sys.version_info[1] < 9:
406406
self.log.deprecated(
407407
"Reproducible tarballs of Git repos are only possible when using Python 3.9+ to run EasyBuild. "
408408
f"Skipping checksum verification of {chksum_input} since Python < 3.9 is used.",
409409
'6.0'
410410
)
411411
return None
412+
# not all archives formats of git repos are reproducible
413+
# warn users that checksum might fail for non-reproducible archives
414+
_, file_ext = os.path.splitext(chksum_input)
415+
if file_ext not in ['', '.tar', '.txz', '.xz']:
416+
print_warning(
417+
f"Checksum verification may fail! Archive file '{chksum_input}' contains sources of a git repo "
418+
"in a non-reproducible format. Please re-create that archive with XZ compression instead."
419+
)
412420

413421
checksum = None
414422
# if checksums are provided as a dict, lookup by source filename as key

0 commit comments

Comments
 (0)