From 85af45334ed48cc2e35ddaef0c428f701246260a Mon Sep 17 00:00:00 2001 From: Robert Iannucci Date: Fri, 5 Oct 2018 17:42:27 +0000 Subject: [PATCH] [windows_sdk] Default to cache/windows_sdk. This should allow better integration with buildbucket named cache support. Since this was already parameterized it shouldn't actually break anything; previously the directory would be deleted on every run, now it will still be deleted on every run (but we can add a buildbucket named cache entry for it to preserve it). R=tandrii@chromium.org, vadimsh@chromium.org Bug: 877775 Change-Id: I1184fb59a3ed18bfda5fcb288903201b01527096 Recipe-Nontrivial-Roll: build Recipe-Nontrivial-Roll: infra Reviewed-on: https://chromium-review.googlesource.com/c/1263861 Commit-Queue: Robbie Iannucci Reviewed-by: Andrii Shyshkalov Reviewed-by: Vadim Shtayura --- recipes/README.recipes.md | 2 +- recipes/recipe_modules/windows_sdk/api.py | 4 ++-- .../windows_sdk/examples/full.expected/win.json | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index 8c91bdb5b..f70ec576c 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -869,7 +869,7 @@ Setups the SDK environment when enabled. Args: path (path): Path to a directory where to install the SDK - (default is '[start_dir]/windows_sdk') + (default is '[CACHE]/windows_sdk') version (str): CIPD version of the SDK (default is set via $infra/windows_sdk.version property) enabled (bool): Whether the SDK should be used or not. diff --git a/recipes/recipe_modules/windows_sdk/api.py b/recipes/recipe_modules/windows_sdk/api.py index 6ff0323ec..c6ed26d55 100644 --- a/recipes/recipe_modules/windows_sdk/api.py +++ b/recipes/recipe_modules/windows_sdk/api.py @@ -26,7 +26,7 @@ class WindowsSDKApi(recipe_api.RecipeApi): Args: path (path): Path to a directory where to install the SDK - (default is '[start_dir]/windows_sdk') + (default is '[CACHE]/windows_sdk') version (str): CIPD version of the SDK (default is set via $infra/windows_sdk.version property) enabled (bool): Whether the SDK should be used or not. @@ -36,7 +36,7 @@ class WindowsSDKApi(recipe_api.RecipeApi): """ if enabled: sdk_dir = self._ensure_sdk( - path or self.m.path['start_dir'].join('windows_sdk'), + path or self.m.path['cache'].join('windows_sdk'), version or self._sdk_properties['version']) try: with self.m.context(**self._sdk_env(sdk_dir)): diff --git a/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json b/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json index ef292faba..092354d90 100644 --- a/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json +++ b/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json @@ -4,7 +4,7 @@ "cipd.bat", "ensure", "-root", - "[START_DIR]\\windows_sdk", + "[CACHE]\\windows_sdk", "-ensure-file", "chrome_internal/third_party/sdk/windows uploaded:2018-06-13", "-json-output", @@ -31,7 +31,7 @@ "python", "-u", "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", - "[START_DIR]\\windows_sdk\\win_sdk\\bin\\SetEnv.x64.json", + "[CACHE]\\windows_sdk\\win_sdk\\bin\\SetEnv.x64.json", "/path/to/tmp/json" ], "name": "read SetEnv.x64.json", @@ -65,11 +65,11 @@ "out/Release" ], "env": { - "VSINSTALLDIR": "[START_DIR]\\windows_sdk" + "VSINSTALLDIR": "[CACHE]\\windows_sdk" }, "env_prefixes": { "PATH": [ - "[START_DIR]\\windows_sdk\\win_sdk\\bin\\x64" + "[CACHE]\\windows_sdk\\win_sdk\\bin\\x64" ] }, "name": "gn" @@ -81,11 +81,11 @@ "out/Release" ], "env": { - "VSINSTALLDIR": "[START_DIR]\\windows_sdk" + "VSINSTALLDIR": "[CACHE]\\windows_sdk" }, "env_prefixes": { "PATH": [ - "[START_DIR]\\windows_sdk\\win_sdk\\bin\\x64" + "[CACHE]\\windows_sdk\\win_sdk\\bin\\x64" ] }, "name": "ninja"