-
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
base: develop
Are you sure you want to change the base?
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?
from easybuild.tools.filetools import get_cwd, get_source_tarball_from_git, is_alt_pypi_url, is_binary, is_parent_path | ||
from easybuild.tools.filetools import is_sha256_checksum, mkdir, move_file, move_logs, read_file, remove_dir | ||
from easybuild.tools.filetools import remove_file, remove_lock, symlink, verify_checksum, weld_paths, write_file | ||
from easybuild.tools.filetools import download_file, clean_dir, encode_class_name, extract_file |
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.
from easybuild.tools.filetools import download_file, clean_dir, encode_class_name, extract_file | |
from easybuild.tools.filetools import clean_dir, download_file, encode_class_name, extract_file |
|
||
def make_dir(self, dir_name, clean, dontcreateinstalldir=False): | ||
def make_dir(self, dir_name, clean, dontcreateinstalldir=False, isinstalldir=False): |
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.
isinstalldir
can be renamed to something that more directly specifies what it done when this is enabled/disabled:
def make_dir(self, dir_name, clean, dontcreateinstalldir=False, isinstalldir=False): | |
def make_dir(self, dir_name, clean, dontcreateinstalldir=False, clean_instead_of_remove=False): |
except EasyBuildError: | ||
_log.debug("Failed to remove directory %s, emptying it instead", path) |
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.
except EasyBuildError: | |
_log.debug("Failed to remove directory %s, emptying it instead", path) | |
except EasyBuildError as err: | |
_log.debug(f"Removing directory {path} failed, will try to empty it instead: {err}") |
required for installing in bwrap namespace, see also #4110
if install dir is bind mounted, it cannot be removed