Skip to content

Commit 876c9fb

Browse files
committed
fix(package): Allow packaging of self-cycles with -Zpackage-workspace
1 parent 27c39b6 commit 876c9fb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/cargo/ops/cargo_package/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,11 @@ fn local_deps<T>(packages: impl Iterator<Item = (Package, T)>) -> LocalDependenc
417417
continue;
418418
};
419419

420+
// We don't care about cycles
421+
if dep.source_id() == pkg.package_id().source_id() {
422+
continue;
423+
}
424+
420425
if let Some(dep_pkg) = source_to_pkg.get(&dep.source_id()) {
421426
graph.link(pkg.package_id(), *dep_pkg);
422427
}

tests/testsuite/package.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7585,10 +7585,9 @@ fn unpublished_cyclic_dev_dependencies_nightly() {
75857585

75867586
p.cargo("package --no-verify --exclude-lockfile -Zpackage-workspace")
75877587
.masquerade_as_nightly_cargo(&["package-workspace"])
7588-
.with_status(101)
75897588
.with_stderr_data(str![[r#"
7590-
[ERROR] crates-io is replaced with remote registry dummy-registry;
7591-
include `--registry dummy-registry` or `--registry crates-io`
7589+
[PACKAGING] foo v0.0.1 ([ROOT]/foo)
7590+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
75927591
75937592
"#]])
75947593
.run();

0 commit comments

Comments
 (0)