Skip to content

Commit d34c9a8

Browse files
committed
bootstrap: update time 0.1 -> 0.3 to mitigate RUSTSEC-2020-0071
pretty_assertions 0.6 -> 0.7 to drop ansi_term 0.11 dependency update serde_json to dedupe itoa duplicate (from time update)
1 parent 71226d7 commit d34c9a8

File tree

3 files changed

+42
-30
lines changed

3 files changed

+42
-30
lines changed

Cargo.lock

+34-23
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,6 @@ dependencies = [
7878
"yansi-term",
7979
]
8080

81-
[[package]]
82-
name = "ansi_term"
83-
version = "0.11.0"
84-
source = "registry+https://github.com/rust-lang/crates.io-index"
85-
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
86-
dependencies = [
87-
"winapi",
88-
]
89-
9081
[[package]]
9182
name = "ansi_term"
9283
version = "0.12.1"
@@ -236,7 +227,7 @@ dependencies = [
236227
"pretty_assertions",
237228
"serde",
238229
"serde_json",
239-
"time",
230+
"time 0.3.7",
240231
"toml",
241232
"winapi",
242233
]
@@ -605,7 +596,7 @@ dependencies = [
605596
"libc",
606597
"num-integer",
607598
"num-traits",
608-
"time",
599+
"time 0.1.43",
609600
"winapi",
610601
]
611602

@@ -615,7 +606,7 @@ version = "2.34.0"
615606
source = "registry+https://github.com/rust-lang/crates.io-index"
616607
checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
617608
dependencies = [
618-
"ansi_term 0.12.1",
609+
"ansi_term",
619610
"atty",
620611
"bitflags",
621612
"strsim 0.8.0",
@@ -1814,9 +1805,9 @@ dependencies = [
18141805

18151806
[[package]]
18161807
name = "itoa"
1817-
version = "0.4.6"
1808+
version = "1.0.1"
18181809
source = "registry+https://github.com/rust-lang/crates.io-index"
1819-
checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
1810+
checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
18201811

18211812
[[package]]
18221813
name = "jobserver"
@@ -2419,6 +2410,15 @@ dependencies = [
24192410
"libc",
24202411
]
24212412

2413+
[[package]]
2414+
name = "num_threads"
2415+
version = "0.1.3"
2416+
source = "registry+https://github.com/rust-lang/crates.io-index"
2417+
checksum = "97ba99ba6393e2c3734791401b66902d981cb03bf190af674ca69949b6d5fb15"
2418+
dependencies = [
2419+
"libc",
2420+
]
2421+
24222422
[[package]]
24232423
name = "object"
24242424
version = "0.26.2"
@@ -2792,13 +2792,13 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
27922792

27932793
[[package]]
27942794
name = "pretty_assertions"
2795-
version = "0.6.1"
2795+
version = "0.7.2"
27962796
source = "registry+https://github.com/rust-lang/crates.io-index"
2797-
checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427"
2797+
checksum = "1cab0e7c02cf376875e9335e0ba1da535775beb5450d21e1dffca068818ed98b"
27982798
dependencies = [
2799-
"ansi_term 0.11.0",
2799+
"ansi_term",
28002800
"ctor",
2801-
"difference",
2801+
"diff",
28022802
"output_vt100",
28032803
]
28042804

@@ -4677,9 +4677,9 @@ dependencies = [
46774677

46784678
[[package]]
46794679
name = "serde_json"
4680-
version = "1.0.59"
4680+
version = "1.0.78"
46814681
source = "registry+https://github.com/rust-lang/crates.io-index"
4682-
checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95"
4682+
checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085"
46834683
dependencies = [
46844684
"indexmap",
46854685
"itoa",
@@ -5172,6 +5172,17 @@ dependencies = [
51725172
"winapi",
51735173
]
51745174

5175+
[[package]]
5176+
name = "time"
5177+
version = "0.3.7"
5178+
source = "registry+https://github.com/rust-lang/crates.io-index"
5179+
checksum = "004cbc98f30fa233c61a38bc77e96a9106e65c88f2d3bef182ae952027e5753d"
5180+
dependencies = [
5181+
"itoa",
5182+
"libc",
5183+
"num_threads",
5184+
]
5185+
51755186
[[package]]
51765187
name = "tinyvec"
51775188
version = "0.3.4"
@@ -5304,7 +5315,7 @@ version = "0.3.3"
53045315
source = "registry+https://github.com/rust-lang/crates.io-index"
53055316
checksum = "245da694cc7fc4729f3f418b304cb57789f1bed2a78c575407ab8a23f53cb4d3"
53065317
dependencies = [
5307-
"ansi_term 0.12.1",
5318+
"ansi_term",
53085319
"lazy_static",
53095320
"matchers",
53105321
"parking_lot",
@@ -5323,7 +5334,7 @@ version = "0.2.0"
53235334
source = "registry+https://github.com/rust-lang/crates.io-index"
53245335
checksum = "3ce989c9962c7f61fe084dd4a230eec784649dfc2392467c790007c3a6e134e7"
53255336
dependencies = [
5326-
"ansi_term 0.12.1",
5337+
"ansi_term",
53275338
"atty",
53285339
"tracing-core",
53295340
"tracing-log",
@@ -5661,7 +5672,7 @@ dependencies = [
56615672
"log",
56625673
"mac",
56635674
"markup5ever",
5664-
"time",
5675+
"time 0.1.43",
56655676
]
56665677

56675678
[[package]]

src/bootstrap/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ libc = "0.2"
4444
serde = { version = "1.0.8", features = ["derive"] }
4545
serde_json = "1.0.2"
4646
toml = "0.5"
47-
time = "0.1"
47+
time = { version = "0.3.7", default-features = false, features = ["std", "formatting", "local-offset"] }
4848
ignore = "0.4.10"
4949
opener = "0.5"
5050
once_cell = "1.7.2"
5151

5252
[target.'cfg(windows)'.dependencies.winapi]
5353
version = "0.3"
54-
features = ["fileapi", "ioapiset", "jobapi2", "handleapi", "winioctl", "psapi", "impl-default"]
54+
features = ["fileapi", "ioapiset", "jobapi2", "handleapi", "winioctl", "psapi", "impl-default", "timezoneapi"]
5555

5656
[dev-dependencies]
57-
pretty_assertions = "0.6"
57+
pretty_assertions = "0.7"

src/bootstrap/dist.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::tarball::{GeneratedTarball, OverlayKind, Tarball};
2424
use crate::tool::{self, Tool};
2525
use crate::util::{exe, is_dylib, timeit};
2626
use crate::{Compiler, DependencyType, Mode, LLVM_TOOLS};
27-
use time::{self, Timespec};
27+
use time::{format_description, OffsetDateTime};
2828

2929
pub fn pkgname(builder: &Builder<'_>, component: &str) -> String {
3030
format!("{}-{}", component, builder.rust_package_vers())
@@ -430,11 +430,12 @@ impl Step for Rustc {
430430
.map_err(|err| format!("could not parse SOURCE_DATE_EPOCH: {}", err))
431431
.unwrap();
432432

433-
time::at(Timespec::new(epoch, 0))
433+
OffsetDateTime::from_unix_timestamp(epoch).unwrap()
434434
})
435-
.unwrap_or_else(|_| time::now());
435+
.unwrap_or_else(|_| OffsetDateTime::now_local().unwrap());
436436

437-
let month_year = t!(time::strftime("%B %Y", &time));
437+
let format = t!(format_description::parse("[month repr:long] [year]"));
438+
let month_year = t!(time.format(&format));
438439
// don't use our `bootstrap::util::{copy, cp_r}`, because those try
439440
// to hardlink, and we don't want to edit the source templates
440441
for file_entry in builder.read_dir(&man_src) {

0 commit comments

Comments
 (0)