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

Unified Diff: scripts/slave/annotated_run.py

Issue 1241323004: Cross-repo recipe package system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Change to googlesource Created 5 years, 3 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
Index: scripts/slave/annotated_run.py
diff --git a/scripts/slave/annotated_run.py b/scripts/slave/annotated_run.py
index 48df8ffa7436f09047eeba96de53e740b9dcf8be..cdf9d95fee6c0bd537f1a5d465de27616344e88a 100755
--- a/scripts/slave/annotated_run.py
+++ b/scripts/slave/annotated_run.py
@@ -19,9 +19,14 @@ sys.path.append(os.path.join(BUILD_ROOT, 'third_party'))
from common import annotator
from common import chromium_utils
from common import master_cfg_utils
-from slave import recipe_universe
-from recipe_engine import main as recipe_main
+SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
+BUILD_LIMITED_ROOT = os.path.join(
+ os.path.dirname(BUILD_ROOT), 'build_internal', 'scripts', 'slave')
+
+PACKAGE_CFG = os.path.join(
+ os.path.dirname(os.path.dirname(SCRIPT_PATH)),
+ 'infra', 'config', 'recipes.cfg')
@contextlib.contextmanager
def namedTempFile():
@@ -204,10 +209,19 @@ def main(argv):
properties = get_recipe_properties(
opts.factory_properties, opts.build_properties,
opts.master_overrides_slave)
- stream = annotator.StructuredAnnotationStream()
- ret = recipe_main.run_steps(properties, stream,
- universe=recipe_universe.get_universe())
- return ret.status_code
+
+ # Find out of the recipe we intend to run is in build_internal's recipes. If
iannucci 2015/09/15 00:10:48 s/of/if
luqui 2015/09/15 19:17:41 Done.
+ # so, use recipes.py from there, otherwise use the one from build.
+ recipe_file = properties['recipe'].replace('/', os.path.sep) + '.py'
+ if os.path.exists(os.path.join(BUILD_LIMITED_ROOT, 'recipes', recipe_file)):
+ recipe_runner = os.path.join(BUILD_LIMITED_ROOT, 'recipes.py')
+ else:
+ recipe_runner = os.path.join(SCRIPT_PATH, 'recipes.py')
+
+ os.execvp(sys.executable,
+ [ sys.executable, '-u', recipe_runner,
+ 'run', properties['recipe'],
+ '--properties=%s' % json.dumps(properties) ])
def shell_main(argv):
@@ -216,5 +230,6 @@ def shell_main(argv):
else:
return main(argv)
+
if __name__ == '__main__':
sys.exit(shell_main(sys.argv))
« no previous file with comments | « infra/config/recipes.cfg ('k') | scripts/slave/bot_update.py » ('j') | scripts/slave/recipes.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698