[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
This commit is contained in:
Claudio DeSouza
2025-05-13 15:52:51 -04:00
committed by Max Karolinskiy
parent 8f22e635de
commit e82b1de8d1
@@ -13,14 +13,13 @@ program
.option('--tag <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) {