Skip to content

Commit 2224be5

Browse files
committed
notifications: log directly for downloaded manifests
1 parent 7f0b2c9 commit 2224be5

File tree

6 files changed

+42
-50
lines changed

6 files changed

+42
-50
lines changed

src/dist/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,10 +1088,10 @@ async fn try_update_from_dist_(
10881088
.await
10891089
{
10901090
Ok(Some((m, hash))) => {
1091-
(download.notify_handler)(Notification::DownloadedManifest(
1092-
&m.date,
1093-
m.get_rust_version().ok(),
1094-
));
1091+
match m.get_rust_version() {
1092+
Ok(version) => info!("latest update on {} for version {version}", m.date),
1093+
Err(_) => info!("latest update on {}", m.date),
1094+
}
10951095

10961096
let profile_components = match profile {
10971097
Some(profile) => m.get_profile_components(profile, &toolchain.target)?,

src/notifications.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub(crate) enum Notification<'a> {
1515
CachedFileChecksumFailed,
1616
/// The URL of the download is passed as the last argument, to allow us to track concurrent downloads.
1717
DownloadingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>, &'a str),
18-
DownloadedManifest(&'a str, Option<&'a str>),
1918
DownloadingLegacyManifest,
2019
SkippingNightlyMissingComponent(&'a ToolchainDesc, &'a Manifest, &'a [Component]),
2120
ForcingUnavailableComponent(&'a str),
@@ -68,8 +67,7 @@ impl Notification<'_> {
6867
FileAlreadyDownloaded | DownloadingLegacyManifest => NotificationLevel::Debug,
6968
DownloadingComponent(_, _, _, _)
7069
| SkippingNightlyMissingComponent(_, _, _)
71-
| RetryingDownload(_)
72-
| DownloadedManifest(_, _) => NotificationLevel::Info,
70+
| RetryingDownload(_) => NotificationLevel::Info,
7371
CachedFileChecksumFailed | ForcingUnavailableComponent(_) | StrayHash(_) => {
7472
NotificationLevel::Warn
7573
}
@@ -115,12 +113,6 @@ impl Display for Notification<'_> {
115113
write!(f, "downloading component '{}' for '{}'", c, t.unwrap())
116114
}
117115
}
118-
DownloadedManifest(date, Some(version)) => {
119-
write!(f, "latest update on {date}, rust version {version}")
120-
}
121-
DownloadedManifest(date, None) => {
122-
write!(f, "latest update on {date}, no rust version")
123-
}
124116
DownloadingLegacyManifest => write!(f, "manifest not found. trying legacy manifest"),
125117
StrayHash(path) => write!(
126118
f,

tests/suite/cli_exact.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ async fn update_once() {
2020
2121
"#]])
2222
.with_stderr(snapbox::str![[r#"
23-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
24-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
23+
info: syncing channel updates for nightly-[HOST_TRIPLE]
24+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
2525
info: downloading component[..]
2626
...
2727
info: default toolchain set to 'nightly-[HOST_TRIPLE]'
@@ -67,8 +67,8 @@ rustup - Update available : [CURRENT_VERSION] -> [TEST_VERSION]
6767
6868
"#]])
6969
.with_stderr(snapbox::str![[r#"
70-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
71-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
70+
info: syncing channel updates for nightly-[HOST_TRIPLE]
71+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
7272
info: downloading component[..]
7373
...
7474
"#]]);
@@ -110,8 +110,8 @@ async fn update_once_and_self_update() {
110110
111111
"#]])
112112
.with_stderr(snapbox::str![[r#"
113-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
114-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
113+
info: syncing channel updates for nightly-[HOST_TRIPLE]
114+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
115115
info: downloading component[..]
116116
...
117117
info: checking for self-update (current version: [CURRENT_VERSION])
@@ -153,7 +153,7 @@ async fn update_again() {
153153
154154
"#]])
155155
.with_stderr(snapbox::str![[r#"
156-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
156+
info: syncing channel updates for nightly-[HOST_TRIPLE]
157157
158158
"#]]);
159159
cx.config
@@ -167,7 +167,7 @@ info: syncing channel updates fpr nightly-[HOST_TRIPLE]
167167
168168
"#]])
169169
.with_stderr(snapbox::str![[r#"
170-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
170+
info: syncing channel updates for nightly-[HOST_TRIPLE]
171171
172172
"#]]);
173173
}
@@ -321,8 +321,8 @@ async fn default() {
321321
322322
"#]])
323323
.with_stderr(snapbox::str![[r#"
324-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
325-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
324+
info: syncing channel updates for nightly-[HOST_TRIPLE]
325+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
326326
info: downloading component[..]
327327
...
328328
info: default toolchain set to 'nightly-[HOST_TRIPLE]'
@@ -584,7 +584,7 @@ async fn update_no_manifest() {
584584
.is_err()
585585
.with_stdout(snapbox::str![[""]])
586586
.with_stderr(snapbox::str![[r#"
587-
info: syncing channel updates fpr nightly-2016-01-01-[HOST_TRIPLE]
587+
info: syncing channel updates for nightly-2016-01-01-[HOST_TRIPLE]
588588
error: no release found for 'nightly-2016-01-01'
589589
590590
"#]]);
@@ -867,10 +867,10 @@ async fn install_unreleased_component() {
867867
868868
"#]])
869869
.with_stderr(snapbox::str![[r#"
870-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
871-
info: latest update on 2019-09-13, rust version 1.37.0 (hash-nightly-2)
870+
info: syncing channel updates for nightly-[HOST_TRIPLE]
871+
info: latest update on 2019-09-13 for version 1.37.0 (hash-nightly-2)
872872
info: skipping nightly which is missing installed component 'rust-std-[MULTI_ARCH_I]'
873-
info: syncing channel updates fpr nightly-2019-09-12-[HOST_TRIPLE]
873+
info: syncing channel updates for nightly-2019-09-12-[HOST_TRIPLE]
874874
875875
"#]]);
876876

@@ -887,13 +887,13 @@ info: syncing channel updates fpr nightly-2019-09-12-[HOST_TRIPLE]
887887
888888
"#]])
889889
.with_stderr(snapbox::str![[r#"
890-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
891-
info: latest update on 2019-09-14, rust version 1.37.0 (hash-nightly-3)
890+
info: syncing channel updates for nightly-[HOST_TRIPLE]
891+
info: latest update on 2019-09-14 for version 1.37.0 (hash-nightly-3)
892892
info: skipping nightly which is missing installed component 'rls'
893-
info: syncing channel updates fpr nightly-2019-09-13-[HOST_TRIPLE]
894-
info: latest update on 2019-09-13, rust version 1.37.0 (hash-nightly-2)
893+
info: syncing channel updates for nightly-2019-09-13-[HOST_TRIPLE]
894+
info: latest update on 2019-09-13 for version 1.37.0 (hash-nightly-2)
895895
info: skipping nightly which is missing installed component 'rust-std-[MULTI_ARCH_I]'
896-
info: syncing channel updates fpr nightly-2019-09-12-[HOST_TRIPLE]
896+
info: syncing channel updates for nightly-2019-09-12-[HOST_TRIPLE]
897897
898898
"#]]);
899899
}

tests/suite/cli_rustup.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async fn rustup_stable() {
3434
"#]])
3535
.with_stderr(snapbox::str![[r#"
3636
info: syncing channel updates for stable-[HOST_TRIPLE]
37-
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
37+
info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0)
3838
info: downloading component[..]
3939
...
4040
info: cleaning up downloads & tmp directories
@@ -130,15 +130,15 @@ async fn rustup_all_channels() {
130130
"#]])
131131
.with_stderr(snapbox::str![[r#"
132132
info: syncing channel updates for stable-[HOST_TRIPLE]
133-
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
133+
info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0)
134134
info: downloading component[..]
135135
...
136136
info: syncing channel updates for beta-[HOST_TRIPLE]
137-
info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0)
137+
info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0)
138138
info: downloading component[..]
139139
...
140140
info: syncing channel updates for nightly-[HOST_TRIPLE]
141-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
141+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
142142
info: downloading component[..]
143143
...
144144
info: cleaning up downloads & tmp directories
@@ -207,12 +207,12 @@ async fn rustup_some_channels_up_to_date() {
207207
"#]])
208208
.with_stderr(snapbox::str![[r#"
209209
info: syncing channel updates for stable-[HOST_TRIPLE]
210-
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
210+
info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0)
211211
info: downloading component[..]
212212
...
213213
info: syncing channel updates for beta-[HOST_TRIPLE]
214214
info: syncing channel updates for nightly-[HOST_TRIPLE]
215-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
215+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
216216
info: downloading component[..]
217217
...
218218
info: cleaning up downloads & tmp directories
@@ -283,7 +283,7 @@ async fn default() {
283283
"#]])
284284
.with_stderr(snapbox::str![[r#"
285285
info: syncing channel updates for nightly-[HOST_TRIPLE]
286-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
286+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
287287
info: downloading component[..]
288288
...
289289
info: default toolchain set to 'nightly-[HOST_TRIPLE]'
@@ -1707,7 +1707,7 @@ channel = "nightly"
17071707
.extend_redactions([("[TOOLCHAIN_FILE]", &toolchain_file)])
17081708
.with_stderr(snapbox::str![[r#"
17091709
info: syncing channel updates for nightly-[HOST_TRIPLE]
1710-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
1710+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
17111711
info: downloading component[..]
17121712
...
17131713
info: the active toolchain `nightly-[HOST_TRIPLE]` has been installed
@@ -3718,7 +3718,7 @@ async fn custom_toolchain_with_components_toolchains_profile_does_not_err() {
37183718
.await
37193719
.with_stderr(snapbox::str![[r#"
37203720
info: syncing channel updates for nightly-[HOST_TRIPLE]
3721-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
3721+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
37223722
info: downloading component[..]
37233723
...
37243724
info: default toolchain set to 'nightly-[HOST_TRIPLE]'

tests/suite/cli_self_upd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ async fn install_bins_to_cargo_home() {
7171
.with_stderr(snapbox::str![[r#"
7272
...
7373
info: syncing channel updates for stable-[HOST_TRIPLE]
74-
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
74+
info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0)
7575
info: downloading component[..]
7676
...
7777
info: default toolchain set to 'stable-[HOST_TRIPLE]'
@@ -116,7 +116,7 @@ async fn proxies_are_relative_symlinks() {
116116
.with_stderr(snapbox::str![[r#"
117117
...
118118
info: syncing channel updates for stable-[HOST_TRIPLE]
119-
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
119+
info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0)
120120
info: downloading component[..]
121121
...
122122
info: default toolchain set to 'stable-[HOST_TRIPLE]'

tests/suite/cli_v2.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ async fn remove_override_toolchain_err_handling() {
485485
486486
"#]])
487487
.with_stderr(snapbox::str![[r#"
488-
info: syncing channel updates fpr beta-[HOST_TRIPLE]
489-
info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0)
488+
info: syncing channel updates for beta-[HOST_TRIPLE]
489+
info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0)
490490
info: downloading component[..]
491491
...
492492
"#]])
@@ -518,8 +518,8 @@ async fn file_override_toolchain_err_handling() {
518518
519519
"#]])
520520
.with_stderr(snapbox::str![[r#"
521-
info: syncing channel updates fpr beta-[HOST_TRIPLE]
522-
info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0)
521+
info: syncing channel updates for beta-[HOST_TRIPLE]
522+
info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0)
523523
info: downloading component[..]
524524
...
525525
"#]])
@@ -1972,7 +1972,7 @@ async fn add_missing_component() {
19721972
.with_stderr(snapbox::str![[r#"
19731973
...
19741974
error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly'
1975-
Sometimes not all components are available in any given nightly.
1975+
Sometimes not all components are available in any given nightly.
19761976
...
19771977
"#]])
19781978
.is_err();
@@ -2458,8 +2458,8 @@ async fn run_with_install_flag_against_unavailable_component() {
24582458
24592459
"#]])
24602460
.with_stderr(snapbox::str![[r#"
2461-
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
2462-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
2461+
info: syncing channel updates for nightly-[HOST_TRIPLE]
2462+
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
24632463
warn: Force-skipping unavailable component 'rust-std-[HOST_TRIPLE]'
24642464
info: downloading component[..]
24652465
...

0 commit comments

Comments
 (0)