Skip to content

Commit 64410ba

Browse files
committed
notifications: log directly when skipping components
1 parent 078770f commit 64410ba

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

src/dist/manifestation.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,17 @@ impl Manifestation {
137137
e.downcast::<RustupError>()
138138
{
139139
for component in &components {
140-
(download_cfg.notify_handler)(Notification::ForcingUnavailableComponent(
141-
&component.name(new_manifest),
142-
));
140+
match &component.target {
141+
Some(t) if t != &self.target_triple => warn!(
142+
"skipping unavailable component {} for target {}",
143+
component.short_name(new_manifest),
144+
t
145+
),
146+
_ => warn!(
147+
"skipping unavailable component {}",
148+
component.short_name(new_manifest)
149+
),
150+
}
143151
}
144152
update.drop_components_to_install(&components);
145153
}

src/notifications.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub(crate) enum Notification<'a> {
1414
CachedFileChecksumFailed,
1515
/// The URL of the download is passed as the last argument, to allow us to track concurrent downloads.
1616
DownloadingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>, &'a str),
17-
ForcingUnavailableComponent(&'a str),
1817
StrayHash(&'a Path),
1918
RetryingDownload(&'a str),
2019
DownloadingFile(&'a Url),
@@ -63,9 +62,7 @@ impl Notification<'_> {
6362
match self {
6463
FileAlreadyDownloaded => NotificationLevel::Debug,
6564
DownloadingComponent(_, _, _, _) | RetryingDownload(_) => NotificationLevel::Info,
66-
CachedFileChecksumFailed | ForcingUnavailableComponent(_) | StrayHash(_) => {
67-
NotificationLevel::Warn
68-
}
65+
CachedFileChecksumFailed | StrayHash(_) => NotificationLevel::Warn,
6966
SetDefaultBufferSize(_) => NotificationLevel::Trace,
7067
DownloadingFile(_)
7168
| DownloadContentLengthReceived(_, _)
@@ -113,9 +110,6 @@ impl Display for Notification<'_> {
113110
"removing stray hash found at '{}' in order to continue",
114111
path.display()
115112
),
116-
ForcingUnavailableComponent(component) => {
117-
write!(f, "Force-skipping unavailable component '{component}'")
118-
}
119113
RetryingDownload(url) => write!(f, "retrying download for '{url}'"),
120114
SetDefaultBufferSize(size) => write!(
121115
f,

tests/suite/cli_inst_interactive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ async fn install_forces_and_skips_rls() {
478478
.is_ok()
479479
.with_stderr(snapbox::str![[r#"
480480
...
481-
warn: Force-skipping unavailable component 'rls-[HOST_TRIPLE]'
481+
warn: skipping unavailable component rls
482482
...
483483
"#]]);
484484
}

tests/suite/cli_rustup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2770,7 +2770,7 @@ components = [ "rust-bongo" ]
27702770
.await
27712771
.with_stderr(snapbox::str![[r#"
27722772
...
2773-
warn: Force-skipping unavailable component 'rust-bongo-[HOST_TRIPLE]'
2773+
warn: skipping unavailable component rust-bongo
27742774
...
27752775
"#]])
27762776
.is_ok();

tests/suite/cli_v2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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();
@@ -2419,7 +2419,7 @@ error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download fo
24192419
.await
24202420
.with_stderr(snapbox::str![[r#"
24212421
...
2422-
warn: Force-skipping unavailable component 'rls-[HOST_TRIPLE]'
2422+
warn: skipping unavailable component rls
24232423
...
24242424
"#]])
24252425
.is_ok();
@@ -2460,7 +2460,7 @@ async fn run_with_install_flag_against_unavailable_component() {
24602460
.with_stderr(snapbox::str![[r#"
24612461
info: syncing channel updates for nightly-[HOST_TRIPLE]
24622462
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
2463-
warn: Force-skipping unavailable component 'rust-std-[HOST_TRIPLE]'
2463+
warn: skipping unavailable component rust-std
24642464
info: downloading component[..]
24652465
...
24662466
"#]])

0 commit comments

Comments
 (0)