Skip to content

Commit 4e3e95a

Browse files
danakjAravind Vasudevan
authored andcommitted
Compress the Rust toolchain with xz instead of gzip
Bug: 1439640 Change-Id: I250dd11c73aa2d1add84b6bea7add74f66447e20 Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,win-rust-x64-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4496406 Reviewed-by: Hans Wennborg <hans@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/main@{#1138304} NOKEYCHECK=True GitOrigin-RevId: a6930d4fb75f6d047dc9ed474c8782961846c81c
1 parent adf67d8 commit 4e3e95a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

package_rust.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# found in the LICENSE file.
55

66
import argparse
7+
import lzma
78
import os
89
import platform
910
import shutil
@@ -21,7 +22,7 @@
2122

2223
PACKAGE_VERSION = GetLatestRevision()
2324
BUILDLOG_NAME = f'rust-buildlog-{PACKAGE_VERSION}.txt'
24-
RUST_TOOLCHAIN_PACKAGE_NAME = f'rust-toolchain-{PACKAGE_VERSION}.tgz'
25+
RUST_TOOLCHAIN_PACKAGE_NAME = f'rust-toolchain-{PACKAGE_VERSION}.tar.xz'
2526

2627

2728
def BuildCrubit(build_mac_arm):
@@ -90,9 +91,10 @@ def main():
9091

9192
BuildCrubit(args.build_mac_arm)
9293

93-
with tarfile.open(
94-
os.path.join(THIRD_PARTY_DIR, RUST_TOOLCHAIN_PACKAGE_NAME),
95-
'w:gz') as tar:
94+
with tarfile.open(os.path.join(THIRD_PARTY_DIR,
95+
RUST_TOOLCHAIN_PACKAGE_NAME),
96+
'w:xz',
97+
preset=9 | lzma.PRESET_EXTREME) as tar:
9698
tar.add(RUST_TOOLCHAIN_OUT_DIR, arcname='rust-toolchain')
9799

98100
os.chdir(THIRD_PARTY_DIR)

update_rust.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# These fields are written by //tools/clang/scripts/upload_revision.py, and
3434
# should not be changed manually.
3535
RUST_REVISION = '17c11672167827b0dd92c88ef69f24346d1286dd'
36-
RUST_SUB_REVISION = 1
36+
RUST_SUB_REVISION = 2
3737

3838
# Trunk on 2022-10-15.
3939
#
@@ -65,7 +65,7 @@
6565
# TODO(lukasza): Include CRUBIT_REVISION and CRUBIT_SUB_REVISION once we
6666
# include Crubit binaries in the generated package. See also a TODO comment
6767
# in BuildCrubit in package_rust.py.
68-
FALLBACK_REVISION = '17c11672167827b0dd92c88ef69f24346d1286dd-1-llvmorg-17-init-8029-g27f27d15-1'
68+
FALLBACK_REVISION = '17c11672167827b0dd92c88ef69f24346d1286dd-2-llvmorg-17-init-8029-g27f27d15-4'
6969

7070
# Hash of src/stage0.json, which itself contains the stage0 toolchain hashes.
7171
# We trust the Rust build system checks, but to ensure it is not tampered with
@@ -170,11 +170,11 @@ def main():
170170
platform_prefix = GetPlatformUrlPrefix(GetDefaultHostOs())
171171

172172
version = GetLatestRevision()
173-
url = f'{platform_prefix}rust-toolchain-{version}.tgz'
173+
url = f'{platform_prefix}rust-toolchain-{version}.tar.xz'
174174
if not CheckUrl(url):
175175
print("Latest Rust toolchain not found. Using fallback revision.")
176176
version = FALLBACK_REVISION
177-
url = f'{platform_prefix}rust-toolchain-{version}.tgz'
177+
url = f'{platform_prefix}rust-toolchain-{version}.tar.xz'
178178
if not CheckUrl(url):
179179
print('error: Could not find Rust toolchain package')
180180
return 1

0 commit comments

Comments
 (0)