Skip to content

Commit 11b6db2

Browse files
committed
Remove (buggy) support for passing arguments into ConfigureMake.obtain_config_guess
- search_source_paths was totally ignored (Bug) - download_source_path was hard to use as final location was not obvious - not used by anything in EasyBuild itself Throw readable error when any argument is passed to make future maintenance easier and avoid users running into the bug.
1 parent bb9c074 commit 11b6db2

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

easybuild/easyblocks/generic/configuremake.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from easybuild.easyblocks import VERSION as EASYBLOCKS_VERSION
4545
from easybuild.framework.easyblock import EasyBlock
4646
from easybuild.framework.easyconfig import CUSTOM
47-
from easybuild.tools.build_log import print_warning
47+
from easybuild.tools.build_log import print_warning, EasyBuildError
4848
from easybuild.tools.config import source_paths, build_option
4949
from easybuild.tools.filetools import CHECKSUM_TYPE_SHA256, adjust_permissions, compute_checksum, download_file
5050
from easybuild.tools.filetools import read_file, remove_file
@@ -106,29 +106,24 @@ def check_config_guess(config_guess):
106106
return result
107107

108108

109-
def obtain_config_guess(download_source_path=None, search_source_paths=None):
109+
def obtain_config_guess():
110110
"""
111111
Locate or download an up-to-date config.guess
112112
113-
:param download_source_path: Path to download config.guess to
114-
:param search_source_paths: Paths to search for config.guess
115113
:return: Path to config.guess or None
116114
"""
117115
log = fancylogger.getLogger('config.guess')
118116

119-
eb_source_paths = source_paths()
120-
if download_source_path is None:
121-
download_source_path = eb_source_paths[0]
122-
if search_source_paths is None:
123-
search_source_paths = eb_source_paths
117+
search_source_paths = source_paths()
118+
download_source_path = search_source_paths[0]
124119

125120
config_guess = 'config.guess'
126121
sourcepath_subdir = os.path.join('generic', 'eb_v%s' % EASYBLOCKS_VERSION, 'ConfigureMake')
127122

128123
config_guess_path = None
129124

130125
# check if config.guess has already been downloaded to source path
131-
for path in eb_source_paths:
126+
for path in search_source_paths:
132127
cand_config_guess_path = os.path.join(path, sourcepath_subdir, config_guess)
133128
if os.path.isfile(cand_config_guess_path) and check_config_guess(cand_config_guess_path):
134129
force_download = build_option('force_download')
@@ -187,15 +182,17 @@ def __init__(self, *args, **kwargs):
187182

188183
self.config_guess = None
189184

190-
def obtain_config_guess(self, download_source_path=None, search_source_paths=None):
185+
def obtain_config_guess(self, *args, **kwargs):
191186
"""
192187
Locate or download an up-to-date config.guess for use with ConfigureMake
193188
194-
:param download_source_path: Path to download config.guess to
195-
:param search_source_paths: Paths to search for config.guess
189+
No arguments allowed
196190
:return: Path to config.guess or None
197191
"""
198-
return obtain_config_guess(download_source_path, search_source_paths)
192+
if args or kwargs:
193+
raise EasyBuildError("Support for passing arguments to 'obtain_config_guess' has been removed "
194+
"and 'source_paths' will always be used")
195+
return obtain_config_guess()
199196

200197
def check_config_guess(self):
201198
"""Check timestamp & SHA256 checksum of config.guess script."""

0 commit comments

Comments
 (0)