aboutsummaryrefslogtreecommitdiff
path: root/pgo_tools_rust
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2023-04-13 12:48:46 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-18 18:02:56 +0000
commitb38642cc1b7fcc1017a5775788aa867fd409b12b (patch)
tree7a225478c297ea9364136cca6dc3a5d2c67f332a /pgo_tools_rust
parent50afc9427c1d945cb0417996895cca3d61d26532 (diff)
downloadtoolchain-utils-b38642cc1b7fcc1017a5775788aa867fd409b12b.tar.gz
pgo_rust: tweak tar invocation
- `v` prints over 6,000 lines explaining what was unpacked, which isn't super useful, since all of the output of this command is buffered. - we can combine the `xz -d` and `tar` invocations for a simpler, slightly faster unpack that also doesn't leave a tar file in your tempdir This also adds `encoding = "utf-8"` to appease `cros lint`. BUG=b:215615637 TEST=./pgo_rust.py generate Change-Id: Id9bc655afbb11be9943265494e243c3175af1a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4422324 Reviewed-by: Bob Haarman <inglorion@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'pgo_tools_rust')
-rwxr-xr-xpgo_tools_rust/pgo_rust.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py
index 3b56cd77..10042f14 100755
--- a/pgo_tools_rust/pgo_rust.py
+++ b/pgo_tools_rust/pgo_rust.py
@@ -215,8 +215,7 @@ def download_unpack_crate(*, crate_name: str, crate_version: str):
)
with chdir(local_path):
run(["gsutil", "cp", f"gs:/{gs_path}", "."])
- run(["xz", "-d", f"{filename_no_extension}.tar.xz"])
- run(["tar", "xvf", f"{filename_no_extension}.tar"])
+ run(["tar", "xaf", f"{filename_no_extension}.tar.xz"])
def build_crate(
@@ -229,7 +228,7 @@ def build_crate(
local_path = LOCAL_BASE / "crates" / f"{crate_name}-{crate_version}"
with chdir(local_path):
Path(".cargo").mkdir(exist_ok=True)
- with open(".cargo/config.toml", "w") as f:
+ with open(".cargo/config.toml", "w", encoding="utf-8") as f:
f.write(
"\n".join(
(