adding the gcc buildenv easyblock#4136
Conversation
| # Make sure wrappers are readable/executable by everyone | ||
| adjust_permissions( | ||
| self.rpath_wrappers_dir, | ||
| stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) |
There was a problem hiding this comment.
continuation line missing indentation or outdented
| apply_regex_substitutions(wrapper_files, [(r'^PYTHON_EXE=.*$', f'PYTHON_EXE={py_exe}')], backup=False) | ||
| # Make sure wrappers are readable/executable by everyone | ||
| adjust_permissions( | ||
| self.rpath_wrappers_dir, |
There was a problem hiding this comment.
continuation line missing indentation or outdented
| # replace path to Python executable with python_executable in the wrappers, | ||
| # as this is the executable that runs EasyBuild and may be unavailable | ||
| # when using the buildenv wrappers. | ||
| apply_regex_substitutions(wrapper_files, [(r'^PYTHON_EXE=.*$', f'PYTHON_EXE={py_exe}')], backup=False) |
There was a problem hiding this comment.
line too long (130 > 120 characters)
| if py_exe is not None: | ||
| if not isinstance(py_exe, str) or not py_exe: | ||
| raise EasyBuildError(f"python_executable should be None or non-empty string, got {py_exe}") | ||
| wrapper_files = list(filter(os.path.isfile, glob.glob(os.path.join(rpath_wrappers_path, '*', '*')))) |
There was a problem hiding this comment.
line too long (128 > 120 characters)
ocaisa
left a comment
There was a problem hiding this comment.
This also requires additional sanity checks.
| wrappers_dir = os.path.join(self.rpath_wrappers_dir, RPATH_WRAPPERS_SUBDIR) | ||
| if os.path.exists(wrappers_dir): | ||
| self.rpath_wrappers_dir = os.path.join(self.installdir, 'bin') | ||
| rpath_wrappers_path = os.path.join(self.rpath_wrappers_dir, RPATH_WRAPPERS_SUBDIR) |
There was a problem hiding this comment.
This is (I think) installing the wrappers for the toolchain used, not the rpath wrappers for the GCC that was just installed.
| py_exe = None # test to use the python from EB | ||
| if py_exe is not None: |
There was a problem hiding this comment.
I don't follow this, this conditions is never not None
There was a problem hiding this comment.
If you use the framework function to create the wrappers, you would not need this anyway, the code below is part of that function
| wrappers_dir = os.path.join(self.rpath_wrappers_dir, RPATH_WRAPPERS_SUBDIR) | ||
| if os.path.exists(wrappers_dir): | ||
| self.module_load_environment.PATH = [ | ||
| os.path.join(wrappers_dir, d) | ||
| for d in os.listdir(wrappers_dir) | ||
| if os.path.isdir(os.path.join(wrappers_dir, d)) | ||
| ] |
There was a problem hiding this comment.
The wrappers should only be exposed conditionally in the module file: an EasyBuild session should ignore them and create new ones, a user sessions should use them
Regarding this ticket: https://gitlab.com/eessi/support/-/work_items/213
Hi @ocaisa, reopening it with the modifications on the gcc.py file