Skip to content

Commit 54448a1

Browse files
committed
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.
1 parent efb3007 commit 54448a1

File tree

1 file changed

+10
-11
lines changed
  • src/cargo/ops/cargo_package

1 file changed

+10
-11
lines changed

src/cargo/ops/cargo_package/mod.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,17 @@ fn do_package<'a>(
239239
let deps = local_deps(pkgs.iter().map(|(p, f)| ((*p).clone(), f.clone())));
240240
let just_pkgs: Vec<_> = pkgs.iter().map(|p| p.0).collect();
241241

242-
// The publish registry doesn't matter unless there are local dependencies,
243-
// so only try to get one if we need it. If they explicitly passed a
244-
// registry on the CLI, we check it no matter what.
245-
let sid = if deps.has_no_dependencies() && opts.reg_or_index.is_none() {
246-
None
247-
} else {
248-
let sid = get_registry(ws.gctx(), &just_pkgs, opts.reg_or_index.clone())?;
249-
debug!("packaging for registry {}", sid);
250-
Some(sid)
251-
};
252-
253242
let mut local_reg = if ws.gctx().cli_unstable().package_workspace {
243+
// The publish registry doesn't matter unless there are local dependencies,
244+
// so only try to get one if we need it. If they explicitly passed a
245+
// registry on the CLI, we check it no matter what.
246+
let sid = if deps.has_no_dependencies() && opts.reg_or_index.is_none() {
247+
None
248+
} else {
249+
let sid = get_registry(ws.gctx(), &just_pkgs, opts.reg_or_index.clone())?;
250+
debug!("packaging for registry {}", sid);
251+
Some(sid)
252+
};
254253
let reg_dir = ws.build_dir().join("package").join("tmp-registry");
255254
sid.map(|sid| TmpRegistry::new(ws.gctx(), reg_dir, sid))
256255
.transpose()?

0 commit comments

Comments
 (0)