OLD | NEW |
---|---|
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import DEPS | 5 import DEPS |
6 CONFIG_CTX = DEPS['path'].CONFIG_CTX | 6 CONFIG_CTX = DEPS['path'].CONFIG_CTX |
7 | 7 |
8 | 8 |
9 @CONFIG_CTX() | 9 @CONFIG_CTX() |
10 def infra_common(c): | 10 def infra_common(c): |
(...skipping 12 matching lines...) Expand all Loading... | |
23 'build', 'slave', 'goma_cache') | 23 'build', 'slave', 'goma_cache') |
24 for token in ('build_internal', 'build', 'depot_tools'): | 24 for token in ('build_internal', 'build', 'depot_tools'): |
25 c.base_paths[token] = c.base_paths['root'] + (token,) | 25 c.base_paths[token] = c.base_paths['root'] + (token,) |
26 | 26 |
27 | 27 |
28 @CONFIG_CTX(includes=['infra_common']) | 28 @CONFIG_CTX(includes=['infra_common']) |
29 def infra_kitchen(c): | 29 def infra_kitchen(c): |
30 c.base_paths['root'] = c.CURRENT_WORKING_DIR | 30 c.base_paths['root'] = c.CURRENT_WORKING_DIR |
31 c.base_paths['slave_build'] = c.CURRENT_WORKING_DIR | 31 c.base_paths['slave_build'] = c.CURRENT_WORKING_DIR |
32 # TODO(phajdan.jr): have one cache dir, let clients append suffixes. | 32 # TODO(phajdan.jr): have one cache dir, let clients append suffixes. |
33 # TODO(phajdan.jr): set persistent cache path for remaining platforms. | 33 |
34 # NOTE: do not use /b/swarm_slave here - it gets deleted on bot redeploy, | 34 b_dir = c.CURRENT_WORKING_DIR |
35 # and may happen even after a reboot. | 35 while b_dir and b_dir[-1] != 'b': |
36 b_dir = b_dir[:-1] | |
37 | |
36 if c.PLATFORM in ('linux', 'mac'): | 38 if c.PLATFORM in ('linux', 'mac'): |
37 c.base_paths['cache'] = ( | 39 c.base_paths['cache'] = ( |
38 '/', 'b', 'cache', 'chromium') | 40 '/', 'b', 'cache', 'chromium') |
39 for path in ('builder_cache', 'git_cache', 'goma_cache', 'goma_deps_cache'): | 41 for path in ('builder_cache', 'git_cache', 'goma_cache', 'goma_deps_cache'): |
40 c.base_paths[path] = c.base_paths['cache'] + (path,) | 42 c.base_paths[path] = c.base_paths['cache'] + (path,) |
41 else: | 43 elif b_dir: |
44 c.base_paths['cache'] = b_dir + ('cache', 'chromium') | |
Sergiy Byelozyorov
2016/06/27 10:58:35
Is it valid to add lists and tuples? Maybe better
Paweł Hajdan Jr.
2016/06/27 10:59:07
It's already a tuple.
Sergiy Byelozyorov
2016/06/27 11:26:48
Indeed, thanks for pointing this out. I thought us
| |
45 for path in ('builder_cache', 'git_cache', 'goma_cache', 'goma_deps_cache'): | |
46 c.base_paths[path] = c.base_paths['cache'] + (path,) | |
47 else: # pragma: no cover | |
42 c.base_paths['cache'] = c.base_paths['root'] + ('cache',) | 48 c.base_paths['cache'] = c.base_paths['root'] + ('cache',) |
43 c.base_paths['git_cache'] = c.base_paths['root'] + ('cache_dir',) | 49 c.base_paths['git_cache'] = c.base_paths['root'] + ('cache_dir',) |
44 for path in ('builder_cache', 'goma_cache', 'goma_deps_cache'): | 50 for path in ('builder_cache', 'goma_cache', 'goma_deps_cache'): |
45 c.base_paths[path] = c.base_paths['cache'] + (path,) | 51 c.base_paths[path] = c.base_paths['cache'] + (path,) |
OLD | NEW |