-
Notifications
You must be signed in to change notification settings - Fork 283
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
treat files/directories of unpacked sources equally in PackedBinary #2306
base: develop
Are you sure you want to change the base?
Conversation
Test report by @ocaisa Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) |
Test report by @ocaisa Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) |
Test report by @ocaisa Overview of tested easyconfigs (in order)
Build succeeded for 3 out of 3 (3 easyconfigs in total) |
Test report by @ocaisa Overview of tested easyconfigs (in order)
Build succeeded for 3 out of 3 (3 easyconfigs in total) |
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
Test report by @ocaisa Overview of tested easyconfigs (in order)
Build succeeded for 3 out of 3 (3 easyconfigs in total) |
# we only handle the case of a single file and no install_cmd here | ||
if os.path.isfile(srcpath) and self.cfg.get('install_cmd', None) is None: | ||
copy(srcpath, self.installdir) | ||
else: | ||
if os.path.isdir(srcpath): | ||
# copy files to install dir via Binary | ||
self.cfg['start_dir'] = src | ||
Binary.install_step(self) | ||
elif os.path.isfile(srcpath): | ||
shutil.copy2(srcpath, self.installdir) | ||
self.cfg['start_dir'] = self.builddir | ||
else: | ||
raise EasyBuildError("Path %s is not a file nor a directory?", srcpath) | ||
except OSError as err: | ||
raise EasyBuildError("Failed to copy unpacked sources to install directory: %s", err) | ||
Binary.install_step(self) |
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.
@ocaisa this is a pre-existing thing, but the install_step
in the Binary easyblock removes the installation directory before copying, shouldn't that be done here too? why not just let the Binary install_step handle this case too, since it already has the logic to handle if install_cmd is None
?
# we only handle the case of a single file and no install_cmd here | |
if os.path.isfile(srcpath) and self.cfg.get('install_cmd', None) is None: | |
copy(srcpath, self.installdir) | |
else: | |
if os.path.isdir(srcpath): | |
# copy files to install dir via Binary | |
self.cfg['start_dir'] = src | |
Binary.install_step(self) | |
elif os.path.isfile(srcpath): | |
shutil.copy2(srcpath, self.installdir) | |
self.cfg['start_dir'] = self.builddir | |
else: | |
raise EasyBuildError("Path %s is not a file nor a directory?", srcpath) | |
except OSError as err: | |
raise EasyBuildError("Failed to copy unpacked sources to install directory: %s", err) | |
Binary.install_step(self) | |
if os.path.isdir(srcpath): | |
self.cfg['start_dir'] = src | |
elif os.path.isfile(srcpath): | |
self.cfg['start_dir'] = self.builddir | |
else: | |
raise EasyBuildError("Path %s is not a file nor a directory?", srcpath) | |
Binary.install_step(self) |
Fixes #1334