From e82b1de8d1395a153d72d8d2442cd861094ce5b6 Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Wed, 9 Apr 2025 13:56:14 +0100 Subject: [PATCH] [cr137] Fix checkout failure for `build_rust_toolchain_aux` There was a failure when running `npm run build_rust_toolchain_aux` in the CI, which wasn't reproducible locally, when fetching the tag. This change fetches the tag straight from `googlesource` and this has worked in the CI jobs. Resolves https://github.com/brave/brave-browser/issues/45323 --- build/commands/scripts/buildRustToolchainAux.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build/commands/scripts/buildRustToolchainAux.js b/build/commands/scripts/buildRustToolchainAux.js index 639dd00e23c..c138669536d 100644 --- a/build/commands/scripts/buildRustToolchainAux.js +++ b/build/commands/scripts/buildRustToolchainAux.js @@ -13,14 +13,13 @@ program .option('--tag ', '(optional) A Chromium tag to be checked out for generating this toolchain.') .action((options) => { if (options.tag) { - tagRef = 'refs/tags/' + options.tag - util.runGit(config.srcDir, ['fetch', 'origin', tagRef + ':' + tagRef]) - util.runGit(config.srcDir, ['reset', '--hard', tagRef]) + util.runGit(config.srcDir, ['fetch', 'https://chromium.googlesource.com/chromium/src', 'tag', options.tag]) + util.runGit(config.srcDir, ['reset', '--hard', options.tag]) // Setting this env variable to prevent downloading the toolchain using // the new tag's revision, as the intent is to generate a new toolchain. process.env.SKIP_DOWNLOAD_RUST_TOOLCHAIN_AUX = '1' - util.runGClient(['sync', '--reset', '--upstream', '--revision', 'src@' + tagRef]) + util.runGClient(['sync', '--reset', '--upstream', '--revision', 'src@refs/tags/' + options.tag]) } args = [path.join(config.srcDir, 'brave', 'build', 'rust', 'build_rust_toolchain_aux.py')] if (options.out_dir) {