Change:
Since we run cargo vendor unconditionally to vendor libtest in libstd. We should either pass it '--offline' or add a way to conditionally do so to avoid using network when unnecessary
I am happy to accept a patch for this; if it is not small (e.g., just adding offline) we will likely end up wanting to revert on beta.
Is this really P-critical? I would think this is P-high since P-critical is usually reserved for severe user-facing bugs.
I consider inability for distros to build a particular version of Rust to be a release blocker.
Here what i've tried so far: - - None of those worked out, last failure:
With just the (without the generate-lockfile):
Ah, I didn't realize it was that bad! Sorry about that.
cc -- do we expect cargo vendor to work without network when vendoring a subset of a workspace? It looks like we're running into some trouble here to get it working, though I've not personally had time yet to test. cc as well
I believe Cargo is working as intended here, when you run in the workspace root it doesn't actually vendor the crates from because they're patched locally to the in-tree versions. Then when Cargo later vendors for libtest, it doesn't see the annotations so it tries to download them from the network. If you've passed and you're using a vendor directory that means Cargo can't download any more packages, so it provides this error. I think the fix here is to either get Cargo to see the for these crates during the libtest vendoring process or somehow get those crates vendored in whatever does the original vendor.
Will give the approach a try, thanks a lot for the explanation edit: assuming adding the patch section to e.g. libtest can work
I have posted a revert for the current release () since there were several issues on the Cargo side, too. Hopefully we'll try to avoid these issues when we try again.

Discussion:
builder.copy(&builder.src.join(file), &dst_src.join(file)); } <del> // libtest includes std and everything else, so vendoring it // creates exactly what's needed for `cargo -Zbuild-std` or any // other analysis of the stdlib's source. Cargo also needs help // finding the lock, so we copy it to libtest temporarily. // // Note that this requires std to only have one version of each // crate. e.g. two versions of getopts won't be patchable. let dst_libtest = dst_src.join("library/test"); let dst_vendor = dst_src.join("vendor"); let root_lock = dst_src.join("Cargo.lock"); let temp_lock = dst_libtest.join("Cargo.lock"); // `cargo vendor` will delete everything from the lockfile that // isn't used by libtest, so we need to not use any links! builder.really_copy(&root_lock, &temp_lock); let mut cmd = Command::new(&builder.initial_cargo); cmd.arg("vendor").arg(dst_vendor).current_dir(&dst_libtest); builder.info("Dist src"); let _time = timeit(builder); builder.run(&mut cmd); builder.remove(&temp_lock); </del> // Create source tarball in rust-installer format let mut cmd = rust_installer(builder); cmd.arg("generate")

.arg("--component-name=rust-src") .arg("--legacy-manifest-dirs=rustlib,cargo"); <ins> builder.info("Dist src"); let _time = timeit(builder); </ins> builder.run(&mut cmd); builder.remove_dir(&image);

paths } <del> /// Copies a file from `src` to `dst` and doesn't use links, so /// that the copy can be modified without affecting the original. pub fn really_copy(&self, src: &Path, dst: &Path) { if self.config.dry_run { return; } self.verbose_than(1, &format!("Copy {:?} to {:?}", src, dst)); if src == dst { return; } let _ = fs::remove_file(&dst); let metadata = t!(src.symlink_metadata()); if let Err(e) = fs::copy(src, dst) { panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e) } t!(fs::set_permissions(dst, metadata.permissions())); let atime = FileTime::from_last_access_time(&metadata); let mtime = FileTime::from_last_modification_time(&metadata); t!(filetime::set_file_times(dst, atime, mtime)); } </del> /// Copies a file from `src` to `dst` pub fn copy(&self, src: &Path, dst: &Path) { if self.config.dry_run {