Skip to content

skip lines that start with 'module-version' when determining whether a module exists in ModulesTool.exist#3379

Merged
casparvl merged 10 commits intoeasybuilders:developfrom
boegel:module_version
Jul 6, 2020
Merged

skip lines that start with 'module-version' when determining whether a module exists in ModulesTool.exist#3379
casparvl merged 10 commits intoeasybuilders:developfrom
boegel:module_version

Conversation

@boegel
Copy link
Member

@boegel boegel commented Jul 6, 2020

fixes #3376

@boegel boegel added the bug fix label Jul 6, 2020
@boegel boegel added this to the 4.2.2 milestone Jul 6, 2020
@boegel
Copy link
Member Author

boegel commented Jul 6, 2020

@casparvl Can you verify this fix?

@Flamefire Thoughts?

@casparvl
Copy link
Contributor

casparvl commented Jul 6, 2020

I can confirm that the current version of modules.py in this PR fixes my original issue (as proven by the attached log).

easybuild-Java-1.8-20200706.124325.log

Copy link
Contributor

@Flamefire Flamefire left a comment

Choose a reason for hiding this comment

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

Looks good so far but I'd recheck the self.log calls especially the distinction between debug and info. IMO for info at most 1 line per module should be printed which contains the module name and the result. Detailed information as for how it was determined or what is going to happen should be debug

To be concrete:

  • Checking whether %s exists should be debug or none at all if you promote the Result for existence check of %s module: %s to info. IMO it doesn't provide any further information
  • Checking whether %s exists based on output of 'module show' is not required at all especially not as info because it is a local method only called locally with an already existing log message
  • For consistency with the not visible branch Module %s not found in list of available modules, checking via 'module show' should be debug and hence the found in list of available modules should be too.

Copy link
Contributor

@casparvl casparvl left a comment

Choose a reason for hiding this comment

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

With this PR we still take the more cautious approach to checking if modules exist by requiring a rather explicit regexp pattern, as was proposed by the original implementation from @Flamefire in EB 4.2.1. At the same time, this PR accounts for the specific behaviour of (old) Tcl when performing a module show, which is different than that of LMOD and was thus not anticipated by @Flamefire in his original implementation.

Seems to me like the best of both worlds.

Thanks @boegel for fixing this so quickly. Going in!

@casparvl casparvl merged commit bd78cd2 into easybuilders:develop Jul 6, 2020

# skip whitespace lines
if OUTPUT_MATCHES['whitespace'].search(line):
self.log.debug("Treating line '%s' as whitespace, so skipping it", line)
Copy link
Member

Choose a reason for hiding this comment

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

isn't this overly verbose, even for debugging?

Copy link
Member Author

Choose a reason for hiding this comment

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

It helped a lot with figuring out the problem reported in #3376, so no.

self.log.debug("Result for existence check of wrapped module %s: %s", wrapped_mod, mod_exists)

self.log.debug("Result for existence check of %s module: %s", mod_name, mod_exists)
self.log.info("Result for existence check of %s module: %s", mod_name, mod_exists)
Copy link
Member

Choose a reason for hiding this comment

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

why bump all these debugs to info?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the non-debug log wasn't verbose enough to make it clear what was going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java-1.8.eb modulerc file fails to install with EasyBuild-4.2.1 due to changes in modules.py

4 participants