Update the cache paths

Use hierarchical paths for Jiri and Goma caches

Change-Id: I1969d5e0ad1abc9c79a966818acc5dd74650ffeb
diff --git a/recipe_modules/goma/api.py b/recipe_modules/goma/api.py
index d1b0f0a..6bfea25 100644
--- a/recipe_modules/goma/api.py
+++ b/recipe_modules/goma/api.py
@@ -103,6 +103,8 @@
         assert self._goma_dir
         assert not self._goma_started
 
+        self._goma_ctl_env['GOMA_CACHE_DIR'] = (
+            self.m.path.join(self.m.path['cache'], 'goma'))
         self._goma_ctl_env['GOMA_SERVICE_ACCOUNT_JSON_FILE'] = (
             self.service_account_json_path)
 
diff --git a/recipe_modules/goma/example.expected/linux.json b/recipe_modules/goma/example.expected/linux.json
index 23992d3..f3ca7f6 100644
--- a/recipe_modules/goma/example.expected/linux.json
+++ b/recipe_modules/goma/example.expected/linux.json
@@ -124,6 +124,7 @@
       "restart"
     ],
     "env": {
+      "GOMA_CACHE_DIR": "[CACHE]/goma",
       "GOMA_SERVICE_ACCOUNT_JSON_FILE": "/creds/service_accounts/service-account-goma-client.json"
     },
     "name": "start_goma"
@@ -178,6 +179,7 @@
       "[CACHE]/cipd/goma/jsonstatus"
     ],
     "env": {
+      "GOMA_CACHE_DIR": "[CACHE]/goma",
       "GOMA_SERVICE_ACCOUNT_JSON_FILE": "/creds/service_accounts/service-account-goma-client.json"
     },
     "name": "goma_jsonstatus"
@@ -190,6 +192,7 @@
       "stat"
     ],
     "env": {
+      "GOMA_CACHE_DIR": "[CACHE]/goma",
       "GOMA_SERVICE_ACCOUNT_JSON_FILE": "/creds/service_accounts/service-account-goma-client.json"
     },
     "name": "goma_stat"
@@ -202,6 +205,7 @@
       "stop"
     ],
     "env": {
+      "GOMA_CACHE_DIR": "[CACHE]/goma",
       "GOMA_SERVICE_ACCOUNT_JSON_FILE": "/creds/service_accounts/service-account-goma-client.json"
     },
     "name": "stop_goma"
diff --git a/recipe_modules/goma/example.expected/mac.json b/recipe_modules/goma/example.expected/mac.json
index 90032d1..e198e5e 100644
--- a/recipe_modules/goma/example.expected/mac.json
+++ b/recipe_modules/goma/example.expected/mac.json
@@ -124,6 +124,7 @@
       "restart"
     ],
     "env": {
+      "GOMA_CACHE_DIR": "[CACHE]/goma",
       "GOMA_SERVICE_ACCOUNT_JSON_FILE": "/creds/service_accounts/service-account-goma-client.json"
     },
     "name": "start_goma"
@@ -178,6 +179,7 @@
       "[CACHE]/cipd/goma/jsonstatus"
     ],
     "env": {
+      "GOMA_CACHE_DIR": "[CACHE]/goma",
       "GOMA_SERVICE_ACCOUNT_JSON_FILE": "/creds/service_accounts/service-account-goma-client.json"
     },
     "name": "goma_jsonstatus"
@@ -190,6 +192,7 @@
       "stat"
     ],
     "env": {
+      "GOMA_CACHE_DIR": "[CACHE]/goma",
       "GOMA_SERVICE_ACCOUNT_JSON_FILE": "/creds/service_accounts/service-account-goma-client.json"
     },
     "name": "goma_stat"
@@ -202,6 +205,7 @@
       "stop"
     ],
     "env": {
+      "GOMA_CACHE_DIR": "[CACHE]/goma",
       "GOMA_SERVICE_ACCOUNT_JSON_FILE": "/creds/service_accounts/service-account-goma-client.json"
     },
     "name": "stop_goma"
diff --git a/recipe_modules/jiri/api.py b/recipe_modules/jiri/api.py
index daae91e..067d649 100644
--- a/recipe_modules/jiri/api.py
+++ b/recipe_modules/jiri/api.py
@@ -33,7 +33,7 @@
         return self._jiri_executable
 
     def init(self, dir=None, **kwargs):
-        cmd = [ 'init', '-cache', self.m.path['jiri_cache'] ]
+        cmd = [ 'init', '-cache', self.m.path['cache'].join('jiri') ]
         if dir:
             cmd.append(dir)
 
diff --git a/recipe_modules/jiri/example.expected/basic.json b/recipe_modules/jiri/example.expected/basic.json
index bfb86d7..2df91e4 100644
--- a/recipe_modules/jiri/example.expected/basic.json
+++ b/recipe_modules/jiri/example.expected/basic.json
@@ -50,7 +50,7 @@
       "[CACHE]/cipd/jiri",
       "init",
       "-cache",
-      "[JIRI_CACHE]",
+      "[CACHE]/jiri",
       "dir"
     ],
     "name": "jiri init"
diff --git a/recipe_modules/jiri/example.expected/basic_fuchsia.json b/recipe_modules/jiri/example.expected/basic_fuchsia.json
index bfb86d7..2df91e4 100644
--- a/recipe_modules/jiri/example.expected/basic_fuchsia.json
+++ b/recipe_modules/jiri/example.expected/basic_fuchsia.json
@@ -50,7 +50,7 @@
       "[CACHE]/cipd/jiri",
       "init",
       "-cache",
-      "[JIRI_CACHE]",
+      "[CACHE]/jiri",
       "dir"
     ],
     "name": "jiri init"
diff --git a/recipe_modules/jiri/example.expected/basic_jiri.json b/recipe_modules/jiri/example.expected/basic_jiri.json
index bfb86d7..2df91e4 100644
--- a/recipe_modules/jiri/example.expected/basic_jiri.json
+++ b/recipe_modules/jiri/example.expected/basic_jiri.json
@@ -50,7 +50,7 @@
       "[CACHE]/cipd/jiri",
       "init",
       "-cache",
-      "[JIRI_CACHE]",
+      "[CACHE]/jiri",
       "dir"
     ],
     "name": "jiri init"
diff --git a/recipe_modules/jiri/example.expected/basic_magenta.json b/recipe_modules/jiri/example.expected/basic_magenta.json
index bfb86d7..2df91e4 100644
--- a/recipe_modules/jiri/example.expected/basic_magenta.json
+++ b/recipe_modules/jiri/example.expected/basic_magenta.json
@@ -50,7 +50,7 @@
       "[CACHE]/cipd/jiri",
       "init",
       "-cache",
-      "[JIRI_CACHE]",
+      "[CACHE]/jiri",
       "dir"
     ],
     "name": "jiri init"
diff --git a/recipe_modules/paths/config.py b/recipe_modules/paths/config.py
index 0e83477..60fbd1c 100644
--- a/recipe_modules/paths/config.py
+++ b/recipe_modules/paths/config.py
@@ -16,5 +16,3 @@
     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'] + ('cache',)
-    c.base_paths['goma_cache'] = c.base_paths['root'] + ('goma_cache',)
-    c.base_paths['jiri_cache'] = c.base_paths['root'] + ('jiri_cache',)