mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Only check for the registry if package-workspace is turned on.
Without this, the upcoming change to stop stripping versioned dev-dependencies breaks the unpublished_cyclic_dev_dependencies test because the test setup replaces the registry.
This commit is contained in:
parent
efb300775a
commit
54448a1a19
@ -239,18 +239,17 @@ fn do_package<'a>(
|
|||||||
let deps = local_deps(pkgs.iter().map(|(p, f)| ((*p).clone(), f.clone())));
|
let deps = local_deps(pkgs.iter().map(|(p, f)| ((*p).clone(), f.clone())));
|
||||||
let just_pkgs: Vec<_> = pkgs.iter().map(|p| p.0).collect();
|
let just_pkgs: Vec<_> = pkgs.iter().map(|p| p.0).collect();
|
||||||
|
|
||||||
// The publish registry doesn't matter unless there are local dependencies,
|
|
||||||
// so only try to get one if we need it. If they explicitly passed a
|
|
||||||
// registry on the CLI, we check it no matter what.
|
|
||||||
let sid = if deps.has_no_dependencies() && opts.reg_or_index.is_none() {
|
|
||||||
None
|
|
||||||
} else {
|
|
||||||
let sid = get_registry(ws.gctx(), &just_pkgs, opts.reg_or_index.clone())?;
|
|
||||||
debug!("packaging for registry {}", sid);
|
|
||||||
Some(sid)
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut local_reg = if ws.gctx().cli_unstable().package_workspace {
|
let mut local_reg = if ws.gctx().cli_unstable().package_workspace {
|
||||||
|
// The publish registry doesn't matter unless there are local dependencies,
|
||||||
|
// so only try to get one if we need it. If they explicitly passed a
|
||||||
|
// registry on the CLI, we check it no matter what.
|
||||||
|
let sid = if deps.has_no_dependencies() && opts.reg_or_index.is_none() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
let sid = get_registry(ws.gctx(), &just_pkgs, opts.reg_or_index.clone())?;
|
||||||
|
debug!("packaging for registry {}", sid);
|
||||||
|
Some(sid)
|
||||||
|
};
|
||||||
let reg_dir = ws.build_dir().join("package").join("tmp-registry");
|
let reg_dir = ws.build_dir().join("package").join("tmp-registry");
|
||||||
sid.map(|sid| TmpRegistry::new(ws.gctx(), reg_dir, sid))
|
sid.map(|sid| TmpRegistry::new(ws.gctx(), reg_dir, sid))
|
||||||
.transpose()?
|
.transpose()?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user