From c2054c2fb0e5af75ffa1ac1305b3fa805f73ae4a Mon Sep 17 00:00:00 2001 From: "phajdan.jr" Date: Mon, 27 Jun 2016 04:02:32 -0700 Subject: [PATCH] infra_paths: enable persistent cache also on Windows BUG=584079, 459840, 593999, 596887 Review-Url: https://codereview.chromium.org/2102503002 --- recipe_modules/infra_paths/path_config.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/recipe_modules/infra_paths/path_config.py b/recipe_modules/infra_paths/path_config.py index 6b7bb33c1..8c1d0a603 100644 --- a/recipe_modules/infra_paths/path_config.py +++ b/recipe_modules/infra_paths/path_config.py @@ -30,15 +30,21 @@ 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. + + b_dir = c.CURRENT_WORKING_DIR + while b_dir and b_dir[-1] != 'b': + b_dir = b_dir[:-1] + if c.PLATFORM in ('linux', 'mac'): c.base_paths['cache'] = ( '/', 'b', 'cache', 'chromium') for path in ('builder_cache', 'git_cache', 'goma_cache', 'goma_deps_cache'): c.base_paths[path] = c.base_paths['cache'] + (path,) - else: + elif b_dir: + c.base_paths['cache'] = b_dir + ('cache', 'chromium') + for path in ('builder_cache', 'git_cache', 'goma_cache', 'goma_deps_cache'): + c.base_paths[path] = c.base_paths['cache'] + (path,) + else: # pragma: no cover c.base_paths['cache'] = c.base_paths['root'] + ('cache',) c.base_paths['git_cache'] = c.base_paths['root'] + ('cache_dir',) for path in ('builder_cache', 'goma_cache', 'goma_deps_cache'):