From beb4e28490c527d53ad2ee3a771c2d9589a91127 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Wed, 18 Nov 2026 12:38:47 +0100 Subject: [PATCH] migrate from chrono to time --- Cargo.lock | 39 +---------------------------------- Cargo.toml | 2 +- crates/xtask/Cargo.toml | 2 +- crates/xtask/src/toolchain.rs | 9 ++++---- 4 files changed, 7 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6b1f3d3347..47abcf78f5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -650,19 +650,6 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "chrono" -version = "0.4.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-link", -] - [[package]] name = "clap" version = "4.6.7" @@ -3215,30 +3202,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "iana-time-zone" -version = "0.1.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "icu_collections" version = "2.4.0" @@ -7873,12 +7836,12 @@ name = "xtask" version = "0.1.0" dependencies = [ "anyhow", - "chrono", "clap", "env_logger", "log", "regex-lite", "tempfile", + "time", "toml 0.9.12+spec-1.1.0", ] diff --git a/Cargo.toml b/Cargo.toml index 18a30ac809a..c044ebf1c32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,7 +88,7 @@ regex-lite = "0.1.9" spirv = { version = "0.4.0", features = ["serialize", "deserialize"] } rspirv = "0.13.0" rspirv2 = { version = "0.1.0", features = ["bytemuck"] } -chrono = "0.4.45" +time = "0.3.55" # difftest libraries mirrored from difftest workspace difftest = { path = "tests/difftests/tests/lib" } diff --git a/crates/xtask/Cargo.toml b/crates/xtask/Cargo.toml index f6cb5711ee1..e1282179cca 100644 --- a/crates/xtask/Cargo.toml +++ b/crates/xtask/Cargo.toml @@ -14,7 +14,7 @@ log.workspace = true tempfile.workspace = true toml.workspace = true regex-lite.workspace = true -chrono.workspace = true +time.workspace = true [lints] workspace = true diff --git a/crates/xtask/src/toolchain.rs b/crates/xtask/src/toolchain.rs index c0be85843c4..1d1f112ba1d 100644 --- a/crates/xtask/src/toolchain.rs +++ b/crates/xtask/src/toolchain.rs @@ -1,5 +1,4 @@ use anyhow::Context; -use chrono::{Datelike, Utc}; use std::env; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; @@ -18,12 +17,12 @@ impl SetToolchain { // figure out version and commit-hash let version = self.version.as_ref().map_or_else( || { - let time = Utc::now(); + let utc = time::OffsetDateTime::now_utc(); format!( "nightly-{:04}-{:02}-{:02}", - time.year(), - time.month(), - time.day() + utc.year(), + u8::from(utc.month()), + utc.day() ) }, |version| {