Skip to content

Commit

Permalink
Remove (buggy) support for passing arguments into ConfigureMake.obtai…
Browse files Browse the repository at this point in the history
…n_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.
  • Loading branch information
Flamefire committed Apr 27, 2020
1 parent bb9c074 commit 8af677b
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions easybuild/easyblocks/generic/configuremake.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,24 @@ def check_config_guess(config_guess):
return result


def obtain_config_guess(download_source_path=None, search_source_paths=None):
def obtain_config_guess():
"""
Locate or download an up-to-date config.guess
:param download_source_path: Path to download config.guess to
:param search_source_paths: Paths to search for config.guess
:return: Path to config.guess or None
"""
log = fancylogger.getLogger('config.guess')

eb_source_paths = source_paths()
if download_source_path is None:
download_source_path = eb_source_paths[0]
if search_source_paths is None:
search_source_paths = eb_source_paths
search_source_paths = source_paths()
download_source_path = search_source_paths[0]

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

config_guess_path = None

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

self.config_guess = None

def obtain_config_guess(self, download_source_path=None, search_source_paths=None):
def obtain_config_guess(self, *args, **kwargs):
"""
Locate or download an up-to-date config.guess for use with ConfigureMake
:param download_source_path: Path to download config.guess to
:param search_source_paths: Paths to search for config.guess
No arguments allowed
:return: Path to config.guess or None
"""
return obtain_config_guess(download_source_path, search_source_paths)
if args or kwargs:
self.log.nosupport("Support for passing arguments to 'obtain_config_guess' has been removed "
"and 'source_paths' will always be used", '4.2.1')
return obtain_config_guess()

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

0 comments on commit 8af677b

Please sign in to comment.