Skip to content
Snippets Groups Projects
Commit 58229354 authored by Filippo Cremonese's avatar Filippo Cremonese
Browse files

More robust configure failure handling

parent 134d1c51
No related branches found
No related tags found
No related merge requests found
import os
from loguru import logger
from .action import Action
from .util import run_script
class ConfigureAction(Action):
......@@ -8,7 +11,19 @@ class ConfigureAction(Action):
super().__init__("configure", build, script, config)
def _is_satisfied(self):
return os.path.exists(self.environment["BUILD_DIR"])
return os.path.exists(self._configure_successful_path)
def _run(self, args):
if os.path.exists(self.environment["BUILD_DIR"]):
logger.warning("Build directory exists, running configure script anyway")
result = run_script(self.script, quiet=args.quiet, environment=self.environment)
if result.returncode == 0:
open(self._configure_successful_path, "w").close()
@property
def _configure_successful_path(self):
return os.path.join(self.environment["BUILD_DIR"], ".configure_successful")
def _implicit_dependencies(self):
if self.build.clone:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment