Skip to content

Commit 6188cc7

Browse files
committed
ignore checksums of sources from git repos prior to Python 3.9
1 parent 3936a6e commit 6188cc7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

easybuild/framework/easyblock.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import os
5050
import re
5151
import stat
52+
import sys
5253
import tempfile
5354
import time
5455
import traceback
@@ -359,14 +360,27 @@ def get_checksum_for(self, checksums, filename=None, index=None):
359360
:param index: index of file in list
360361
"""
361362
chksum_input = filename
363+
chksum_input_git = None
362364
# if filename is provided as dict, take 'filename' key
363365
if isinstance(filename, dict):
364366
chksum_input = filename['filename']
367+
chksum_input_git = filename.get('git_config', None)
365368
# early return if no filename given
366369
if chksum_input is None:
367370
self.log.debug("Cannot get checksum without a file name")
368371
return None
369372

373+
if sys.version_info[0] >= 3 and sys.version_info[1] < 9:
374+
# ignore any checksum for given filename due to changes in python/cpython#90021
375+
# checksums of tarballs made by EB of git repos cannot be reliably checked prior to Python 3.9
376+
if chksum_input_git is not None:
377+
self.log.deprecated(
378+
"Reproducible tarballs of git repos are only supported in Python 3.9+. "
379+
f"Checksum of {chksum_input} cannot be verified.",
380+
'5.0'
381+
)
382+
return None
383+
370384
checksum = None
371385
# if checksums are provided as a dict, lookup by source filename as key
372386
if isinstance(checksums, dict):

0 commit comments

Comments
 (0)