Do not fail for read-only installation directory on --module-only (re)builds#4958
Conversation
When only creating a module the installation directory must not be touched as it might be on a read-only file system. Skip the code that copies reprod-files (easyconfig, easyblock, hooks) and log files.
3b1c6cc to
e312f26
Compare
|
While this makes sense, it does imply that we'll no longer have an extra log file in the installation directory for the Rather than not copying the log file, can we make sure we can copy by temporarily enabling write permissions on the installation directory, and print a warning to make it clear that the log file can't be copied if that didn't work? |
We actually do that already. Just if the change didn't work (e.g. on EESSI) it still fails. |
|
Just producing a clear warning (when using |
|
Ok, I refactored the code a bit to catch errors early to provide an exact warning. It now looks like this: I found that not all logs get deleted even on success. Hence I also assigned |
--module-only (re)builds--module-only (re)builds
| change_dir(cwd) | ||
|
|
||
| application_log = None | ||
| application_log = app.logfile |
There was a problem hiding this comment.
This was a bit too naive, but it was easy to overlook that it could have consequences.
It introduced a regression, which was fixed in time for the EasyBuild v5.1.2 release, see:
There was a problem hiding this comment.
Thinking about how this happens. Previously application_log assignment was guarded by if result and not dry_run: with a fallback if not result otherwise it would never be assigned.
So I guess the extended-dry-run does set app.logfile (to what value actually and why?) and always returns success (result = True)
I'm wondering if extended-dry-run sets app.logfile to something that looks valid if we shouldn't handle it similar to other code that similarly would need to check that. Just to be sure we are not missing something similar somewhere else.
When only creating a module the installation directory must not be touched as it might be on a read-only file system.
Skip the code that copies reprod-files (easyconfig, easyblock, hooks) and log files.
This came up when trying to create a module-tree for EESSI reusing the installed software.