-
Notifications
You must be signed in to change notification settings - Fork 211
try to empty install dir if removing it fails #4932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@smoors As discussed during today's conf call, it probably makes sense to introduce another function ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smoors Let's also add a test for the clean_dir
function?
easybuild/framework/easyblock.py
Outdated
if clean_instead_of_remove: | ||
# clean the installation directory: first try to remove it; if that fails, empty it | ||
clean_dir(dir_name) | ||
self.log.info(f"Cleaned old directory {dir_name}") | ||
else: | ||
remove_dir(dir_name) | ||
self.log.info(f"Removed old directory {dir_name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this whole block be under an if clean:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, only the last else block can go under if clean
(although not strictly necessary). if clean_instead_of_remove, we should always clean it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 66ae73d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
required for installing in bwrap namespace, see also #4110
if install dir is bind mounted, it cannot be removed