Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions reframe/core/buildsystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ def post_build(self, buildjob):
Build systems may use this information to do some post processing and
provide additional, build system-specific, functionality to the users.

This function will always be executed from the test's stage directory.

.. versionadded:: 3.5.0
.. versionchanged:: 3.5.2
The function is executed from the stage directory.

:meta private:

Expand Down Expand Up @@ -741,7 +745,6 @@ def __init__(self):
self.package_opts = {}
self.prefix = 'easybuild'
self._eb_modules = []
self._prefix_save = None

def emit_build_commands(self, environ):
if not self.easyconfigs:
Expand All @@ -755,7 +758,6 @@ def emit_build_commands(self, environ):

prefix = os.path.join(os.getcwd(), self.prefix)
options = ' '.join(self.options)
self._prefix_save = prefix
return [f'export EASYBUILD_BUILDPATH={prefix}/build',
f'export EASYBUILD_INSTALLPATH={prefix}',
f'export EASYBUILD_PREFIX={prefix}',
Expand All @@ -765,7 +767,8 @@ def emit_build_commands(self, environ):
def post_build(self, buildjob):
# Store the modules generated by EasyBuild

modulesdir = os.path.join(self._prefix_save, 'modules', 'all')
modulesdir = os.path.join(os.getcwd(), self.prefix,
'modules', 'all')
with open(buildjob.stdout) as fp:
out = fp.read()

Expand Down
3 changes: 2 additions & 1 deletion reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,8 @@ def compile_wait(self):
raise BuildError(self._build_job.stdout,
self._build_job.stderr, self._stagedir)

self.build_system.post_build(self._build_job)
with osext.change_dir(self._stagedir):
self.build_system.post_build(self._build_job)

@_run_hooks('pre_run')
@final
Expand Down