From 0097973a0e6442dfeb3d8a4f8a5805aef0c9fb49 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Wed, 3 Feb 2016 15:46:10 +0000 Subject: [PATCH] bot_update: add depot_tools to PATH so that e.g. apply_issue can be found (reland #1) Original attempt: https://codereview.chromium.org/1660943002 Now adds depot_tools at the end of PATH to avoid issues with python on Windows. TBR=jochen BUG=437264 Review URL: https://codereview.chromium.org/1661953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298562 0039d316-1c4b-4281-b951-d872f2087c98 --- recipe_modules/bot_update/api.py | 4 ++++ recipe_modules/bot_update/example.expected/basic.json | 3 +++ .../bot_update/example.expected/basic_output_manifest.json | 3 +++ .../bot_update/example.expected/basic_with_branch_heads.json | 3 +++ recipe_modules/bot_update/example.expected/clobber.json | 3 +++ recipe_modules/bot_update/example.expected/forced.json | 3 +++ recipe_modules/bot_update/example.expected/no_shallow.json | 3 +++ recipe_modules/bot_update/example.expected/off.json | 3 +++ .../example.expected/reset_root_solution_revision.json | 3 +++ recipe_modules/bot_update/example.expected/svn_mode.json | 3 +++ recipe_modules/bot_update/example.expected/trychange.json | 3 +++ .../bot_update/example.expected/trychange_oauth2.json | 3 +++ recipe_modules/bot_update/example.expected/tryjob.json | 3 +++ recipe_modules/bot_update/example.expected/tryjob_fail.json | 3 +++ .../bot_update/example.expected/tryjob_fail_patch.json | 3 +++ .../example.expected/tryjob_fail_patch_download.json | 3 +++ recipe_modules/bot_update/example.expected/tryjob_v8.json | 3 +++ 17 files changed, 52 insertions(+) diff --git a/recipe_modules/bot_update/api.py b/recipe_modules/bot_update/api.py index c077ae904..4b870a4b7 100644 --- a/recipe_modules/bot_update/api.py +++ b/recipe_modules/bot_update/api.py @@ -57,6 +57,10 @@ class BotUpdateApi(recipe_api.RecipeApi): assert isinstance(cmd, (list, tuple)) bot_update_path = self.resource('bot_update.py') kwargs.setdefault('infra_step', True) + kwargs.setdefault('env', {}) + kwargs['env'].setdefault('PATH', '%(PATH)s') + kwargs['env']['PATH'] = self.m.path.pathsep.join([ + kwargs['env']['PATH'], str(self._module.PACKAGE_DIRECTORY)]) return self.m.python(name, bot_update_path, cmd, **kwargs) @property diff --git a/recipe_modules/bot_update/example.expected/basic.json b/recipe_modules/bot_update/example.expected/basic.json index a21bd91dd..0cff6c0fe 100644 --- a/recipe_modules/bot_update/example.expected/basic.json +++ b/recipe_modules/bot_update/example.expected/basic.json @@ -24,6 +24,9 @@ "src@abc" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update (without patch)", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/basic_output_manifest.json b/recipe_modules/bot_update/example.expected/basic_output_manifest.json index 8521bf0e6..170b4ab6d 100644 --- a/recipe_modules/bot_update/example.expected/basic_output_manifest.json +++ b/recipe_modules/bot_update/example.expected/basic_output_manifest.json @@ -25,6 +25,9 @@ "--output_manifest" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json b/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json index 0275a7c6a..214604319 100644 --- a/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +++ b/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json @@ -25,6 +25,9 @@ "--with_branch_heads" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update - with branch heads", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/clobber.json b/recipe_modules/bot_update/example.expected/clobber.json index 3650c6e66..ee6f935c9 100644 --- a/recipe_modules/bot_update/example.expected/clobber.json +++ b/recipe_modules/bot_update/example.expected/clobber.json @@ -25,6 +25,9 @@ "--clobber" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", diff --git a/recipe_modules/bot_update/example.expected/forced.json b/recipe_modules/bot_update/example.expected/forced.json index ca3ef96b0..07b1af682 100644 --- a/recipe_modules/bot_update/example.expected/forced.json +++ b/recipe_modules/bot_update/example.expected/forced.json @@ -25,6 +25,9 @@ "--force" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/no_shallow.json b/recipe_modules/bot_update/example.expected/no_shallow.json index 3cb8fdf3f..2008a4fa3 100644 --- a/recipe_modules/bot_update/example.expected/no_shallow.json +++ b/recipe_modules/bot_update/example.expected/no_shallow.json @@ -25,6 +25,9 @@ "--no_shallow" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", diff --git a/recipe_modules/bot_update/example.expected/off.json b/recipe_modules/bot_update/example.expected/off.json index bc645fa1d..48109b0ba 100644 --- a/recipe_modules/bot_update/example.expected/off.json +++ b/recipe_modules/bot_update/example.expected/off.json @@ -24,6 +24,9 @@ "src@HEAD" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", diff --git a/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json b/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json index 5d2d3d95d..e50485c41 100644 --- a/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +++ b/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json @@ -24,6 +24,9 @@ "src@revision" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", diff --git a/recipe_modules/bot_update/example.expected/svn_mode.json b/recipe_modules/bot_update/example.expected/svn_mode.json index 2f61227ea..b12f9e40c 100644 --- a/recipe_modules/bot_update/example.expected/svn_mode.json +++ b/recipe_modules/bot_update/example.expected/svn_mode.json @@ -25,6 +25,9 @@ "--force" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/trychange.json b/recipe_modules/bot_update/example.expected/trychange.json index 26cdf6445..a7aa47328 100644 --- a/recipe_modules/bot_update/example.expected/trychange.json +++ b/recipe_modules/bot_update/example.expected/trychange.json @@ -26,6 +26,9 @@ "+refs/change/1/2/333" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/trychange_oauth2.json b/recipe_modules/bot_update/example.expected/trychange_oauth2.json index a9788dc60..c81ede5ff 100644 --- a/recipe_modules/bot_update/example.expected/trychange_oauth2.json +++ b/recipe_modules/bot_update/example.expected/trychange_oauth2.json @@ -28,6 +28,9 @@ "src@HEAD" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/tryjob.json b/recipe_modules/bot_update/example.expected/tryjob.json index 9725c2cd1..f34e0fe7e 100644 --- a/recipe_modules/bot_update/example.expected/tryjob.json +++ b/recipe_modules/bot_update/example.expected/tryjob.json @@ -26,6 +26,9 @@ "src@HEAD" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail.json b/recipe_modules/bot_update/example.expected/tryjob_fail.json index 252ef7c59..66b377c29 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail.json @@ -26,6 +26,9 @@ "src@HEAD" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "step returned non-zero exit code: 1", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json b/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json index 0b968135a..9e2cd6f8d 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json @@ -26,6 +26,9 @@ "src@HEAD" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json b/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json index 88da29c2f..e7a93bdf1 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json @@ -26,6 +26,9 @@ "src@HEAD" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@", diff --git a/recipe_modules/bot_update/example.expected/tryjob_v8.json b/recipe_modules/bot_update/example.expected/tryjob_v8.json index 8017c26dd..f426d8b95 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_v8.json +++ b/recipe_modules/bot_update/example.expected/tryjob_v8.json @@ -28,6 +28,9 @@ "src/v8@abc" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "bot_update", "~followup_annotations": [ "@@@STEP_TEXT@Some step text@@@",