Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: recipes.py

Issue 2415793003: Setup basic Runtime with properties and platform.
Patch Set: Split out, more immutables, better utilization. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« recipe_engine/recipe_api.py ('K') | « recipe_modules/properties/api.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes.py
diff --git a/recipes.py b/recipes.py
index a94dd77747cbd257f94989a14a88b1dee6757caf..61496b3c12898e78dfc17bb335915d62c33d4a21 100755
--- a/recipes.py
+++ b/recipes.py
@@ -146,6 +146,14 @@ def run(package_deps, args, op_args):
properties['recipe'] = args.recipe
+ # TODO(iannucci): A much better way to do this would be to dynamically
+ # detect if the mirrors are actually available during the execution of the
+ # recipe.
+ if ('use_mirror' not in properties and (
+ 'TESTING_MASTERNAME' in os.environ or
+ 'TESTING_SLAVENAME' in os.environ)):
+ properties['use_mirror'] = False
+
os.environ['PYTHONUNBUFFERED'] = '1'
os.environ['PYTHONIOENCODING'] = 'UTF-8'
@@ -163,6 +171,9 @@ def run(package_deps, args, op_args):
old_cwd = os.getcwd()
os.chdir(workdir)
+ # Generate our Runtime instance.
+ rt = recipe_run.Runtime(properties)
+
# Construct our stream engines. We may want to share stream events with more
# than one StreamEngine implementation, so we will accumulate them in a
# "stream_engines" list and compose them into a MultiStreamEngine.
@@ -199,7 +210,7 @@ def run(package_deps, args, op_args):
try:
ret = recipe_run.run_steps(
- properties, stream_engine,
+ rt, stream_engine,
step_runner.SubprocessStepRunner(stream_engine),
universe_view=universe_view)
finally:
« recipe_engine/recipe_api.py ('K') | « recipe_modules/properties/api.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698