Skip to content

Commit c636f50

Browse files
zmodemAravind Vasudevan
authored andcommitted
Make stand-alone 'update_rust.py ----print-rust-revision' work again
The script which copies binaries to production uses that to get the rust version, and it runs the script without any other files around. (Follow-up to crrev.com/1120216) Bug: 1386212 Change-Id: I389ae753a725443cd04a773b0625ddc3a8fdf3f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4376769 Reviewed-by: danakj <[email protected]> Auto-Submit: Hans Wennborg <[email protected]> Commit-Queue: danakj <[email protected]> Cr-Commit-Position: refs/heads/main@{#1123178} NOKEYCHECK=True GitOrigin-RevId: 1ce628cc307903e2c1069b41f6e0eebce1fc60b3
1 parent c47e5ef commit c636f50

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

update_rust.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323

2424
# Add Clang scripts to path so we can import them later (if running within a
2525
# Chromium checkout.)
26+
# Note: Imports cannot be done until after the --print-rust-revision flag
27+
# has been processed, since that needs to work when running this script
28+
# in isolation.
2629
sys.path.append(
2730
os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'clang',
2831
'scripts'))
2932

30-
from update import (CHROMIUM_DIR)
31-
3233
# These fields are written by //tools/clang/scripts/upload_revision.py, and
3334
# should not be changed manually.
3435
RUST_REVISION = 'ac4379fea9e83465d814bb05005689f49bd2141e'
@@ -72,6 +73,7 @@
7273
STAGE0_JSON_SHA256 = 'b45d1f388bfe54887d5776937e05a135ec819b6d2190b8794bb87bd7072e5553'
7374

7475
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
76+
CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..'))
7577
THIRD_PARTY_DIR = os.path.join(CHROMIUM_DIR, 'third_party')
7678
RUST_TOOLCHAIN_OUT_DIR = os.path.join(THIRD_PARTY_DIR, 'rust-toolchain')
7779
VERSION_STAMP_PATH = os.path.join(RUST_TOOLCHAIN_OUT_DIR, 'VERSION')

0 commit comments

Comments
 (0)