diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py index 63a81459a1..f71b5acf0a 100644 --- a/easybuild/framework/easyblock.py +++ b/easybuild/framework/easyblock.py @@ -1519,13 +1519,13 @@ def fetch_step(self, skip_checksums=False): # create parent dirs in install and modules path already # this is required when building in parallel mod_symlink_paths = ActiveMNS().det_module_symlink_paths(self.cfg) - parent_subdir = os.path.dirname(self.install_subdir) + mod_subdir = os.path.dirname(ActiveMNS().det_full_module_name(self.cfg)) pardirs = [ self.installdir, - os.path.join(self.installdir_mod, parent_subdir), + os.path.join(self.installdir_mod, mod_subdir), ] for mod_symlink_path in mod_symlink_paths: - pardirs.append(os.path.join(install_path('mod'), mod_symlink_path, parent_subdir)) + pardirs.append(os.path.join(install_path('mod'), mod_symlink_path, mod_subdir)) self.log.info("Checking dirs that need to be created: %s" % pardirs) for pardir in pardirs: diff --git a/test/framework/toy_build.py b/test/framework/toy_build.py index 957c927ffa..4f9c277c64 100644 --- a/test/framework/toy_build.py +++ b/test/framework/toy_build.py @@ -1282,15 +1282,42 @@ def test_toy_modaltsoftname(self): toy_ec_txt, "versionsuffix = '-two'", "dependencies = [('toy', '0.0', '-one')]", + "modaltsoftname = 'toytwo'", ]) write_file(ec2, ec2_txt) extra_args = [ '--module-naming-scheme=HierarchicalMNS', - '--robot-paths=%s'%self.test_prefix, + '--robot-paths=%s' % self.test_prefix, ] self.test_toy_build(ec_file=self.test_prefix, verify=False, extra_args=extra_args, raise_error=True) + software_path = os.path.join(self.test_installpath, 'software', 'Core') + modules_path = os.path.join(self.test_installpath, 'modules', 'all', 'Core') + + # install dirs for both installations should be there (using original software name) + self.assertTrue(os.path.exists(os.path.join(software_path, 'toy', '0.0-one', 'bin', 'toy'))) + self.assertTrue(os.path.exists(os.path.join(software_path, 'toy', '0.0-two', 'bin', 'toy'))) + + toytwo_name = '0.0-two' + yot_name = '0.0-one' + if get_module_syntax() == 'Lua': + toytwo_name += '.lua' + yot_name += '.lua' + + # modules for both installations with alternative name should be there + self.assertTrue(os.path.exists(os.path.join(modules_path, 'toytwo', toytwo_name))) + self.assertTrue(os.path.exists(os.path.join(modules_path, 'yot', yot_name))) + + # only subdirectories for software should be created + self.assertEqual(os.listdir(software_path), ['toy']) + self.assertEqual(sorted(os.listdir(os.path.join(software_path, 'toy'))), ['0.0-one', '0.0-two']) + + # only subdirectories for modules with alternative names should be created + self.assertEqual(sorted(os.listdir(modules_path)), ['toytwo', 'yot']) + self.assertEqual(os.listdir(os.path.join(modules_path, 'toytwo')), [toytwo_name]) + self.assertEqual(os.listdir(os.path.join(modules_path, 'yot')), [yot_name]) + def suite(): """ return all the tests in this file """