-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(package): Allow packaging of self-cycles with -Zpackage-workspace #15626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
r? @weihanglo rustbot has assigned @weihanglo. Use |
tests/testsuite/package.rs
Outdated
.masquerade_as_nightly_cargo(&["package-workspace"]) | ||
.with_status(101) | ||
.with_stderr_data(str![[r#" | ||
[ERROR] crates-io is replaced with remote registry dummy-registry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error looks pretty weird. What is the actual error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot reproduce this error with cargo 1.89.0-nightly (64a124607 2025-05-30)
outside cargo-test-support (not setting CARGO_HOME
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to replace crates.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I know, but is there a real world repro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no blocker and the fix seems reasonable. Thank you!
@@ -417,6 +417,11 @@ fn local_deps<T>(packages: impl Iterator<Item = (Package, T)>) -> LocalDependenc | |||
continue; | |||
}; | |||
|
|||
// We don't care about cycles | |||
if dep.source_id() == pkg.package_id().source_id() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit unintuitive, as comparing source_id doesn't generally imply they are cyclic. However, given we filtered in local packages earlier (which source ID contains path to package root as the unique identifer), it makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, in general this code assumes that the source_id
is unique and looks up a package id by the source id. I could move this into the following if
so we can then compare package ids. That won't make a practical differende but maybe it makes the intent clearer?
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost try-job: test-various
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
What does this PR try to resolve?
Found this as I was preparing for stabilization.
As we create a graph of packages to ensure publish order, a self-cycle shouldn't matter, so we can skip tracking it.
How to test and review this PR?