Skip to content

Commit afbdffb

Browse files
committed
convert to installation of nightly cargo by default and remove --with-cargo option
1 parent 798bc04 commit afbdffb

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

src/main.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ struct Opts {
9393
)]
9494
preserve_target: bool,
9595

96-
#[structopt(
97-
long = "with-cargo",
98-
help = "Download cargo [default: installed cargo]"
99-
)]
100-
with_cargo: bool,
101-
10296
#[structopt(long = "with-src", help = "Download rust-src [default: no download]")]
10397
with_src: bool,
10498

src/toolchains.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,20 @@ impl Toolchain {
231231
.map_err(InstallError::Download)?;
232232
}
233233

234-
if dl_params.install_cargo {
235-
let filename = format!("cargo-nightly-{}", self.host);
236-
download_tarball(
237-
&client,
238-
&format!("cargo for {}", self.host),
239-
&format!("{}/{}/{}.tar", dl_params.url_prefix, location, filename,),
240-
Some(&PathBuf::from(&filename).join("cargo")),
241-
tmpdir.path(),
242-
)
243-
.map_err(InstallError::Download)?;
244-
}
234+
// download nightly cargo by default
235+
// this behavior was changed from an
236+
// optional feature with the `--with-cargo`
237+
// flag as of v0.6.0
238+
// see: https://github.com/rust-lang/cargo-bisect-rustc/issues/81
239+
let filename = format!("cargo-nightly-{}", self.host);
240+
download_tarball(
241+
&client,
242+
&format!("cargo for {}", self.host),
243+
&format!("{}/{}/{}.tar", dl_params.url_prefix, location, filename,),
244+
Some(&PathBuf::from(&filename).join("cargo")),
245+
tmpdir.path(),
246+
)
247+
.map_err(InstallError::Download)?;
245248

246249
if dl_params.install_src {
247250
let filename = "rust-src-nightly";
@@ -407,7 +410,6 @@ pub(crate) struct DownloadParams {
407410
url_prefix: String,
408411
tmp_dir: PathBuf,
409412
install_dir: PathBuf,
410-
install_cargo: bool,
411413
install_src: bool,
412414
force_install: bool,
413415
}
@@ -432,7 +434,6 @@ impl DownloadParams {
432434
url_prefix,
433435
tmp_dir: cfg.rustup_tmp_path.clone(),
434436
install_dir: cfg.toolchains_path.clone(),
435-
install_cargo: cfg.args.with_cargo,
436437
install_src: cfg.args.with_src,
437438
force_install: cfg.args.force_install,
438439
}

0 commit comments

Comments
 (0)