-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow config.guess code from configuremake.py to be used in rpackage.py #1938
Changes from all commits
055784d
01d18ba
5b75a11
5350e65
5c29830
0877c4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,10 @@ | |
from easybuild.framework.easyconfig import CUSTOM | ||
from easybuild.framework.extensioneasyblock import ExtensionEasyBlock | ||
from easybuild.tools.build_log import EasyBuildError | ||
from easybuild.tools.filetools import mkdir | ||
from easybuild.tools.filetools import mkdir, copy_file | ||
from easybuild.tools.run import run_cmd, parse_log_for_error | ||
from easybuild.easyblocks.generic.configuremake import ConfigureMake | ||
from easybuild.tools.build_log import print_warning | ||
|
||
|
||
def make_R_install_option(opt, values, cmdline=False): | ||
|
@@ -74,6 +76,7 @@ def extra_options(extra_vars=None): | |
extra_vars.update({ | ||
'exts_subdir': ['', "Subdirectory where R extensions should be installed info", CUSTOM], | ||
'unpack_sources': [False, "Unpack sources before installation", CUSTOM], | ||
'update_config_guess': [False, "Update the config.guess file(s) in this package", CUSTOM], | ||
}) | ||
return extra_vars | ||
|
||
|
@@ -134,7 +137,7 @@ def make_cmdline_cmd(self, prefix=None): | |
|
||
if self.cfg['unpack_sources']: | ||
loc = self.start_dir | ||
elif self.patches: | ||
elif self.patches or self.cfg['update_config_guess']: | ||
loc = self.ext_dir | ||
else: | ||
loc = self.ext_src | ||
|
@@ -215,11 +218,22 @@ def run(self): | |
lib_install_prefix = os.path.join(self.installdir, self.cfg['exts_subdir']) | ||
mkdir(lib_install_prefix, parents=True) | ||
|
||
if self.patches: | ||
if self.patches or self.cfg['update_config_guess']: | ||
super(RPackage, self).run(unpack_src=True) | ||
else: | ||
super(RPackage, self).run() | ||
|
||
if self.cfg['update_config_guess']: | ||
confmake = ConfigureMake(self.cfg) | ||
for root, _, files in os.walk(self.builddir): | ||
for name in files: | ||
if name == 'config.guess': | ||
confmake.config_guess = os.path.join(root, name) | ||
if not confmake.check_config_guess(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ConfigureMake EB does this unconditionally (probably based on the assumption that it is highly unlikely that the config.guess matches). So I'd do the same here. As an alternative: Add a quiet option to the check_config_guess to avoid the warnings. IMO there is nothing to warn about here. For the ConfigureMake EB the updating of the config.guess is the natural thing to do. So the output generated by |
||
updated = confmake.obtain_config_guess() | ||
print_warning("Using updated config.guess for %s", confmake.config_guess) | ||
copy_file(updated, confmake.config_guess) | ||
|
||
if self.src: | ||
self.ext_src = self.src | ||
self.log.debug("Installing R package %s version %s." % (self.name, self.version)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the better option would be to make
obtain_config_guess
a static or better free function. It mostly is already anyway.