From 9ff20528f9d3e0019bfe477b5ca864edb7b7d2f6 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 30 May 2024 18:04:30 +0200 Subject: [PATCH] Remove usage of `gsutil` (#2875) * Remove the usage of gsutil The tool brings in dependencies which we don't want, so just use the URI directly to get the file. * verbosity pass through --- native/winui/ANGLE.cake | 18 +++++++----------- scripts/cake/shared.cake | 3 ++- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/native/winui/ANGLE.cake b/native/winui/ANGLE.cake index 5fe7e4285d..966902a6b3 100644 --- a/native/winui/ANGLE.cake +++ b/native/winui/ANGLE.cake @@ -49,17 +49,13 @@ void InitializeAngle(string branch, DirectoryPath ANGLE_PATH, DirectoryPath WINA RunPython(ANGLE_PATH, ANGLE_PATH.CombineWithFilePath("build/util/lastchange.py"), $"-o {lastchange}"); } - if (!FileExists(ANGLE_PATH.CombineWithFilePath("build/toolchain/win/rc/win/rc.exe"))) { - var oldPath = EnvironmentVariable("PATH"); - try { - System.Environment.SetEnvironmentVariable("PATH", DEPOT_PATH.FullPath + System.IO.Path.PathSeparator + oldPath); - - RunPython(ANGLE_PATH, - DEPOT_PATH.CombineWithFilePath("download_from_google_storage.py"), - $"--no_resume --no_auth --bucket chromium-browser-clang/rc -s build/toolchain/win/rc/win/rc.exe.sha1"); - } finally { - System.Environment.SetEnvironmentVariable("PATH", oldPath); - } + var rc_exe = "build/toolchain/win/rc/win/rc.exe"; + var rcPath = ANGLE_PATH.CombineWithFilePath(rc_exe); + if (!FileExists(rcPath)) { + var shaPath = ANGLE_PATH.CombineWithFilePath($"{rc_exe}.sha1"); + var sha = System.IO.File.ReadAllText(shaPath.FullPath); + var url = $"https://storage.googleapis.com/download/storage/v1/b/chromium-browser-clang/o/rc%2F{sha}?alt=media"; + DownloadFile(url, rcPath); } if (!FileExists(ANGLE_PATH.CombineWithFilePath("third_party/llvm-build/Release+Asserts/cr_build_revision"))) { diff --git a/scripts/cake/shared.cake b/scripts/cake/shared.cake index 8e0e84ac6b..315642431f 100644 --- a/scripts/cake/shared.cake +++ b/scripts/cake/shared.cake @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; using System.Text.RegularExpressions; var TARGET = Argument("t", Argument("target", "Default")); -var VERBOSITY = Argument("v", Argument("verbosity", Verbosity.Normal)); +var VERBOSITY = Context.Log.Verbosity; var CONFIGURATION = Argument("c", Argument("configuration", "Release")); var VS_INSTALL = Argument("vsinstall", EnvironmentVariable("VS_INSTALL")); @@ -28,6 +28,7 @@ void RunCake(FilePath cake, string target = null, Dictionary arg var args = Arguments().ToDictionary(a => a.Key, a => a.Value.LastOrDefault()); args["target"] = target; + args["verbosity"] = VERBOSITY.ToString(); if (arguments != null) { foreach (var arg in arguments) {