Skip to content

Commit 7f0b2c9

Browse files
committed
notifications: log directly for manifest downloads
1 parent 52831ba commit 7f0b2c9

File tree

7 files changed

+33
-36
lines changed

7 files changed

+33
-36
lines changed

src/dist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ async fn try_update_from_dist_(
10721072
let manifestation = Manifestation::open(prefix.clone(), toolchain.target.clone())?;
10731073

10741074
// TODO: Add a notification about which manifest version is going to be used
1075-
(download.notify_handler)(Notification::DownloadingManifest(&toolchain_str));
1075+
info!("syncing channel updates for {toolchain_str}");
10761076
match dl_v2_manifest(
10771077
download,
10781078
// Even if manifest has not changed, we must continue to install requested components.

src/notifications.rs

Lines changed: 0 additions & 3 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-
DownloadingManifest(&'a str),
1918
DownloadedManifest(&'a str, Option<&'a str>),
2019
DownloadingLegacyManifest,
2120
SkippingNightlyMissingComponent(&'a ToolchainDesc, &'a Manifest, &'a [Component]),
@@ -68,7 +67,6 @@ impl Notification<'_> {
6867
match self {
6968
FileAlreadyDownloaded | DownloadingLegacyManifest => NotificationLevel::Debug,
7069
DownloadingComponent(_, _, _, _)
71-
| DownloadingManifest(_)
7270
| SkippingNightlyMissingComponent(_, _, _)
7371
| RetryingDownload(_)
7472
| DownloadedManifest(_, _) => NotificationLevel::Info,
@@ -117,7 +115,6 @@ impl Display for Notification<'_> {
117115
write!(f, "downloading component '{}' for '{}'", c, t.unwrap())
118116
}
119117
}
120-
DownloadingManifest(t) => write!(f, "syncing channel updates for '{t}'"),
121118
DownloadedManifest(date, Some(version)) => {
122119
write!(f, "latest update on {date}, rust version {version}")
123120
}

tests/suite/cli_exact.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async fn update_once() {
2020
2121
"#]])
2222
.with_stderr(snapbox::str![[r#"
23-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
23+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
2424
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
2525
info: downloading component[..]
2626
...
@@ -67,7 +67,7 @@ rustup - Update available : [CURRENT_VERSION] -> [TEST_VERSION]
6767
6868
"#]])
6969
.with_stderr(snapbox::str![[r#"
70-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
70+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
7171
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
7272
info: downloading component[..]
7373
...
@@ -110,7 +110,7 @@ async fn update_once_and_self_update() {
110110
111111
"#]])
112112
.with_stderr(snapbox::str![[r#"
113-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
113+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
114114
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
115115
info: downloading component[..]
116116
...
@@ -153,7 +153,7 @@ async fn update_again() {
153153
154154
"#]])
155155
.with_stderr(snapbox::str![[r#"
156-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
156+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
157157
158158
"#]]);
159159
cx.config
@@ -167,7 +167,7 @@ info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
167167
168168
"#]])
169169
.with_stderr(snapbox::str![[r#"
170-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
170+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
171171
172172
"#]]);
173173
}
@@ -321,7 +321,7 @@ async fn default() {
321321
322322
"#]])
323323
.with_stderr(snapbox::str![[r#"
324-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
324+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
325325
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
326326
info: downloading component[..]
327327
...
@@ -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 for 'nightly-2016-01-01-[HOST_TRIPLE]'
587+
info: syncing channel updates fpr 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 for 'nightly-[HOST_TRIPLE]'
870+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
871871
info: latest update on 2019-09-13, rust 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 for 'nightly-2019-09-12-[HOST_TRIPLE]'
873+
info: syncing channel updates fpr nightly-2019-09-12-[HOST_TRIPLE]
874874
875875
"#]]);
876876

@@ -887,13 +887,13 @@ info: syncing channel updates for 'nightly-2019-09-12-[HOST_TRIPLE]'
887887
888888
"#]])
889889
.with_stderr(snapbox::str![[r#"
890-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
890+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
891891
info: latest update on 2019-09-14, rust version 1.37.0 (hash-nightly-3)
892892
info: skipping nightly which is missing installed component 'rls'
893-
info: syncing channel updates for 'nightly-2019-09-13-[HOST_TRIPLE]'
893+
info: syncing channel updates fpr nightly-2019-09-13-[HOST_TRIPLE]
894894
info: latest update on 2019-09-13, rust 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 for 'nightly-2019-09-12-[HOST_TRIPLE]'
896+
info: syncing channel updates fpr nightly-2019-09-12-[HOST_TRIPLE]
897897
898898
"#]]);
899899
}

tests/suite/cli_rustup.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async fn rustup_stable() {
3333
3434
"#]])
3535
.with_stderr(snapbox::str![[r#"
36-
info: syncing channel updates for 'stable-[HOST_TRIPLE]'
36+
info: syncing channel updates for stable-[HOST_TRIPLE]
3737
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
3838
info: downloading component[..]
3939
...
@@ -97,7 +97,7 @@ async fn rustup_stable_no_change() {
9797
9898
"#]])
9999
.with_stderr(snapbox::str![[r#"
100-
info: syncing channel updates for 'stable-[HOST_TRIPLE]'
100+
info: syncing channel updates for stable-[HOST_TRIPLE]
101101
info: cleaning up downloads & tmp directories
102102
103103
"#]])
@@ -129,15 +129,15 @@ async fn rustup_all_channels() {
129129
130130
"#]])
131131
.with_stderr(snapbox::str![[r#"
132-
info: syncing channel updates for 'stable-[HOST_TRIPLE]'
132+
info: syncing channel updates for stable-[HOST_TRIPLE]
133133
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
134134
info: downloading component[..]
135135
...
136-
info: syncing channel updates for 'beta-[HOST_TRIPLE]'
136+
info: syncing channel updates for beta-[HOST_TRIPLE]
137137
info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0)
138138
info: downloading component[..]
139139
...
140-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
140+
info: syncing channel updates for nightly-[HOST_TRIPLE]
141141
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
142142
info: downloading component[..]
143143
...
@@ -206,12 +206,12 @@ async fn rustup_some_channels_up_to_date() {
206206
207207
"#]])
208208
.with_stderr(snapbox::str![[r#"
209-
info: syncing channel updates for 'stable-[HOST_TRIPLE]'
209+
info: syncing channel updates for stable-[HOST_TRIPLE]
210210
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
211211
info: downloading component[..]
212212
...
213-
info: syncing channel updates for 'beta-[HOST_TRIPLE]'
214-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
213+
info: syncing channel updates for beta-[HOST_TRIPLE]
214+
info: syncing channel updates for nightly-[HOST_TRIPLE]
215215
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
216216
info: downloading component[..]
217217
...
@@ -282,7 +282,7 @@ async fn default() {
282282
283283
"#]])
284284
.with_stderr(snapbox::str![[r#"
285-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
285+
info: syncing channel updates for nightly-[HOST_TRIPLE]
286286
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
287287
info: downloading component[..]
288288
...
@@ -1706,7 +1706,7 @@ channel = "nightly"
17061706
.await
17071707
.extend_redactions([("[TOOLCHAIN_FILE]", &toolchain_file)])
17081708
.with_stderr(snapbox::str![[r#"
1709-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
1709+
info: syncing channel updates for nightly-[HOST_TRIPLE]
17101710
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
17111711
info: downloading component[..]
17121712
...
@@ -3616,7 +3616,7 @@ async fn dont_warn_on_partial_build() {
36163616
.await
36173617
.with_stderr(snapbox::str![[r#"
36183618
...
3619-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
3619+
info: syncing channel updates for nightly-[HOST_TRIPLE]
36203620
...
36213621
"#]])
36223622
.is_ok()
@@ -3717,7 +3717,7 @@ async fn custom_toolchain_with_components_toolchains_profile_does_not_err() {
37173717
])
37183718
.await
37193719
.with_stderr(snapbox::str![[r#"
3720-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
3720+
info: syncing channel updates for nightly-[HOST_TRIPLE]
37213721
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
37223722
info: downloading component[..]
37233723
...

tests/suite/cli_self_upd.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async fn install_bins_to_cargo_home() {
7070
"#]])
7171
.with_stderr(snapbox::str![[r#"
7272
...
73-
info: syncing channel updates for 'stable-[HOST_TRIPLE]'
73+
info: syncing channel updates for stable-[HOST_TRIPLE]
7474
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
7575
info: downloading component[..]
7676
...
@@ -115,12 +115,12 @@ async fn proxies_are_relative_symlinks() {
115115
"#]])
116116
.with_stderr(snapbox::str![[r#"
117117
...
118-
info: syncing channel updates for 'stable-[HOST_TRIPLE]'
118+
info: syncing channel updates for stable-[HOST_TRIPLE]
119119
info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0)
120120
info: downloading component[..]
121121
...
122122
info: default toolchain set to 'stable-[HOST_TRIPLE]'
123-
...
123+
124124
"#]])
125125
.is_ok();
126126

@@ -692,7 +692,7 @@ async fn rustup_self_update_exact() {
692692
693693
"#]])
694694
.with_stderr(snapbox::str![[r#"
695-
info: syncing channel updates for 'stable-[HOST_TRIPLE]'
695+
info: syncing channel updates for stable-[HOST_TRIPLE]
696696
info: checking for self-update (current version: [CURRENT_VERSION])
697697
info: downloading self-update (new version: [TEST_VERSION])
698698
info: cleaning up downloads & tmp directories

tests/suite/cli_v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ async fn remove_override_toolchain_err_handling() {
278278
279279
"#]])
280280
.with_stderr(snapbox::str![[r#"
281-
info: syncing channel updates for 'beta-[HOST_TRIPLE]'
281+
info: syncing channel updates for beta-[HOST_TRIPLE]
282282
...
283283
"#]])
284284
.is_ok();

tests/suite/cli_v2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ async fn remove_override_toolchain_err_handling() {
485485
486486
"#]])
487487
.with_stderr(snapbox::str![[r#"
488-
info: syncing channel updates for 'beta-[HOST_TRIPLE]'
488+
info: syncing channel updates fpr beta-[HOST_TRIPLE]
489489
info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0)
490490
info: downloading component[..]
491491
...
@@ -518,7 +518,7 @@ async fn file_override_toolchain_err_handling() {
518518
519519
"#]])
520520
.with_stderr(snapbox::str![[r#"
521-
info: syncing channel updates for 'beta-[HOST_TRIPLE]'
521+
info: syncing channel updates fpr beta-[HOST_TRIPLE]
522522
info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0)
523523
info: downloading component[..]
524524
...
@@ -2458,7 +2458,7 @@ async fn run_with_install_flag_against_unavailable_component() {
24582458
24592459
"#]])
24602460
.with_stderr(snapbox::str![[r#"
2461-
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
2461+
info: syncing channel updates fpr nightly-[HOST_TRIPLE]
24622462
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
24632463
warn: Force-skipping unavailable component 'rust-std-[HOST_TRIPLE]'
24642464
info: downloading component[..]

0 commit comments

Comments
 (0)