Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ def make_builddir(self):
self.log.info("Overriding 'cleanupoldinstall' (to False), 'cleanupoldbuild' (to True) "
"and 'keeppreviousinstall' because we're building in the installation directory.")
# force cleanup before installation
if build_option('module_only'):
if build_option('module_only') or self.cfg['module_only']:
self.log.debug("Disabling cleanupoldbuild because we run as module-only")
self.cfg['cleanupoldbuild'] = False
else:
Expand Down Expand Up @@ -1139,7 +1139,7 @@ def make_dir(self, dir_name, clean, dontcreateinstalldir=False):
if self.cfg['keeppreviousinstall']:
self.log.info("Keeping old directory %s (hopefully you know what you are doing)", dir_name)
return
elif build_option('module_only'):
elif build_option('module_only') or self.cfg['module_only']:
self.log.info("Not touching existing directory %s in module-only mode...", dir_name)
elif clean:
remove_dir(dir_name)
Expand Down Expand Up @@ -2114,7 +2114,7 @@ def guess_start_dir(self):
start_dir = ''
# do not use the specified 'start_dir' when running as --module-only as
# the directory will not exist (extract_step is skipped)
if self.start_dir and not build_option('module_only'):
if self.start_dir and not build_option('module_only') and not self.cfg['module_only']:
start_dir = self.start_dir

if not os.path.isabs(start_dir):
Expand Down Expand Up @@ -3795,7 +3795,7 @@ def make_module_step(self, fake=False):
try:
self.make_devel_module()
except EasyBuildError as error:
if build_option('module_only'):
if build_option('module_only') or self.cfg['module_only']:
self.log.info("Using --module-only so can recover from error: %s", error)
else:
raise error
Expand Down Expand Up @@ -3903,7 +3903,7 @@ def skip_step(self, step, skippable):
"""Dedice whether or not to skip the specified step."""
skip = False
force = build_option('force')
module_only = build_option('module_only')
module_only = build_option('module_only') or self.cfg['module_only']
sanity_check_only = build_option('sanity_check_only')
skip_extensions = build_option('skip_extensions')
skip_test_step = build_option('skip_test_step')
Expand Down
1 change: 1 addition & 0 deletions easybuild/framework/easyconfig/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
'hidden': [False, "Install module file as 'hidden' by prefixing its version with '.'", BUILD],
'installopts': ['', 'Extra options for installation', BUILD],
'maxparallel': [None, 'Max degree of parallelism', BUILD],
'module_only': [False, 'Only generate module file', BUILD],
'parallel': [None, ('Degree of parallelism for e.g. make (default: based on the number of '
'cores, active cpuset and restrictions in ulimit)'), BUILD],
'patches': [[], "List of patches to apply", BUILD],
Expand Down
19 changes: 19 additions & 0 deletions test/framework/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,25 @@ def test_skip(self):

self.assertEqual(len(glob.glob(toy_mod_glob)), 1)

# check use of module_only parameter
remove_dir(os.path.join(self.test_installpath, 'modules', 'all', 'toy'))
remove_dir(os.path.join(self.test_installpath, 'software', 'toy', '0.0'))
args = [
test_ec,
'--rebuild',
]
test_ec_txt += "\nmodule_only = True\n"
write_file(test_ec, test_ec_txt)
self.eb_main(args, do_build=True, raise_error=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smoors You should tweak args here too, so it doesn't include --skip anymore (or --force, I guess), and also check that no software was installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 430189c


self.assertEqual(len(glob.glob(toy_mod_glob)), 1)

# check that no software was installed
installdir = os.path.join(self.test_installpath, 'software', 'toy', '0.0')
installdir_glob = glob.glob(os.path.join(installdir, '*'))
easybuild_dir = os.path.join(installdir, 'easybuild')
self.assertEqual(installdir_glob, [easybuild_dir])

def test_skip_test_step(self):
"""Test skipping testing the build (--skip-test-step)."""

Expand Down