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

Unified Diff: recipe_modules/infra_paths/path_config.py

Issue 1926033002: depot_tools: add infra_paths recipe module for infra-specific paths (attempt #2) (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: fixes Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipe_modules/infra_paths/path_config.py
diff --git a/recipe_modules/infra_paths/path_config.py b/recipe_modules/infra_paths/path_config.py
new file mode 100644
index 0000000000000000000000000000000000000000..fd2fd52c5a00fc74d5d7d7bbd149dc6e35220911
--- /dev/null
+++ b/recipe_modules/infra_paths/path_config.py
@@ -0,0 +1,46 @@
+# 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.
+
+import DEPS
+CONFIG_CTX = DEPS['path'].CONFIG_CTX
+
+
+@CONFIG_CTX()
+def infra_common(c):
+ c.dynamic_paths['checkout'] = None
+
+
+@CONFIG_CTX(includes=['infra_common'])
+def infra_buildbot(c):
+ c.base_paths['root'] = c.CURRENT_WORKING_DIR[:-4]
+ c.base_paths['slave_build'] = c.CURRENT_WORKING_DIR
+ c.base_paths['cache'] = c.base_paths['root'] + (
+ 'build', 'slave', 'cache')
+ c.base_paths['git_cache'] = c.base_paths['root'] + (
+ 'build', 'slave', 'cache_dir')
+ c.base_paths['goma_cache'] = c.base_paths['root'] + (
+ 'build', 'slave', 'goma_cache')
+ for token in ('build_internal', 'build', 'depot_tools'):
+ c.base_paths[token] = c.base_paths['root'] + (token,)
+
+
+@CONFIG_CTX(includes=['infra_common'])
+def infra_kitchen(c):
+ c.base_paths['root'] = c.CURRENT_WORKING_DIR
+ c.base_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.base_paths['cache'] = (
+ '/', 'b', 'cache', 'chromium')
+ c.base_paths['git_cache'] = (
+ '/', 'b', 'cache', 'chromium', 'git_cache')
+ c.base_paths['goma_cache'] = (
+ '/', 'b', 'cache', 'chromium', 'goma_cache')
+ else:
+ c.base_paths['cache'] = c.base_paths['root'] + ('cache',)
+ c.base_paths['git_cache'] = c.base_paths['root'] + ('cache_dir',)
+ c.base_paths['goma_cache'] = c.base_paths['root'] + ('goma_cache',)
« no previous file with comments | « recipe_modules/infra_paths/example.expected/paths_kitchen_win.json ('k') | recipe_modules/infra_paths/test_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698