diff --git a/infra/config/recipes.cfg b/infra/config/recipes.cfg index 993d2f6ed..1013f0cdf 100644 --- a/infra/config/recipes.cfg +++ b/infra/config/recipes.cfg @@ -5,5 +5,5 @@ deps { project_id: "recipe_engine" url: "https://chromium.googlesource.com/external/github.com/luci/recipes-py.git" branch: "master" - revision: "633abf8d47e44241203369a7e4eb926b832c6dff" + revision: "f712a9271eb999e8b43c48ea9404f4bef393e486" } diff --git a/recipe_modules/bot_update/__init__.py b/recipe_modules/bot_update/__init__.py index 11364c78f..b9020cad7 100644 --- a/recipe_modules/bot_update/__init__.py +++ b/recipe_modules/bot_update/__init__.py @@ -1,5 +1,6 @@ DEPS = [ 'gclient', + 'infra_paths', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/platform', diff --git a/recipe_modules/bot_update/api.py b/recipe_modules/bot_update/api.py index 8b3a35b0b..59ea24367 100644 --- a/recipe_modules/bot_update/api.py +++ b/recipe_modules/bot_update/api.py @@ -119,9 +119,9 @@ class BotUpdateApi(recipe_api.RecipeApi): # Point to the oauth2 auth files if specified. # These paths are where the bots put their credential files. if patch_oauth2: - email_file = self.m.path['build'].join( + email_file = self.m.infra_paths['build'].join( 'site_config', '.rietveld_client_email') - key_file = self.m.path['build'].join( + key_file = self.m.infra_paths['build'].join( 'site_config', '.rietveld_secret_key') else: email_file = key_file = None @@ -276,7 +276,7 @@ class BotUpdateApi(recipe_api.RecipeApi): # first solution. if step_result.json.output['did_run']: co_root = step_result.json.output['root'] - cwd = kwargs.get('cwd', self.m.path['slave_build']) + cwd = kwargs.get('cwd', self.m.infra_paths['slave_build']) if 'checkout' not in self.m.path: self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) diff --git a/recipe_modules/bot_update/example.expected/basic.json b/recipe_modules/bot_update/example.expected/basic.json index a9e9d985c..16a32972d 100644 --- a/recipe_modules/bot_update/example.expected/basic.json +++ b/recipe_modules/bot_update/example.expected/basic.json @@ -23,7 +23,6 @@ "--revision", "src@abc" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, 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 2f85e9116..147c0f6cc 100644 --- a/recipe_modules/bot_update/example.expected/basic_output_manifest.json +++ b/recipe_modules/bot_update/example.expected/basic_output_manifest.json @@ -24,7 +24,6 @@ "src@HEAD", "--output_manifest" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, 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 9a8ee91e1..fa34310bf 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 @@ -24,7 +24,6 @@ "src@HEAD", "--with_branch_heads" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/clobber.json b/recipe_modules/bot_update/example.expected/clobber.json index 1e7b544f2..c3c20ebaa 100644 --- a/recipe_modules/bot_update/example.expected/clobber.json +++ b/recipe_modules/bot_update/example.expected/clobber.json @@ -24,7 +24,6 @@ "src@HEAD", "--clobber" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/forced.json b/recipe_modules/bot_update/example.expected/forced.json index 085a638cf..a5104bb23 100644 --- a/recipe_modules/bot_update/example.expected/forced.json +++ b/recipe_modules/bot_update/example.expected/forced.json @@ -24,7 +24,6 @@ "src@HEAD", "--force" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/gerrit_no_reset.json b/recipe_modules/bot_update/example.expected/gerrit_no_reset.json index 710e17420..25de50541 100644 --- a/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +++ b/recipe_modules/bot_update/example.expected/gerrit_no_reset.json @@ -24,7 +24,6 @@ "src@HEAD", "--gerrit_no_reset" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/no_shallow.json b/recipe_modules/bot_update/example.expected/no_shallow.json index 991b37db4..40a7c4847 100644 --- a/recipe_modules/bot_update/example.expected/no_shallow.json +++ b/recipe_modules/bot_update/example.expected/no_shallow.json @@ -24,7 +24,6 @@ "src@HEAD", "--no_shallow" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/off.json b/recipe_modules/bot_update/example.expected/off.json index 7c3148db0..d6ec5891d 100644 --- a/recipe_modules/bot_update/example.expected/off.json +++ b/recipe_modules/bot_update/example.expected/off.json @@ -23,7 +23,6 @@ "--revision", "src@HEAD" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, 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 770b27f1b..7b6c2f892 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 @@ -23,7 +23,6 @@ "--revision", "src@revision" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/svn_mode.json b/recipe_modules/bot_update/example.expected/svn_mode.json index b6acc2fa5..b047ab526 100644 --- a/recipe_modules/bot_update/example.expected/svn_mode.json +++ b/recipe_modules/bot_update/example.expected/svn_mode.json @@ -24,7 +24,6 @@ "src@HEAD", "--force" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/trychange.json b/recipe_modules/bot_update/example.expected/trychange.json index c6a7ff893..ce0ac798d 100644 --- a/recipe_modules/bot_update/example.expected/trychange.json +++ b/recipe_modules/bot_update/example.expected/trychange.json @@ -25,7 +25,6 @@ "--refs", "+refs/change/1/2/333" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/trychange_oauth2.json b/recipe_modules/bot_update/example.expected/trychange_oauth2.json index 238a918ae..7df1a3b33 100644 --- a/recipe_modules/bot_update/example.expected/trychange_oauth2.json +++ b/recipe_modules/bot_update/example.expected/trychange_oauth2.json @@ -19,15 +19,14 @@ "--git-cache-dir", "[GIT_CACHE]", "--apply_issue_email_file", - "[BUILD]/site_config/.rietveld_client_email", + "[ROOT]/b/build/site_config/.rietveld_client_email", "--apply_issue_key_file", - "[BUILD]/site_config/.rietveld_secret_key", + "[ROOT]/b/build/site_config/.rietveld_secret_key", "--output_json", "/path/to/tmp/json", "--revision", "src@HEAD" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/tryjob.json b/recipe_modules/bot_update/example.expected/tryjob.json index c2b62debd..a9118a61c 100644 --- a/recipe_modules/bot_update/example.expected/tryjob.json +++ b/recipe_modules/bot_update/example.expected/tryjob.json @@ -25,7 +25,6 @@ "--revision", "src@HEAD" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail.json b/recipe_modules/bot_update/example.expected/tryjob_fail.json index 17198506c..f24bc2d9c 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail.json @@ -25,7 +25,6 @@ "--revision", "src@HEAD" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, 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 c7a2976bc..d77b6b5d8 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json @@ -25,7 +25,6 @@ "--revision", "src@HEAD" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -67,7 +66,6 @@ "-u", "import sys; sys.exit(1)" ], - "cwd": "[SLAVE_BUILD]", "name": "Patch failure", "~followup_annotations": [ "step returned non-zero exit code: 1", 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 05ae22516..4204d6cbc 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 @@ -25,7 +25,6 @@ "--revision", "src@HEAD" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -66,7 +65,6 @@ "-u", "import sys;print \"Patch download failed. See bot_update step for details\";sys.exit(1)" ], - "cwd": "[SLAVE_BUILD]", "name": "Patch failure", "~followup_annotations": [ "step returned non-zero exit code: 1", diff --git a/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json b/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json index b4b7311f1..fa19f202c 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +++ b/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json @@ -29,7 +29,6 @@ "--revision", "src/third_party/angle@HEAD" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -47,4 +46,4 @@ "recipe_result": null, "status_code": 0 } -] +] \ No newline at end of file diff --git a/recipe_modules/bot_update/example.expected/tryjob_v8.json b/recipe_modules/bot_update/example.expected/tryjob_v8.json index 5aaf8739d..4b811d49a 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_v8.json +++ b/recipe_modules/bot_update/example.expected/tryjob_v8.json @@ -27,7 +27,6 @@ "--revision", "src/v8@abc" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json b/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json index f4db111c0..8f16290b8 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +++ b/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json @@ -31,7 +31,6 @@ "--revision", "src/v8@HEAD" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/gclient/__init__.py b/recipe_modules/gclient/__init__.py index 5d86f4dfb..b9e022d85 100644 --- a/recipe_modules/gclient/__init__.py +++ b/recipe_modules/gclient/__init__.py @@ -1,4 +1,5 @@ DEPS = [ + 'infra_paths', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/platform', diff --git a/recipe_modules/gclient/api.py b/recipe_modules/gclient/api.py index 6b44dab1d..997e9b862 100644 --- a/recipe_modules/gclient/api.py +++ b/recipe_modules/gclient/api.py @@ -134,7 +134,7 @@ class GclientApi(recipe_api.RecipeApi): def get_config_defaults(self): return { 'USE_MIRROR': self.use_mirror, - 'CACHE_DIR': self.m.path['git_cache'], + 'CACHE_DIR': self.m.infra_paths['git_cache'], } @staticmethod @@ -276,7 +276,7 @@ class GclientApi(recipe_api.RecipeApi): self(name, ['recurse', 'git', 'config', var, val], **kwargs) finally: - cwd = kwargs.get('cwd', self.m.path['slave_build']) + cwd = kwargs.get('cwd', self.m.infra_paths['slave_build']) if 'checkout' not in self.m.path: self.m.path['checkout'] = cwd.join( *cfg.solutions[0].name.split(self.m.path.sep)) @@ -290,9 +290,13 @@ class GclientApi(recipe_api.RecipeApi): prefix = '%sgclient ' % (('[spec: %s] ' % alias) if alias else '') return self.m.python(prefix + 'revert', - self.m.path['build'].join('scripts', 'slave', 'gclient_safe_revert.py'), - ['.', self.m.path['depot_tools'].join('gclient', - platform_ext={'win': '.bat'})], + self.m.infra_paths['build'].join( + 'scripts', 'slave', 'gclient_safe_revert.py'), + [ + '.', + self.m.infra_paths['depot_tools'].join( + 'gclient', platform_ext={'win': '.bat'}) + ], infra_step=True, **kwargs ) @@ -334,7 +338,7 @@ class GclientApi(recipe_api.RecipeApi): print 'deleting %s' % path_to_file os.remove(path_to_file) """, - args=[self.m.path['slave_build']], + args=[self.m.infra_paths['slave_build']], infra_step=True, ) diff --git a/recipe_modules/gclient/example.expected/basic.json b/recipe_modules/gclient/example.expected/basic.json index e1ce307c9..3d2ba3213 100644 --- a/recipe_modules/gclient/example.expected/basic.json +++ b/recipe_modules/gclient/example.expected/basic.json @@ -8,7 +8,6 @@ "--spec", "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -32,7 +31,6 @@ "--output-json", "/path/to/tmp/json" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -59,7 +57,6 @@ "user.name", "local_bot" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -76,7 +73,6 @@ "user.email", "local_bot@example.com" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -89,9 +85,9 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[ROOT]/b/build/slave/cache_dir'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], - "cwd": "[SLAVE_BUILD]/src/third_party", + "cwd": "[CWD]/src/third_party", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -113,7 +109,7 @@ "--output-json", "/path/to/tmp/json" ], - "cwd": "[SLAVE_BUILD]/src/third_party", + "cwd": "[CWD]/src/third_party", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -138,9 +134,8 @@ "python", "-u", "\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print 'deleting %s' % path_to_file\n os.remove(path_to_file)\n", - "[SLAVE_BUILD]" + "[CWD]" ], - "cwd": "[SLAVE_BUILD]", "name": "cleanup index.lock", "~followup_annotations": [ "@@@STEP_LOG_LINE@python.inline@@@@", @@ -164,7 +159,6 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "runhooks" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/gclient/example.expected/revision.json b/recipe_modules/gclient/example.expected/revision.json index e22717b42..30f548a0e 100644 --- a/recipe_modules/gclient/example.expected/revision.json +++ b/recipe_modules/gclient/example.expected/revision.json @@ -8,7 +8,6 @@ "--spec", "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -34,7 +33,6 @@ "--output-json", "/path/to/tmp/json" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -61,7 +59,6 @@ "user.name", "local_bot" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -78,7 +75,6 @@ "user.email", "local_bot@example.com" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -91,9 +87,9 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[ROOT]/b/build/slave/cache_dir'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], - "cwd": "[SLAVE_BUILD]/src/third_party", + "cwd": "[CWD]/src/third_party", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -115,7 +111,7 @@ "--output-json", "/path/to/tmp/json" ], - "cwd": "[SLAVE_BUILD]/src/third_party", + "cwd": "[CWD]/src/third_party", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -140,9 +136,8 @@ "python", "-u", "\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print 'deleting %s' % path_to_file\n os.remove(path_to_file)\n", - "[SLAVE_BUILD]" + "[CWD]" ], - "cwd": "[SLAVE_BUILD]", "name": "cleanup index.lock", "~followup_annotations": [ "@@@STEP_LOG_LINE@python.inline@@@@", @@ -166,7 +161,6 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "runhooks" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/gclient/example.expected/tryserver.json b/recipe_modules/gclient/example.expected/tryserver.json index b22508d74..9fcbd3b07 100644 --- a/recipe_modules/gclient/example.expected/tryserver.json +++ b/recipe_modules/gclient/example.expected/tryserver.json @@ -8,7 +8,6 @@ "--spec", "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -34,7 +33,6 @@ "--output-json", "/path/to/tmp/json" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -61,7 +59,6 @@ "user.name", "local_bot" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -78,7 +75,6 @@ "user.email", "local_bot@example.com" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -91,9 +87,9 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[ROOT]/b/build/slave/cache_dir'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], - "cwd": "[SLAVE_BUILD]/src/third_party", + "cwd": "[CWD]/src/third_party", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -103,11 +99,11 @@ "cmd": [ "python", "-u", - "[BUILD]/scripts/slave/gclient_safe_revert.py", + "[ROOT]/b/build/scripts/slave/gclient_safe_revert.py", ".", - "[DEPOT_TOOLS]/gclient" + "[ROOT]/b/depot_tools/gclient" ], - "cwd": "[SLAVE_BUILD]/src/third_party", + "cwd": "[CWD]/src/third_party", "name": "[spec: WebKit] gclient revert" }, { @@ -126,7 +122,7 @@ "--output-json", "/path/to/tmp/json" ], - "cwd": "[SLAVE_BUILD]/src/third_party", + "cwd": "[CWD]/src/third_party", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, @@ -151,9 +147,8 @@ "python", "-u", "\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print 'deleting %s' % path_to_file\n os.remove(path_to_file)\n", - "[SLAVE_BUILD]" + "[CWD]" ], - "cwd": "[SLAVE_BUILD]", "name": "cleanup index.lock", "~followup_annotations": [ "@@@STEP_LOG_LINE@python.inline@@@@", @@ -177,7 +172,6 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "runhooks" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/gclient/example.py b/recipe_modules/gclient/example.py index fa6daf895..0713987ca 100644 --- a/recipe_modules/gclient/example.py +++ b/recipe_modules/gclient/example.py @@ -4,6 +4,7 @@ DEPS = [ 'gclient', + 'infra_paths', 'recipe_engine/path', 'recipe_engine/properties', ] @@ -81,7 +82,7 @@ def RunSteps(api): api.gclient.checkout( gclient_config=bl_cfg, with_branch_heads=True, - cwd=api.path['slave_build'].join('src', 'third_party')) + cwd=api.infra_paths['slave_build'].join('src', 'third_party')) api.gclient.break_locks() diff --git a/recipe_modules/git/__init__.py b/recipe_modules/git/__init__.py index c49ece3b4..2dab849e9 100644 --- a/recipe_modules/git/__init__.py +++ b/recipe_modules/git/__init__.py @@ -1,4 +1,5 @@ DEPS = [ + 'infra_paths', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', diff --git a/recipe_modules/git/api.py b/recipe_modules/git/api.py index 1751c9622..ba722b812 100644 --- a/recipe_modules/git/api.py +++ b/recipe_modules/git/api.py @@ -175,7 +175,7 @@ class GitApi(recipe_api.RecipeApi): # ex: ssh://host:repo/foobar/.git dir_path = dir_path or dir_path.rsplit('/', 1)[-1] - dir_path = self.m.path['slave_build'].join(dir_path) + dir_path = self.m.infra_paths['slave_build'].join(dir_path) if 'checkout' not in self.m.path: self.m.path['checkout'] = dir_path diff --git a/recipe_modules/git/example.expected/basic.json b/recipe_modules/git/example.expected/basic.json index b332cdf60..a9d9a7797 100644 --- a/recipe_modules/git/example.expected/basic.json +++ b/recipe_modules/git/example.expected/basic.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -97,7 +96,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -112,7 +111,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -123,7 +122,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -131,7 +130,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -139,7 +138,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -147,7 +146,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -156,7 +155,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -164,10 +163,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/basic_branch.json b/recipe_modules/git/example.expected/basic_branch.json index 56fb11cdd..793de60b3 100644 --- a/recipe_modules/git/example.expected/basic_branch.json +++ b/recipe_modules/git/example.expected/basic_branch.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "testing", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -97,7 +96,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -112,7 +111,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -123,7 +122,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -131,7 +130,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -139,7 +138,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -147,7 +146,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -156,7 +155,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -164,10 +163,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/basic_file_name.json b/recipe_modules/git/example.expected/basic_file_name.json index b5b08456c..0bbbf154d 100644 --- a/recipe_modules/git/example.expected/basic_file_name.json +++ b/recipe_modules/git/example.expected/basic_file_name.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -33,7 +32,7 @@ "--", "DEPS" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -42,7 +41,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -57,7 +56,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -66,7 +65,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -77,7 +76,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -88,7 +87,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -99,7 +98,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -114,7 +113,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -125,7 +124,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -133,7 +132,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -141,7 +140,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -149,7 +148,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -158,7 +157,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -166,10 +165,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/basic_hash.json b/recipe_modules/git/example.expected/basic_hash.json index fe9468f50..5d1fb16bb 100644 --- a/recipe_modules/git/example.expected/basic_hash.json +++ b/recipe_modules/git/example.expected/basic_hash.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -20,7 +19,7 @@ "origin", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -30,7 +29,7 @@ "-f", "abcdef0123456789abcdef0123456789abcdef01" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -39,7 +38,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -54,7 +53,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -63,7 +62,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -74,7 +73,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -85,7 +84,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -96,7 +95,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -111,7 +110,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -122,7 +121,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -130,7 +129,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -138,7 +137,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -146,7 +145,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -155,7 +154,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -163,10 +162,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/basic_ref.json b/recipe_modules/git/example.expected/basic_ref.json index eb8aadfe0..255564434 100644 --- a/recipe_modules/git/example.expected/basic_ref.json +++ b/recipe_modules/git/example.expected/basic_ref.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "refs/foo/bar", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -97,7 +96,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -112,7 +111,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -123,7 +122,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -131,7 +130,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -139,7 +138,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -147,7 +146,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -156,7 +155,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -164,10 +163,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/basic_submodule_update_force.json b/recipe_modules/git/example.expected/basic_submodule_update_force.json index f19168b55..dc3e2bc4b 100644 --- a/recipe_modules/git/example.expected/basic_submodule_update_force.json +++ b/recipe_modules/git/example.expected/basic_submodule_update_force.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -76,7 +75,7 @@ "--recursive", "--force" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -87,7 +86,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -98,7 +97,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -113,7 +112,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -124,7 +123,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -132,7 +131,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -140,7 +139,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -148,7 +147,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -157,7 +156,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -165,10 +164,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/can_fail_build.json b/recipe_modules/git/example.expected/can_fail_build.json index 30d92d2db..209806e15 100644 --- a/recipe_modules/git/example.expected/can_fail_build.json +++ b/recipe_modules/git/example.expected/can_fail_build.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -97,7 +96,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -112,7 +111,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -123,7 +122,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -131,7 +130,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -139,7 +138,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build", "~followup_annotations": [ "step returned non-zero exit code: 1", diff --git a/recipe_modules/git/example.expected/cannot_fail_build.json b/recipe_modules/git/example.expected/cannot_fail_build.json index 4b65540d1..c8ba9084d 100644 --- a/recipe_modules/git/example.expected/cannot_fail_build.json +++ b/recipe_modules/git/example.expected/cannot_fail_build.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -97,7 +96,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -112,7 +111,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -123,7 +122,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -131,7 +130,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -139,7 +138,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -147,7 +146,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build", "~followup_annotations": [ "step returned non-zero exit code: 1", @@ -160,7 +159,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -168,10 +167,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/cat-file_test.json b/recipe_modules/git/example.expected/cat-file_test.json index 513457abb..93f392038 100644 --- a/recipe_modules/git/example.expected/cat-file_test.json +++ b/recipe_modules/git/example.expected/cat-file_test.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "abcdef12345", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -97,7 +96,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -112,7 +111,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -123,7 +122,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -131,7 +130,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -139,7 +138,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -147,7 +146,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -156,7 +155,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -166,7 +165,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags (2)", "stdout": "/path/to/tmp/" }, @@ -177,7 +176,7 @@ "blob", "abcdef12345:TestFile" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git cat-file abcdef12345:TestFile", "stdout": "/path/to/tmp/" }, @@ -186,10 +185,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/count-objects_delta.json b/recipe_modules/git/example.expected/count-objects_delta.json index b2ca9cb4c..821f9a5f0 100644 --- a/recipe_modules/git/example.expected/count-objects_delta.json +++ b/recipe_modules/git/example.expected/count-objects_delta.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -18,7 +17,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects before git fetch", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -42,7 +41,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -51,7 +50,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects after git fetch", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -104,7 +103,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -113,7 +112,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -128,7 +127,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -137,7 +136,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -148,7 +147,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -159,7 +158,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -170,7 +169,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -185,7 +184,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -196,7 +195,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -204,7 +203,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -212,7 +211,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -220,7 +219,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -229,7 +228,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -237,10 +236,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/count-objects_failed.json b/recipe_modules/git/example.expected/count-objects_failed.json index 2087e3de5..cfce885fd 100644 --- a/recipe_modules/git/example.expected/count-objects_failed.json +++ b/recipe_modules/git/example.expected/count-objects_failed.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -101,7 +100,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -116,7 +115,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -127,7 +126,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -135,7 +134,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -143,7 +142,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -151,7 +150,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -160,7 +159,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -168,10 +167,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/count-objects_with_bad_output.json b/recipe_modules/git/example.expected/count-objects_with_bad_output.json index 26cc6c13d..96b41df3c 100644 --- a/recipe_modules/git/example.expected/count-objects_with_bad_output.json +++ b/recipe_modules/git/example.expected/count-objects_with_bad_output.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -102,7 +101,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -117,7 +116,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -128,7 +127,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -136,7 +135,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -144,7 +143,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -152,7 +151,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -161,7 +160,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -169,10 +168,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json b/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json index d044d15e5..9df1d303c 100644 --- a/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +++ b/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/", "~followup_annotations": [ diff --git a/recipe_modules/git/example.expected/curl_trace_file.json b/recipe_modules/git/example.expected/curl_trace_file.json index a0b28fa35..01cd9c9ef 100644 --- a/recipe_modules/git/example.expected/curl_trace_file.json +++ b/recipe_modules/git/example.expected/curl_trace_file.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,12 +20,12 @@ "refs/foo/bar", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "env": { "GIT_CURL_VERBOSE": "1" }, "name": "git fetch", - "stderr": "[SLAVE_BUILD]/curl_trace.log" + "stderr": "[CWD]/curl_trace.log" }, { "cmd": [ @@ -35,7 +34,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -44,7 +43,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -59,7 +58,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -68,7 +67,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -79,7 +78,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -90,7 +89,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -101,7 +100,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -116,7 +115,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -127,7 +126,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -135,7 +134,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -143,7 +142,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -151,7 +150,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -160,7 +159,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -168,10 +167,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/platform_win.json b/recipe_modules/git/example.expected/platform_win.json index f71d6390e..db95a4c08 100644 --- a/recipe_modules/git/example.expected/platform_win.json +++ b/recipe_modules/git/example.expected/platform_win.json @@ -12,13 +12,12 @@ "-u", "RECIPE_MODULE[depot_tools::git]\\resources\\git_setup.py", "--path", - "[SLAVE_BUILD]\\src", + "[CWD]\\src", "--url", "https://chromium.googlesource.com/chromium/src.git", "--git_cmd_path", "RECIPE_PACKAGE_REPO[depot_tools]\\git.bat" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -30,7 +29,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git fetch" }, { @@ -40,7 +39,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git checkout" }, { @@ -49,7 +48,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -64,7 +63,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git clean" }, { @@ -73,7 +72,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "submodule sync" }, { @@ -84,7 +83,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "submodule update" }, { @@ -95,7 +94,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -106,7 +105,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -121,7 +120,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -132,7 +131,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git fetch tags" }, { @@ -140,7 +139,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]\\git.bat", "status" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git status" }, { @@ -148,7 +147,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]\\git.bat", "status" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git status can_fail_build" }, { @@ -156,7 +155,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]\\git.bat", "status" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git status cannot_fail_build" }, { @@ -165,7 +164,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "my repo rebase" }, { @@ -173,10 +172,10 @@ "RECIPE_PACKAGE_REPO[depot_tools]\\git.bat", "bundle", "create", - "[SLAVE_BUILD]\\all.bundle", + "[CWD]\\all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]\\src", + "cwd": "[CWD]\\src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/rebase_failed.json b/recipe_modules/git/example.expected/rebase_failed.json index 39666c74d..6abe46464 100644 --- a/recipe_modules/git/example.expected/rebase_failed.json +++ b/recipe_modules/git/example.expected/rebase_failed.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -55,7 +54,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -64,7 +63,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -75,7 +74,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -86,7 +85,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -97,7 +96,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -112,7 +111,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -123,7 +122,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -131,7 +130,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -139,7 +138,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -147,7 +146,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -156,7 +155,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase", "~followup_annotations": [ "step returned non-zero exit code: 1", @@ -169,7 +168,7 @@ "rebase", "--abort" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase abort" }, { diff --git a/recipe_modules/git/example.expected/remote_not_origin.json b/recipe_modules/git/example.expected/remote_not_origin.json index f1b6f2eb6..6626ccbad 100644 --- a/recipe_modules/git/example.expected/remote_not_origin.json +++ b/recipe_modules/git/example.expected/remote_not_origin.json @@ -5,13 +5,12 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git", "--remote", "not_origin" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -23,7 +22,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -33,7 +32,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -42,7 +41,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -57,7 +56,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -66,7 +65,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -77,7 +76,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -88,7 +87,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -99,7 +98,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -114,7 +113,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -125,7 +124,7 @@ "not_origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -133,7 +132,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -141,7 +140,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -149,7 +148,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -158,7 +157,7 @@ "rebase", "not_origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -166,10 +165,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.expected/set_got_revision.json b/recipe_modules/git/example.expected/set_got_revision.json index f0eb36a3e..70aaf23e8 100644 --- a/recipe_modules/git/example.expected/set_got_revision.json +++ b/recipe_modules/git/example.expected/set_got_revision.json @@ -5,11 +5,10 @@ "-u", "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", "--path", - "[SLAVE_BUILD]/src", + "[CWD]/src", "--url", "https://chromium.googlesource.com/chromium/src.git" ], - "cwd": "[SLAVE_BUILD]", "name": "git setup" }, { @@ -21,7 +20,7 @@ "master", "--recurse-submodules" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch" }, { @@ -31,7 +30,7 @@ "-f", "FETCH_HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git checkout" }, { @@ -40,7 +39,7 @@ "rev-parse", "HEAD" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "read revision", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -56,7 +55,7 @@ "-d", "-x" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git clean" }, { @@ -65,7 +64,7 @@ "submodule", "sync" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule sync" }, { @@ -76,7 +75,7 @@ "--init", "--recursive" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "submodule update" }, { @@ -87,7 +86,7 @@ "count-objects", "-v" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "count-objects", "stdout": "/path/to/tmp/" }, @@ -98,7 +97,7 @@ "--get", "remote.origin.url" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git config remote.origin.url", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -113,7 +112,7 @@ "--format=%at", "-s" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git show", "stdout": "/path/to/tmp/" }, @@ -124,7 +123,7 @@ "origin", "--tags" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git fetch tags" }, { @@ -132,7 +131,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status" }, { @@ -140,7 +139,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status can_fail_build" }, { @@ -148,7 +147,7 @@ "git", "status" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git status cannot_fail_build" }, { @@ -157,7 +156,7 @@ "rebase", "origin/master" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "my repo rebase" }, { @@ -165,10 +164,10 @@ "git", "bundle", "create", - "[SLAVE_BUILD]/all.bundle", + "[CWD]/all.bundle", "--all" ], - "cwd": "[SLAVE_BUILD]/src", + "cwd": "[CWD]/src", "name": "git bundle" }, { diff --git a/recipe_modules/git/example.py b/recipe_modules/git/example.py index 066785a2a..02836b45c 100644 --- a/recipe_modules/git/example.py +++ b/recipe_modules/git/example.py @@ -4,6 +4,7 @@ DEPS = [ 'git', + 'infra_paths', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', @@ -19,7 +20,7 @@ def RunSteps(api): # useful for debugging git access issues that are reproducible only on bots. curl_trace_file = None if api.properties.get('use_curl_trace'): - curl_trace_file = api.path['slave_build'].join('curl_trace.log') + curl_trace_file = api.infra_paths['slave_build'].join('curl_trace.log') submodule_update_force = api.properties.get('submodule_update_force', False) submodule_update_recursive = api.properties.get('submodule_update_recursive', @@ -80,7 +81,7 @@ def RunSteps(api): # Bundle the repository. api.git.bundle_create( - api.path['slave_build'].join('all.bundle')) + api.infra_paths['slave_build'].join('all.bundle')) def GenTests(api): diff --git a/recipe_modules/infra_paths/__init__.py b/recipe_modules/infra_paths/__init__.py new file mode 100644 index 000000000..88b9d272f --- /dev/null +++ b/recipe_modules/infra_paths/__init__.py @@ -0,0 +1,5 @@ +DEPS = [ + 'recipe_engine/path', + 'recipe_engine/platform', + 'recipe_engine/properties', +] diff --git a/recipe_modules/infra_paths/api.py b/recipe_modules/infra_paths/api.py new file mode 100644 index 000000000..c84928c4f --- /dev/null +++ b/recipe_modules/infra_paths/api.py @@ -0,0 +1,33 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from recipe_engine import recipe_api + + +class InfraPathsApi(recipe_api.RecipeApi): + def get_config_defaults(self): + return { + 'PLATFORM': self.m.platform.name, + 'CURRENT_WORKING_DIR': self.m.path['cwd'], + 'ROOT': self.m.path['root'], + } + + def __init__(self, **kwargs): + super(InfraPathsApi, self).__init__(**kwargs) + self._config_set = False + + def _lazy_set_config(self): + if self._config_set: + return + self._config_set = True + + path_config = self.m.properties.get('path_config') + if path_config in ('kitchen',): + self.set_config(path_config) + else: + self.set_config('buildbot') + + def __getitem__(self, name): + self._lazy_set_config() + return self.c.paths[name] diff --git a/recipe_modules/infra_paths/config.py b/recipe_modules/infra_paths/config.py new file mode 100644 index 000000000..e252912f2 --- /dev/null +++ b/recipe_modules/infra_paths/config.py @@ -0,0 +1,50 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from recipe_engine.config import config_item_context, ConfigGroup, Dict, Static +from recipe_engine.config_types import Path + +def BaseConfig(PLATFORM, CURRENT_WORKING_DIR, ROOT, **_kwargs): + return ConfigGroup( + paths = Dict(value_type=Path), + + PLATFORM = Static(PLATFORM), + CURRENT_WORKING_DIR = Static(CURRENT_WORKING_DIR), + ROOT = Static(ROOT), + ) + +config_ctx = config_item_context(BaseConfig) + +@config_ctx() +def buildbot(c): + c.paths['root'] = c.ROOT.join('b') + c.paths['slave_build'] = c.CURRENT_WORKING_DIR + c.paths['cache'] = c.paths['root'].join( + 'build', 'slave', 'cache') + c.paths['git_cache'] = c.paths['root'].join( + 'build', 'slave', 'cache_dir') + c.paths['goma_cache'] = c.paths['root'].join( + 'build', 'slave', 'goma_cache') + for token in ('build_internal', 'build', 'depot_tools'): + c.paths[token] = c.paths['root'].join(token,) + +@config_ctx() +def kitchen(c): + c.paths['root'] = c.CURRENT_WORKING_DIR + c.paths['slave_build'] = c.CURRENT_WORKING_DIR + # TODO(phajdan.jr): have one cache dir, let clients append suffixes. + # TODO(phajdan.jr): set persistent cache path for remaining platforms. + # NOTE: do not use /b/swarm_slave here - it gets deleted on bot redeploy, + # and may happen even after a reboot. + if c.PLATFORM == 'linux': + c.paths['cache'] = c.ROOT.join( + 'b', 'cache', 'chromium') + c.paths['git_cache'] = c.ROOT.join( + 'b', 'cache', 'chromium', 'git_cache') + c.paths['goma_cache'] = c.ROOT.join( + 'b', 'cache', 'chromium', 'goma_cache') + else: + c.paths['cache'] = c.paths['root'].join('cache') + c.paths['git_cache'] = c.paths['root'].join('cache_dir') + c.paths['goma_cache'] = c.paths['root'].join('goma_cache') diff --git a/recipe_modules/infra_paths/example.expected/linux.json b/recipe_modules/infra_paths/example.expected/linux.json new file mode 100644 index 000000000..9ec0cb6ce --- /dev/null +++ b/recipe_modules/infra_paths/example.expected/linux.json @@ -0,0 +1,12 @@ +[ + { + "cmd": [], + "cwd": "[CWD]", + "name": "step" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipe_modules/infra_paths/example.expected/linux_kitchen.json b/recipe_modules/infra_paths/example.expected/linux_kitchen.json new file mode 100644 index 000000000..9ec0cb6ce --- /dev/null +++ b/recipe_modules/infra_paths/example.expected/linux_kitchen.json @@ -0,0 +1,12 @@ +[ + { + "cmd": [], + "cwd": "[CWD]", + "name": "step" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipe_modules/infra_paths/example.expected/mac.json b/recipe_modules/infra_paths/example.expected/mac.json new file mode 100644 index 000000000..9ec0cb6ce --- /dev/null +++ b/recipe_modules/infra_paths/example.expected/mac.json @@ -0,0 +1,12 @@ +[ + { + "cmd": [], + "cwd": "[CWD]", + "name": "step" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipe_modules/infra_paths/example.expected/mac_kitchen.json b/recipe_modules/infra_paths/example.expected/mac_kitchen.json new file mode 100644 index 000000000..9ec0cb6ce --- /dev/null +++ b/recipe_modules/infra_paths/example.expected/mac_kitchen.json @@ -0,0 +1,12 @@ +[ + { + "cmd": [], + "cwd": "[CWD]", + "name": "step" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipe_modules/infra_paths/example.expected/win.json b/recipe_modules/infra_paths/example.expected/win.json new file mode 100644 index 000000000..9ec0cb6ce --- /dev/null +++ b/recipe_modules/infra_paths/example.expected/win.json @@ -0,0 +1,12 @@ +[ + { + "cmd": [], + "cwd": "[CWD]", + "name": "step" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipe_modules/infra_paths/example.expected/win_kitchen.json b/recipe_modules/infra_paths/example.expected/win_kitchen.json new file mode 100644 index 000000000..9ec0cb6ce --- /dev/null +++ b/recipe_modules/infra_paths/example.expected/win_kitchen.json @@ -0,0 +1,12 @@ +[ + { + "cmd": [], + "cwd": "[CWD]", + "name": "step" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipe_modules/infra_paths/example.py b/recipe_modules/infra_paths/example.py new file mode 100644 index 000000000..9e6f712fa --- /dev/null +++ b/recipe_modules/infra_paths/example.py @@ -0,0 +1,24 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +DEPS = [ + 'infra_paths', + 'recipe_engine/platform', + 'recipe_engine/properties', + 'recipe_engine/step', +] + +from recipe_engine.config_types import Path + +def RunSteps(api): + api.step('step', [], cwd=api.infra_paths['slave_build']) + + +def GenTests(api): + for platform in ('linux', 'win', 'mac'): + yield (api.test(platform) + api.platform.name(platform)) + + yield (api.test('%s_kitchen' % platform) + + api.platform.name(platform) + + api.properties(path_config='kitchen')) diff --git a/recipe_modules/presubmit/example.expected/basic.json b/recipe_modules/presubmit/example.expected/basic.json index b4d07f7b8..fc6e2a665 100644 --- a/recipe_modules/presubmit/example.expected/basic.json +++ b/recipe_modules/presubmit/example.expected/basic.json @@ -5,7 +5,6 @@ "-u", "RECIPE_PACKAGE_REPO[depot_tools]/presubmit_support.py" ], - "cwd": "[SLAVE_BUILD]", "env": { "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, diff --git a/recipe_modules/rietveld/__init__.py b/recipe_modules/rietveld/__init__.py index fdc935265..ea30e78ee 100644 --- a/recipe_modules/rietveld/__init__.py +++ b/recipe_modules/rietveld/__init__.py @@ -1,4 +1,5 @@ DEPS = [ + 'infra_paths', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/python', diff --git a/recipe_modules/rietveld/api.py b/recipe_modules/rietveld/api.py index b52ec0bc9..4011a68bd 100644 --- a/recipe_modules/rietveld/api.py +++ b/recipe_modules/rietveld/api.py @@ -67,22 +67,22 @@ class RietveldApi(recipe_api.RecipeApi): if authentication == 'oauth2': step_result = self.m.python( 'apply_issue', - self.m.path['depot_tools'].join('apply_issue.py'), [ + self.m.infra_paths['depot_tools'].join('apply_issue.py'), [ '-r', self.m.path['checkout'].join(*root_pieces), '-i', issue_number, '-p', self.m.properties['patchset'], '-s', rietveld_url, - '-E', self.m.path['build'].join('site_config', - '.rietveld_client_email'), - '-k', self.m.path['build'].join('site_config', - '.rietveld_secret_key') + '-E', self.m.infra_paths['build'].join( + 'site_config', '.rietveld_client_email'), + '-k', self.m.infra_paths['build'].join( + 'site_config', '.rietveld_secret_key') ], ) else: step_result = self.m.python( 'apply_issue', - self.m.path['depot_tools'].join('apply_issue.py'), [ + self.m.infra_paths['depot_tools'].join('apply_issue.py'), [ '-r', self.m.path['checkout'].join(*root_pieces), '-i', issue_number, '-p', self.m.properties['patchset'], diff --git a/recipe_modules/rietveld/example.expected/basic.json b/recipe_modules/rietveld/example.expected/basic.json index c88cba816..a04d778da 100644 --- a/recipe_modules/rietveld/example.expected/basic.json +++ b/recipe_modules/rietveld/example.expected/basic.json @@ -3,9 +3,9 @@ "cmd": [ "python", "-u", - "[DEPOT_TOOLS]/apply_issue.py", + "[ROOT]/b/depot_tools/apply_issue.py", "-r", - "[SLAVE_BUILD]/foo/bar", + "[CWD]/foo/bar", "-i", "1", "-p", @@ -13,11 +13,10 @@ "-s", "http://review_tool.url", "-E", - "[BUILD]/site_config/.rietveld_client_email", + "[ROOT]/b/build/site_config/.rietveld_client_email", "-k", - "[BUILD]/site_config/.rietveld_secret_key" + "[ROOT]/b/build/site_config/.rietveld_secret_key" ], - "cwd": "[SLAVE_BUILD]", "name": "apply_issue", "~followup_annotations": [ "@@@STEP_LINK@Applied issue 1@http://review_tool.url/1@@@" diff --git a/recipe_modules/rietveld/example.py b/recipe_modules/rietveld/example.py index b00cb201a..b389687c5 100644 --- a/recipe_modules/rietveld/example.py +++ b/recipe_modules/rietveld/example.py @@ -3,6 +3,7 @@ # found in the LICENSE file. DEPS = [ + 'infra_paths', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/step', @@ -10,7 +11,7 @@ DEPS = [ ] def RunSteps(api): - api.path['checkout'] = api.path['slave_build'] + api.path['checkout'] = api.infra_paths['slave_build'] api.rietveld.apply_issue('foo', 'bar', authentication='oauth2') api.rietveld.calculate_issue_root({'project': ['']}) diff --git a/recipe_modules/tryserver/__init__.py b/recipe_modules/tryserver/__init__.py index 53957cdc2..ac07362e8 100644 --- a/recipe_modules/tryserver/__init__.py +++ b/recipe_modules/tryserver/__init__.py @@ -4,6 +4,7 @@ DEPS = [ 'git', + 'infra_paths', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/platform', diff --git a/recipe_modules/tryserver/api.py b/recipe_modules/tryserver/api.py index 8bd8df87f..18bf90426 100644 --- a/recipe_modules/tryserver/api.py +++ b/recipe_modules/tryserver/api.py @@ -100,7 +100,8 @@ class TryserverApi(recipe_api.RecipeApi): patch_ref = self.m.properties['patch_ref'] patch_dir = self.m.path.mkdtemp('patch') - git_setup_py = self.m.path['build'].join('scripts', 'slave', 'git_setup.py') + git_setup_py = self.m.infra_paths['build'].join( + 'scripts', 'slave', 'git_setup.py') git_setup_args = ['--path', patch_dir, '--url', patch_repo_url] patch_path = patch_dir.join('patch.diff') diff --git a/recipe_modules/tryserver/example.expected/with_git_patch.json b/recipe_modules/tryserver/example.expected/with_git_patch.json index 117f1c2e1..570d5c2e2 100644 --- a/recipe_modules/tryserver/example.expected/with_git_patch.json +++ b/recipe_modules/tryserver/example.expected/with_git_patch.json @@ -3,13 +3,12 @@ "cmd": [ "python", "-u", - "[BUILD]/scripts/slave/git_setup.py", + "[ROOT]/b/build/scripts/slave/git_setup.py", "--path", - "[TMP_BASE]/patch_tmp_1", + "[TMP]/patch_tmp_1", "--url", "http://patch.url/" ], - "cwd": "[SLAVE_BUILD]", "name": "patch git setup" }, { @@ -19,7 +18,7 @@ "origin", "johndoe#123.diff" ], - "cwd": "[TMP_BASE]/patch_tmp_1", + "cwd": "[TMP]/patch_tmp_1", "name": "patch fetch" }, { @@ -30,7 +29,7 @@ "-d", "-x" ], - "cwd": "[TMP_BASE]/patch_tmp_1", + "cwd": "[TMP]/patch_tmp_1", "name": "patch clean" }, { @@ -40,32 +39,30 @@ "-f", "FETCH_HEAD" ], - "cwd": "[TMP_BASE]/patch_tmp_1", + "cwd": "[TMP]/patch_tmp_1", "name": "patch git checkout" }, { "cmd": [ "patch", "--dir", - "[SLAVE_BUILD]", + "[CWD]", "--force", "--forward", "--remove-empty-files", "--strip", "0", "--input", - "[TMP_BASE]/patch_tmp_1/patch.diff" + "[TMP]/patch_tmp_1/patch.diff" ], - "cwd": "[SLAVE_BUILD]", "name": "apply patch" }, { "cmd": [ "rm", "-rf", - "[TMP_BASE]/patch_tmp_1" + "[TMP]/patch_tmp_1" ], - "cwd": "[SLAVE_BUILD]", "name": "remove patch" }, { @@ -75,7 +72,7 @@ "--cached", "--name-only" ], - "cwd": "[SLAVE_BUILD]/v8", + "cwd": "[CWD]/v8", "name": "git diff to analyze patch", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -91,7 +88,6 @@ "-u", "import sys; sys.exit(1)" ], - "cwd": "[SLAVE_BUILD]", "name": "fail", "~followup_annotations": [ "step returned non-zero exit code: 1", diff --git a/recipe_modules/tryserver/example.expected/with_rietveld_patch.json b/recipe_modules/tryserver/example.expected/with_rietveld_patch.json index 8565941e2..dd568e86b 100644 --- a/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +++ b/recipe_modules/tryserver/example.expected/with_rietveld_patch.json @@ -3,9 +3,9 @@ "cmd": [ "python", "-u", - "[DEPOT_TOOLS]/apply_issue.py", + "[ROOT]/b/depot_tools/apply_issue.py", "-r", - "[SLAVE_BUILD]", + "[CWD]", "-i", "12853011", "-p", @@ -14,7 +14,6 @@ "https://codereview.chromium.org", "--no-auth" ], - "cwd": "[SLAVE_BUILD]", "name": "apply_issue", "~followup_annotations": [ "@@@STEP_LINK@Applied issue 12853011@https://codereview.chromium.org/12853011@@@" @@ -27,7 +26,7 @@ "--cached", "--name-only" ], - "cwd": "[SLAVE_BUILD]", + "cwd": "[CWD]", "name": "git diff to analyze patch", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -43,7 +42,6 @@ "-u", "import sys; sys.exit(1)" ], - "cwd": "[SLAVE_BUILD]", "name": "fail", "~followup_annotations": [ "step returned non-zero exit code: 1", diff --git a/recipe_modules/tryserver/example.expected/with_svn_patch.json b/recipe_modules/tryserver/example.expected/with_svn_patch.json index 1046c0339..d78427772 100644 --- a/recipe_modules/tryserver/example.expected/with_svn_patch.json +++ b/recipe_modules/tryserver/example.expected/with_svn_patch.json @@ -7,7 +7,6 @@ "svn://checkout.url", "/path/to/tmp/diff" ], - "cwd": "[SLAVE_BUILD]", "name": "download patch", "~followup_annotations": [ "@@@STEP_LOG_LINE@patch.diff@fake patch.diff content (line 1)@@@", @@ -20,14 +19,13 @@ "cmd": [ "patch", "--dir", - "[SLAVE_BUILD]", + "[CWD]", "--force", "--forward", "--remove-empty-files", "--strip", "0" ], - "cwd": "[SLAVE_BUILD]", "name": "apply patch", "stdin": "fake patch.diff content (line 1)\nfake patch.diff content (line 2)\n" }, @@ -38,7 +36,7 @@ "--cached", "--name-only" ], - "cwd": "[SLAVE_BUILD]", + "cwd": "[CWD]", "name": "git diff to analyze patch", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -54,7 +52,6 @@ "-u", "import sys; sys.exit(1)" ], - "cwd": "[SLAVE_BUILD]", "name": "fail", "~followup_annotations": [ "step returned non-zero exit code: 1", diff --git a/recipe_modules/tryserver/example.expected/with_wrong_patch.json b/recipe_modules/tryserver/example.expected/with_wrong_patch.json index 1a2cbcb1e..ad5fa8aa3 100644 --- a/recipe_modules/tryserver/example.expected/with_wrong_patch.json +++ b/recipe_modules/tryserver/example.expected/with_wrong_patch.json @@ -13,7 +13,7 @@ "--cached", "--name-only" ], - "cwd": "[SLAVE_BUILD]", + "cwd": "[CWD]", "name": "git diff to analyze patch", "stdout": "/path/to/tmp/", "~followup_annotations": [ @@ -27,7 +27,6 @@ "-u", "import sys; sys.exit(1)" ], - "cwd": "[SLAVE_BUILD]", "name": "fail", "~followup_annotations": [ "step returned non-zero exit code: 1", diff --git a/recipe_modules/tryserver/example.py b/recipe_modules/tryserver/example.py index dead670bf..773c154d9 100644 --- a/recipe_modules/tryserver/example.py +++ b/recipe_modules/tryserver/example.py @@ -3,6 +3,7 @@ # found in the LICENSE file. DEPS = [ + 'infra_paths', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', @@ -12,7 +13,7 @@ DEPS = [ def RunSteps(api): - api.path['checkout'] = api.path['slave_build'] + api.path['checkout'] = api.infra_paths['slave_build'] api.tryserver.maybe_apply_issue() api.tryserver.get_files_affected_by_patch()