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 11b6db2
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions easybuild/easyblocks/generic/configuremake.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from easybuild.easyblocks import VERSION as EASYBLOCKS_VERSION
from easybuild.framework.easyblock import EasyBlock
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import print_warning
from easybuild.tools.build_log import print_warning, EasyBuildError
from easybuild.tools.config import source_paths, build_option
from easybuild.tools.filetools import CHECKSUM_TYPE_SHA256, adjust_permissions, compute_checksum, download_file
from easybuild.tools.filetools import read_file, remove_file
Expand Down 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:
raise EasyBuildError("Support for passing arguments to 'obtain_config_guess' has been removed "
"and 'source_paths' will always be used")
return obtain_config_guess()

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

0 comments on commit 11b6db2

Please sign in to comment.