Repository: easybuilders/easybuild-framework

Issue:
bootstrap fails to locate its EasyBuild with `HierarchicalNMS`
I've got `HierarchicalNMS` configured in an `easybuild.d` configuration file and am trying to bootstrap into `/eb`.
The installation procedure seems to complete but some phase after the installation seems to fail.

```
*snip*
== COMPLETED: Installation ended successfully
== Results of the build can be found in the log file(s) /eb/software/Core/EasyBuild/3.5.1/easybuild/easybuild-EasyBuild-3.5.1-20180205.142844.log
== Build succeeded for 1 out of 1
== Temporary log file(s) /tmp/eb-M0wPbM/easybuild-7lJ6Tb.log* have been removed.
== Temporary directory /tmp/eb-M0wPbM has been removed.
Traceback (most recent call last):
  File "bootstrap_eb.py", line 1047, in <module>
    main()
  File "bootstrap_eb.py", line 850, in main
    stage2(tmpdir, templates, install_path, distribute_egg_dir, sourcepath)
  File "bootstrap_eb.py", line 740, in stage2
    eb_mod_name = ActiveMNS().det_full_module_name(eb_spec)
  File "/tmp/tmpqQgfX3/eb_stage1/lib/python2.7/site-packages/easybuild_framework-3.5.1-py2.7.egg/easybuild/framework/easyconfig/easyconfig.py", line 1682, in det_full_module_name
    mod_name = self._det_module_name_with(self.mns.det_full_module_name, ec, force_visible=force_visible)
  File "/tmp/tmpqQgfX3/eb_stage1/lib/python2.7/site-packages/easybuild_framework-3.5.1-py2.7.egg/easybuild/framework/easyconfig/easyconfig.py", line 1647, in _det_module_name_with
    ec = self.check_ec_type(ec)
  File "/tmp/tmpqQgfX3/eb_stage1/lib/python2.7/site-packages/easybuild_framework-3.5.1-py2.7.egg/easybuild/framework/easyconfig/easyconfig.py", line 1627, in check_ec_type
    ec['name'], det_full_ec_version(ec), ec)
easybuild.tools.build_log.EasyBuildError: "Failed to find easyconfig file 'EasyBuild-3.5.1.eb' when determining module name for: {'toolchain': {'version': 'dummy', 'name': 'dummy'}, 'name': 'EasyBuild', 'moduleclass': 'tools', 'versionsuffix': '', 'version': '3.5.1', 'hidden': False, 'versionprefix': ''}"
lars@mononoke:~$ 
```


Discussion:
I have got exact the same issue and i am also using the `HierarchicalNMS` scheme.

Resolving patch:
diff --git a/easybuild/scripts/bootstrap_eb.py b/easybuild/scripts/bootstrap_eb.py
--- a/easybuild/scripts/bootstrap_eb.py
+++ b/easybuild/scripts/bootstrap_eb.py
@@ -54,7 +54,7 @@
 from hashlib import md5
 
 
-EB_BOOTSTRAP_VERSION = '20190521.01'
+EB_BOOTSTRAP_VERSION = '20190523.01'
 
 # argparse preferrred, optparse deprecated >=2.7
 HAVE_ARGPARSE = False
@@ -739,6 +739,11 @@ def stage2(tmpdir, templates, install_path, distribute_egg_dir, sourcepath):
         if sourcepath is not None:
             eb_args.append('--sourcepath=%s' % sourcepath)
 
+        # make sure EasyBuild can find EasyBuild-*.eb easyconfig file when it needs to;
+        # (for example when HierarchicalMNS is used as module naming scheme,
+        #  see https://github.com/easybuilders/easybuild-framework/issues/2393)
+        eb_args.append('--robot-paths=%s:' % tmpdir)
+
     # make sure parent modules path already exists (Lmod trips over a non-existing entry in $MODULEPATH)
     if install_path is not None:
         modules_path = det_modules_path(install_path)


Test patch: