Skip to content

Conversation

epage
Copy link
Contributor

@epage epage commented Jul 31, 2024

Beta backports

In order to make CI pass, the following PRs are also cherry-picked:

linyihai and others added 7 commits July 31, 2024 12:47
We'll be doing a second `prepare_for_publish` call that doesn't need the
filtering, we don't have access to the `included`, and we don't want the
warnings duplicated.
First, we added support for stripping of local-only dev-dependencies.
This was dual-implemented for `Cargo.toml` and `Summary`.

This left off stripping of `dep/feature` that reference dev-dependencies
(enabling features within dev-dependencies).
When we fixed this, we again dual-implemented it.

The `Cargo.toml` version was correct but the `Summary` version was
instead stripping too many features,
particularly features that reference renamed dependencies.
We didn't have tests for this case and it wasn't caught earlier because
crates.io re-generates the `Summary` from `Cargo.toml`, ignoring what we
post.
That makes this only show up with custom registries that trust what
Cargo posts.

Rather than fixing the `Summary` generation, I remove the
dual-implementation and instead generate the `Summary` from the
published `Cargo.toml`.
Unfortunately, we don't have access directly to the packaged
`Cargo.toml`.
It could be passed around and I originally did so, hoping to remove use
of the local `Package`.
However, the local `Package` is needed for things like reading the
`README`.
So I scaled back and isolate the change to only what needs it.
This also makes it easier for `prepare_transmit` callers.
Fully open to someone exploring removing this extra `prepare_for_publish` in the future.

Fixes rust-lang#14321
@rustbot
Copy link
Collaborator

rustbot commented Jul 31, 2024

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Jul 31, 2024

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against rust-1.81.0. Please double check that you specified the right target!

@rustbot rustbot added A-interacts-with-crates.io Area: interaction with registries A-manifest Area: Cargo.toml issues Command-package Command-publish S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 31, 2024
@weihanglo
Copy link
Member

Thanks! I'll do beta-backport in rust-lang/rust later.

@bors r+

@bors
Copy link
Contributor

bors commented Jul 31, 2024

📌 Commit 25ecfce has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 31, 2024
@bors
Copy link
Contributor

bors commented Jul 31, 2024

⌛ Testing commit 25ecfce with merge ca2346b...

@bors
Copy link
Contributor

bors commented Jul 31, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing ca2346b to rust-1.81.0...

@bors bors merged commit ca2346b into rust-lang:rust-1.81.0 Jul 31, 2024
@epage epage deleted the 14321-cherry-pick branch August 1, 2024 14:53
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 4, 2024
…nglo

[beta-1.81] Update cargo

1 commits in a2b58c3dad4d554ba01ed6c45c41ff85390560f2..ca2346bd3c7f51e82964aaf7e47cdf770047b6ab
2024-07-16 00:52:02 +0000 to 2024-07-31 19:33:19 +0000
- [beta-1.81] fix(publish): Don't strip non-dev features (rust-lang/cargo#14328)

r? ghost
@rustbot rustbot added this to the 1.81.0 milestone Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interacts-with-crates.io Area: interaction with registries A-manifest Area: Cargo.toml issues Command-package Command-publish S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants