Skip to content
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

let CMakeMake remove 'easybuild_obj' build directory if it already exists #2032

Merged
merged 1 commit into from
May 19, 2020
Merged
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
8 changes: 7 additions & 1 deletion easybuild/easyblocks/generic/cmakemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import print_warning
from easybuild.tools.config import build_option
from easybuild.tools.filetools import change_dir, mkdir, which
from easybuild.tools.filetools import change_dir, mkdir, which, remove_dir
from easybuild.tools.environment import setvar
from easybuild.tools.modules import get_software_root
from easybuild.tools.run import run_cmd
Expand Down Expand Up @@ -120,6 +120,12 @@ def configure_step(self, srcdir=None, builddir=None):

if builddir is None and self.cfg.get('separate_build_dir', True):
builddir = os.path.join(self.builddir, 'easybuild_obj')
boegel marked this conversation as resolved.
Show resolved Hide resolved
# For separate_build_dir we want a clean folder. So remove if it exists
# This can happen when multiple iterations are done (e.g. shared, static, ...)
if os.path.exists(builddir):
self.log.warning('Build directory %s already exists (from previous iterations?). Removing...',
builddir)
remove_dir(builddir)

if builddir:
mkdir(builddir, parents=True)
Expand Down