diff --git a/Cargo.lock b/Cargo.lock index 208ce841759b9..2b7e3255c1af2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,15 +78,6 @@ dependencies = [ "yansi-term", ] -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - [[package]] name = "ansi_term" version = "0.12.1" @@ -236,7 +227,7 @@ dependencies = [ "pretty_assertions", "serde", "serde_json", - "time", + "time 0.3.7", "toml", "winapi", ] @@ -605,7 +596,7 @@ dependencies = [ "libc", "num-integer", "num-traits", - "time", + "time 0.1.43", "winapi", ] @@ -615,7 +606,7 @@ version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "atty", "bitflags", "strsim 0.8.0", @@ -1814,9 +1805,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "jobserver" @@ -2419,6 +2410,15 @@ dependencies = [ "libc", ] +[[package]] +name = "num_threads" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ba99ba6393e2c3734791401b66902d981cb03bf190af674ca69949b6d5fb15" +dependencies = [ + "libc", +] + [[package]] name = "object" version = "0.26.2" @@ -2792,13 +2792,13 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "pretty_assertions" -version = "0.6.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" +checksum = "1cab0e7c02cf376875e9335e0ba1da535775beb5450d21e1dffca068818ed98b" dependencies = [ - "ansi_term 0.11.0", + "ansi_term", "ctor", - "difference", + "diff", "output_vt100", ] @@ -4677,9 +4677,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.59" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" dependencies = [ "indexmap", "itoa", @@ -5172,6 +5172,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "time" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "004cbc98f30fa233c61a38bc77e96a9106e65c88f2d3bef182ae952027e5753d" +dependencies = [ + "itoa", + "libc", + "num_threads", +] + [[package]] name = "tinyvec" version = "0.3.4" @@ -5304,7 +5315,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245da694cc7fc4729f3f418b304cb57789f1bed2a78c575407ab8a23f53cb4d3" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "lazy_static", "matchers", "parking_lot", @@ -5323,7 +5334,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ce989c9962c7f61fe084dd4a230eec784649dfc2392467c790007c3a6e134e7" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "atty", "tracing-core", "tracing-log", @@ -5661,7 +5672,7 @@ dependencies = [ "log", "mac", "markup5ever", - "time", + "time 0.1.43", ] [[package]] diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index b68b2163f873a..b876647842e6c 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -44,14 +44,14 @@ libc = "0.2" serde = { version = "1.0.8", features = ["derive"] } serde_json = "1.0.2" toml = "0.5" -time = "0.1" +time = { version = "0.3.7", default-features = false, features = ["std", "formatting", "local-offset"] } ignore = "0.4.10" opener = "0.5" once_cell = "1.7.2" [target.'cfg(windows)'.dependencies.winapi] version = "0.3" -features = ["fileapi", "ioapiset", "jobapi2", "handleapi", "winioctl", "psapi", "impl-default"] +features = ["fileapi", "ioapiset", "jobapi2", "handleapi", "winioctl", "psapi", "impl-default", "timezoneapi"] [dev-dependencies] -pretty_assertions = "0.6" +pretty_assertions = "0.7" diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 66b63cd1278c5..22de5b3bc3f1c 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -24,7 +24,7 @@ use crate::tarball::{GeneratedTarball, OverlayKind, Tarball}; use crate::tool::{self, Tool}; use crate::util::{exe, is_dylib, timeit}; use crate::{Compiler, DependencyType, Mode, LLVM_TOOLS}; -use time::{self, Timespec}; +use time::{format_description, OffsetDateTime}; pub fn pkgname(builder: &Builder<'_>, component: &str) -> String { format!("{}-{}", component, builder.rust_package_vers()) @@ -430,11 +430,12 @@ impl Step for Rustc { .map_err(|err| format!("could not parse SOURCE_DATE_EPOCH: {}", err)) .unwrap(); - time::at(Timespec::new(epoch, 0)) + OffsetDateTime::from_unix_timestamp(epoch).unwrap() }) - .unwrap_or_else(|_| time::now()); + .unwrap_or_else(|_| OffsetDateTime::now_local().unwrap()); - let month_year = t!(time::strftime("%B %Y", &time)); + let format = t!(format_description::parse("[month repr:long] [year]")); + let month_year = t!(time.format(&format)); // don't use our `bootstrap::util::{copy, cp_r}`, because those try // to hardlink, and we don't want to edit the source templates for file_entry in builder.read_dir(&man_src) {