Skip to content

only perform is_short_modname_for sanity check in det_short_module_name if modaltsoftname is available#2138

Merged
boegel merged 6 commits intoeasybuilders:developfrom
bartoldeman:fix_modaltsoftname_sanity_check
Mar 6, 2017
Merged

only perform is_short_modname_for sanity check in det_short_module_name if modaltsoftname is available#2138
boegel merged 6 commits intoeasybuilders:developfrom
bartoldeman:fix_modaltsoftname_sanity_check

Conversation

@bartoldeman
Copy link
Copy Markdown
Contributor

@bartoldeman bartoldeman commented Mar 3, 2017

Fix sanity check for det_short_module_name() where modaltsoftname is set.

Without calling self.check_ec_type to obtain a full parsed easyconfig file
'modaltsoftname' is not set and the sanity check may fail.

…set.

Without calling self.check_ec_type to obtain a full parsed easyconfig file
'modaltsoftname' is not set and the sanity check may fail.
@bartoldeman
Copy link
Copy Markdown
Contributor Author

I wonder if ec = self.check_ec_type(ec) should be called higher up in the call stack though?
It is now called multiple times on the same ec.

Travis checks found that even if check_ec_type(ec) called the
'modaltsoftname' key is not always set.
self.log.debug("Obtained valid short module name %s" % mod_name)

# sanity check: obtained module name should pass the 'is_short_modname_for' check
ec = self.check_ec_type(ec)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@bartoldeman You should include this at the top of det_short_module_name, before you pass down ec, since otherwise you may be tranforming ec into a full EasyConfig instance twice in the same det_short_module_name call

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After thinking this through, I'm not sure that this does what you think/want it does...

check_ec_type will basically go out and ask the module naming scheme that is being used whether the provided ec dictionary is sufficient to query the module naming scheme.

This is used to determine whether or not a full easyconfig file is required for each dependency, or whether the limited information that is provided by the dependency specification (i.e., name, version, versionsuffx & toolchain) is sufficient (it is for the default EasyBuildMNS, not for HierarchicalMNS which also requires moduleclass).

So, unless the module naming scheme you are using specifies that modaltsoftname must also be provided, this probably doesn't have the effect you want it to have.

Since this is only a sanity check, we could limit it to the case where the MNS is being queried with a full EasyConfig instance, basically by only raising the error if modaltsoftware is indeed available.

What made you make this change exactly? Maybe it helps to have a bit more context here...

@boegel boegel added this to the 3.1.1 milestone Mar 5, 2017
@boegel
Copy link
Copy Markdown
Member

boegel commented Mar 5, 2017

@bartoldeman Also, it would be nice if we could include an enhanced test that fails without this fix, and passes with the fix...

@bartoldeman
Copy link
Copy Markdown
Contributor Author

You can trigger the issue by setting
modaltsoftname = 'M4alt'
in M4-1.4.17.eb
and then installing that followed by flex-2.6.0.eb. Installing flex fails using:
... Bison-3.0.4.eb: is_short_modname_for('M4alt/1.4.17', 'M4') for active module naming scheme returns False

@boegel
Copy link
Copy Markdown
Member

boegel commented Mar 6, 2017

@bartoldeman In your example, you have M4alt listed as a dependency for flex, or still M4?

@bartoldeman
Copy link
Copy Markdown
Contributor Author

Still M4. This way EB finds M4-1.4.17.eb and gets the modulename from there.

@bartoldeman
Copy link
Copy Markdown
Contributor Author

Also, the issue
with is_short_modname_for('M4alt/1.4.17', 'M4') for active module naming scheme returns False
is only an issue with module-naming-scheme=HierarchicalMNS, not the default.
With the default it says Missing modules for one or more dependencies: M4/1.4.17

bartoldeman and others added 3 commits March 6, 2017 11:54
"Since this is only a sanity check, we could limit it to the case
where the MNS is being queried with a full EasyConfig instance,
basically by only raising the error if modaltsoftware is indeed available."
@boegel boegel changed the title Fix sanity check for det_short_module_name() where modaltsoftname is … only perform is_short_modname_for sanity check in det_short_module_name if modaltsoftname is available Mar 6, 2017
Comment thread test/framework/toy_build.py Outdated
])
write_file(ec2, ec2_txt)

self.test_toy_build(ec_file=self.test_prefix, verify=False,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@bartoldeman you also need to enable raise_error here to ensure that the test will actually fail with is_short_modname_for('yot/0.0-one', 'toy') for active module naming scheme returns False, see bartoldeman#3

boegel added a commit to boegel/easybuild-framework that referenced this pull request Mar 6, 2017
@boegel
Copy link
Copy Markdown
Member

boegel commented Mar 6, 2017

Good to go, thanks @bartoldeman!

@boegel boegel merged commit 2249ffd into easybuilders:develop Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants