summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2023-03-25 16:21:27 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2023-07-24 14:48:14 +0530
commit14f2a763c7abcce0efde1f88fdb234fbf7b1cbe1 (patch)
treefd0f5b44267421e75796a017ee203ed6fcf73603
parent88a95b38ac2c736bf7551664e6236b952996bda9 (diff)
cerbero: Fix source dir to enter into on build failure
Cerbero would try to enter into _builddir if extract failed, but that dir only exists once the configure step starts. So if we fail while extracting, enter into the source tree. Also fix some whitespace. Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1227>
-rw-r--r--cerbero/build/oven.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/cerbero/build/oven.py b/cerbero/build/oven.py
index 5564e03e..2f196698 100644
--- a/cerbero/build/oven.py
+++ b/cerbero/build/oven.py
@@ -433,7 +433,7 @@ class Oven (object):
except Exception as e:
raise e
- async def _cook_recipe_step_with_prompt (self, recipe, step, count):
+ async def _cook_recipe_step_with_prompt(self, recipe, step, count):
try:
await self._cook_recipe_step(recipe, step, count)
except BuildStepError as be:
@@ -447,11 +447,15 @@ class Oven (object):
environ = recipe.get_recipe_env()
if recipe.use_system_libs:
add_system_libs(recipe.config, environ, environ)
+ if be.step == BuildSteps.EXTRACT[1]:
+ source_dir = recipe.get_for_arch(be.arch, 'config_src_dir')
+ else:
+ source_dir = recipe.get_for_arch(be.arch, 'build_dir')
shell.enter_build_environment(self.config.target_platform,
- be.arch, recipe.get_for_arch (be.arch, 'build_dir'), env=environ)
+ be.arch, source_dir, env=environ)
raise be
elif action == RecoveryActions.RETRY_ALL:
- shutil.rmtree(recipe.get_for_arch (be.arch, 'build_dir'))
+ shutil.rmtree(recipe.get_for_arch(be.arch, 'build_dir'))
self.cookbook.reset_recipe_status(recipe.name)
# propagate up to the task manager to retry the recipe entirely
raise RetryRecipeError()
@@ -463,7 +467,7 @@ class Oven (object):
elif action == RecoveryActions.ABORT:
raise AbortedError()
- async def _cook_recipe_step (self, recipe, step, count):
+ async def _cook_recipe_step(self, recipe, step, count):
# check if the current step needs to be done
if self.steps_filter is not None and step not in self.steps_filter:
return