Chromium Code Reviews| Index: recipe_engine/run.py |
| diff --git a/recipe_engine/run.py b/recipe_engine/run.py |
| index 2d1b3f3ebfb297c19f9b96b530c5a41123a1df9c..89fa3c7c864dc0c2dd08417dd742a2ded2d6f753 100644 |
| --- a/recipe_engine/run.py |
| +++ b/recipe_engine/run.py |
| @@ -71,6 +71,7 @@ import traceback |
| from . import loader |
| from . import recipe_api |
| from . import recipe_test_api |
| +from . import step_runner as step_runner_module |
| from . import types |
| from . import util |
| @@ -205,12 +206,13 @@ def run_steps(properties, stream_engine, step_runner, universe): |
| 'TESTING_SLAVENAME' in os.environ)): |
| properties['use_mirror'] = False |
| - engine = RecipeEngine(step_runner, properties, universe) |
| - |
| - # Create all API modules and top level RunSteps function. It doesn't launch |
| - # any recipe code yet; RunSteps needs to be called. |
| - api = None |
| with stream_engine.new_step_stream('setup_build') as s: |
| + engine = RecipeEngine(step_runner, properties, universe) |
| + |
| + # Create all API modules and top level RunSteps function. It doesn't launch |
| + # any recipe code yet; RunSteps needs to be called. |
| + api = None |
| + |
| assert 'recipe' in properties |
| recipe = properties['recipe'] |
| @@ -299,6 +301,19 @@ class RecipeEngine(object): |
| # When we pop from this stack, we close the corresponding step stream. |
| self._step_stack = [] |
| + # TODO(iannucci): come up with a more structured way to advertise/set mode |
| + # flags/options for the engine. |
| + if '$recipe_engine' in properties: |
|
martiniss
2016/05/06 18:09:14
I don't think the engine does any parsing of the p
iannucci
2016/05/06 18:18:04
you are wrong :) All properties are json. I have t
|
| + options = properties['$recipe_engine'] |
| + try: |
| + mode_flags = options.get('mode_flags') |
| + if mode_flags: |
| + if mode_flags.get('use_subprocess42'): |
| + print "Setting MODE_SUBPROCESS42: True" |
| + step_runner_module.MODE_SUBPROCESS42 = True |
| + except Exception as e: |
| + print "Failed to set recipe_engine options, got: %r: %s" % (options, e) |
| + |
| @property |
| def properties(self): |
| return self._properties |