Skip to content

Commit eb8f9c2

Browse files
zmodemcopybara-github
authored andcommitted
Roll clang+rust [skipping Clang] / 595316b4006932405a63862d8fe65f71a6356293-5 : 009e73825af0e59ad4fc603562e038b3dbd6593a-2
https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/595316b40069..009e73825af0 Ran: ./tools/clang/scripts/upload_revision.py 96a5aabbd6adada4525d5e0107e96e6f57dbdfbf --skip-clang and tools/rust/gnrt_stdlib.py and tools/clang/scripts/sync_deps.py and adjustments to the gnrt workflow for the rust standard library having moved in rust-lang/rust@1f3be75 and for the compiler_builtins weakness change (crbug.com/357125724). Bug: 357660350, 358201188, 357125724 Change-Id: I83764a0926b23f02fcd652d067a1ed2e604b5ddd Disable-Rts: True Cq-Include-Trybots: chromium/try:android-rust-arm32-rel Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg Cq-Include-Trybots: chromium/try:android-rust-arm64-rel Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg Cq-Include-Trybots: chromium/try:linux-rust-x64-rel Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5837063 Commit-Queue: Nico Weber <[email protected]> Reviewed-by: Nico Weber <[email protected]> Reviewed-by: danakj <[email protected]> Commit-Queue: Hans Wennborg <[email protected]> Cr-Commit-Position: refs/heads/main@{#1352184} NOKEYCHECK=True GitOrigin-RevId: 1396d0fd4edcb99e2434ec4dd00ded4f60e9beb9
1 parent 24da716 commit eb8f9c2

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

build_rust.py

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,10 @@
115115
RUST_TOOLCHAIN_LIB_DIR = os.path.join(RUST_TOOLCHAIN_OUT_DIR, 'lib')
116116
RUST_TOOLCHAIN_SRC_DIST_DIR = os.path.join(RUST_TOOLCHAIN_LIB_DIR, 'rustlib',
117117
'src', 'rust')
118-
RUST_TOOLCHAIN_SRC_DIST_VENDOR_DIR = os.path.join(RUST_TOOLCHAIN_SRC_DIST_DIR,
119-
'vendor')
120118
RUST_CONFIG_TEMPLATE_PATH = os.path.join(
121119
os.path.dirname(os.path.abspath(__file__)), 'config.toml.template')
122120
RUST_CARGO_CONFIG_TEMPLATE_PATH = os.path.join(
123121
os.path.dirname(os.path.abspath(__file__)), 'cargo-config.toml.template')
124-
RUST_SRC_VENDOR_DIR = os.path.join(RUST_SRC_DIR, 'vendor')
125122

126123
RUST_HOST_LLVM_BUILD_DIR = os.path.join(CHROMIUM_DIR, 'third_party',
127124
'rust-toolchain-intermediate',
@@ -256,8 +253,8 @@ def InstallBetaPackage(package_dir, install_dir):
256253
RunCommand([os.path.join(package_dir, 'install.sh')] + args)
257254

258255

259-
def CargoVendor(cargo_bin):
260-
'''Runs `cargo vendor` to pull down dependencies.'''
256+
def VendorForStdlib(cargo_bin):
257+
'''Runs `cargo vendor` to pull down standard library dependencies.'''
261258
os.chdir(RUST_SRC_DIR)
262259

263260
vendor_env = os.environ
@@ -268,10 +265,8 @@ def CargoVendor(cargo_bin):
268265
vendor_env['RUSTC_BOOTSTRAP'] = '1'
269266

270267
vendor_cmd = [
271-
cargo_bin,
272-
'vendor',
273-
'--locked',
274-
'--versioned-dirs',
268+
cargo_bin, 'vendor', '--manifest-path', 'library/Cargo.toml',
269+
'--locked', '--versioned-dirs', 'library/vendor'
275270
]
276271
RunWithRetry(vendor_cmd, 'cargo vendor')
277272

@@ -628,6 +623,24 @@ def GitApplyCherryPicks():
628623
# with `GitMoveSubmoduleBranch()`.
629624
#############################
630625

626+
# TODO Remove once LLVM rolls past llvmorg-20-init-3909-ge61d6066e267
627+
RunCommand([
628+
'git',
629+
'-C',
630+
RUST_SRC_DIR,
631+
'revert',
632+
'--no-edit',
633+
'-m',
634+
'1',
635+
'8c7a7e346be4cdf13e77ab4acbfb5ade819a4e60',
636+
])
637+
638+
# TODO(b/363219692): Remove once
639+
# https://github.com/rust-lang/rust/pull/129894 or a similar fix has been
640+
# merged.
641+
GitCherryPick(RUST_SRC_DIR, 'https://github.com/rust-lang/rust.git',
642+
'f20103f9f3e35dad241dd81cd3ae9eb2dafb3f44')
643+
631644
print('Finished applying cherry-picks.')
632645

633646

@@ -784,7 +797,7 @@ def main():
784797
if l.strip('\n') != 'debug = 0':
785798
f.write(l)
786799

787-
CargoVendor(cargo_bin)
800+
VendorForStdlib(cargo_bin)
788801

789802
# Gnrt needs the checkout to be up-to-date, workspace submodules to be
790803
# synced for cargo to work, and the cargo binary itself. All this is done,
@@ -841,9 +854,10 @@ def main():
841854

842855
xpy.run('install', [])
843856

844-
# Copy additional vendored crates required for building stdlib.
845-
print(f'Copying vendored dependencies to {RUST_TOOLCHAIN_OUT_DIR} ...')
846-
shutil.copytree(RUST_SRC_VENDOR_DIR, RUST_TOOLCHAIN_SRC_DIST_VENDOR_DIR)
857+
# The Rust stdlib deps are vendored to rust-src/library/vendor, and later
858+
# the x.py install process copies all subdirs of rust-src/library to the
859+
# toolchain package, so we do not need to explicitly copy the vendor dir.
860+
# This is left as a note in case that behavior changes.
847861

848862
with open(VERSION_SRC_PATH, 'w') as stamp:
849863
stamp.write(MakeVersionStamp(checkout_revision))

update_rust.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
# In the case that a Rust roll fails and you want to roll Clang alone, reset
3636
# this back to its previous value _AND_ set `OVERRIDE_CLANG_REVISION` below
3737
# to the `CLANG_REVISION` that was in place before the roll.
38-
RUST_REVISION = '595316b4006932405a63862d8fe65f71a6356293'
39-
RUST_SUB_REVISION = 5
38+
RUST_REVISION = '009e73825af0e59ad4fc603562e038b3dbd6593a'
39+
RUST_SUB_REVISION = 2
4040

4141
# If not None, this overrides the `CLANG_REVISION` in
4242
# //tools/clang/scripts/update.py in order to download a Rust toolchain that
@@ -57,7 +57,7 @@
5757
# Hash of src/stage0.json, which itself contains the stage0 toolchain hashes.
5858
# We trust the Rust build system checks, but to ensure it is not tampered with
5959
# itself check the hash.
60-
STAGE0_JSON_SHA256 = '01d041997206abf7da640361381d10134b2f6e3f0ca65fce7172a07387e01730'
60+
STAGE0_JSON_SHA256 = 'ed1bd5afab062116c6926ed9d3bbaa3ecdc037ff983f9dc34dbecece10ef91e0'
6161

6262
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
6363
CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..'))

0 commit comments

Comments
 (0)