@@ -979,6 +979,7 @@ pub(crate) async fn update_from_dist(
979979 opts. components ,
980980 opts. targets ,
981981 & mut fetched,
982+ & opts. cfg . dist_root_url ,
982983 )
983984 . await ;
984985
@@ -1075,13 +1076,15 @@ async fn try_update_from_dist_(
10751076 components : & [ & str ] ,
10761077 targets : & [ & str ] ,
10771078 fetched : & mut String ,
1079+ dist_root : & str ,
10781080) -> Result < Option < String > > {
10791081 let toolchain_str = toolchain. to_string ( ) ;
10801082 let manifestation = Manifestation :: open ( prefix. clone ( ) , toolchain. target . clone ( ) ) ?;
10811083
10821084 // TODO: Add a notification about which manifest version is going to be used
10831085 info ! ( "syncing channel updates for {toolchain_str}" ) ;
10841086 match dl_v2_manifest (
1087+ dist_root,
10851088 download,
10861089 // Even if manifest has not changed, we must continue to install requested components.
10871090 // So if components or targets is not empty, we skip passing `update_hash` so that
@@ -1189,7 +1192,7 @@ async fn try_update_from_dist_(
11891192 }
11901193
11911194 // If the v2 manifest is not found then try v1
1192- let manifest = match dl_v1_manifest ( download, toolchain) . await {
1195+ let manifest = match dl_v1_manifest ( dist_root , download, toolchain) . await {
11931196 Ok ( m) => m,
11941197 Err ( err) => match err. downcast_ref :: < RustupError > ( ) {
11951198 Some ( RustupError :: ChecksumFailed { .. } ) => return Err ( err) ,
@@ -1232,11 +1235,12 @@ async fn try_update_from_dist_(
12321235}
12331236
12341237pub ( crate ) async fn dl_v2_manifest (
1238+ dist_root : & str ,
12351239 download : & DownloadCfg < ' _ > ,
12361240 update_hash : Option < & Path > ,
12371241 toolchain : & ToolchainDesc ,
12381242) -> Result < Option < ( ManifestV2 , String ) > > {
1239- let manifest_url = toolchain. manifest_v2_url ( download . dist_root , download. process ) ;
1243+ let manifest_url = toolchain. manifest_v2_url ( dist_root, download. process ) ;
12401244 match download
12411245 . download_and_check ( & manifest_url, update_hash, ".toml" )
12421246 . await
@@ -1281,10 +1285,11 @@ pub(crate) async fn dl_v2_manifest(
12811285}
12821286
12831287async fn dl_v1_manifest (
1288+ dist_root : & str ,
12841289 download : & DownloadCfg < ' _ > ,
12851290 toolchain : & ToolchainDesc ,
12861291) -> Result < Vec < String > > {
1287- let root_url = toolchain. package_dir ( download . dist_root ) ;
1292+ let root_url = toolchain. package_dir ( dist_root) ;
12881293
12891294 if let Channel :: Version ( ver) = & toolchain. channel {
12901295 // This is an explicit version. In v1 there was no manifest,
@@ -1293,7 +1298,7 @@ async fn dl_v1_manifest(
12931298 return Ok ( vec ! [ installer_name] ) ;
12941299 }
12951300
1296- let manifest_url = toolchain. manifest_v1_url ( download . dist_root , download. process ) ;
1301+ let manifest_url = toolchain. manifest_v1_url ( dist_root, download. process ) ;
12971302 let manifest_dl = download. download_and_check ( & manifest_url, None , "" ) . await ?;
12981303 let ( manifest_file, _) = manifest_dl. unwrap ( ) ;
12991304 let manifest_str = utils:: read_file ( "manifest" , & manifest_file) ?;
0 commit comments