-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(package): Skip registry check if its not needed #15629
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
I believe this brings makes it so `cargo package -Zpackage-workspace` no longer has a behavior change compared to `cargo package`.
r? @weihanglo rustbot has assigned @weihanglo. Use |
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.
Haven't looked at the implementation. Just dump what I remember. There are two instances contributing to excessive registry updates. One is overlay registry updates, and the other one is lockfile generation. By just skimming the test diff I didn't see any old test changing, so I feel like this only addresses this former one.
I'll look closer and we don't need to deal with them in one PR
This does not reduce any registry updates. This bypasses us creating an overlay registry when it will go unused. The creation of an overlay registry, in some cases, requires the user to pass in an extra command line flag. With us not needing that extra command line flag, stabilization of |
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.
Thanks. I misunderstood the PR.
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?
As of #13947,
-Zpackage-workspace
madecargo package
require extra arguments when it didn't need it before. When a packaging operation will resolve dependencies, we need to know what registry packages would be published to in order to correctly generate the overlay to generate the right lockfile.We skipped this if there were no dependencies, so no overlay was going to be used, to reduce the impact of this.
This change goes a step further and only runs the check if the resolver will run. This should mean that
-Zpackage-workspace
should now only error whencargo package
would have failed before.How to test and review this PR?
To verify this, the existing failure tests were forked, removing
-Zpackage-workspace
, and then--exclude-lockfile
,--no-verify
, and--exclude-lockfile --no-verify
variants were added to characterize when the check is behavior-neutral vs not needed and that the behavior is now the same.