Skip to content
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

fix(publish): Don't strip non-dev features #14325

Merged
merged 8 commits into from
Jul 31, 2024
24 changes: 24 additions & 0 deletions tests/testsuite/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,9 @@ fn publish_dev_dep_stripping() {
Package::new("optional-namespaced", "1.0.0")
.feature("cat", &[])
.publish();
Package::new("optional-renamed-namespaced", "1.0.0")
.feature("cat", &[])
.publish();
Package::new("build-only", "1.0.0")
.feature("cat", &[])
.publish();
Expand Down Expand Up @@ -1652,13 +1655,15 @@ fn publish_dev_dep_stripping() {
"target-normal-and-dev/cat",
"optional-dep-feature/cat",
"dep:optional-namespaced",
"dep:optional-renamed-namespaced10",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we cover more rename cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added

  • renamed-dev-only
  • optional-renamed-dep-feature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, hadn't refreshed. I'll post a follow up PR

]

[dependencies]
normal-only = { version = "1.0", features = ["cat"] }
normal-and-dev = { version = "1.0", features = ["cat"] }
optional-dep-feature = { version = "1.0", features = ["cat"], optional = true }
optional-namespaced = { version = "1.0", features = ["cat"], optional = true }
optional-renamed-namespaced10 = { version = "1.0", features = ["cat"], optional = true, package = "optional-renamed-namespaced" }

[build-dependencies]
build-only = { version = "1.0", features = ["cat"] }
Expand Down Expand Up @@ -1770,6 +1775,18 @@ You may press ctrl-c to skip waiting; the crate should be available shortly.
"target": null,
"version_req": "^1.0"
},
{
"default_features": true,
"explicit_name_in_toml": "optional-renamed-namespaced10",
"features": [
"cat"
],
"kind": "normal",
"name": "optional-renamed-namespaced",
"optional": true,
"target": null,
"version_req": "^1.0"
},
{
"default_features": true,
"features": [
Expand Down Expand Up @@ -1909,6 +1926,12 @@ version = "1.0"
features = ["cat"]
optional = true

[dependencies.optional-renamed-namespaced10]
version = "1.0"
features = ["cat"]
optional = true
package = "optional-renamed-namespaced"

[dev-dependencies.normal-and-dev]
version = "1.0"
features = ["cat"]
Expand All @@ -1927,6 +1950,7 @@ foo_feature = [
"target-normal-and-dev/cat",
"optional-dep-feature/cat",
"dep:optional-namespaced",
"dep:optional-renamed-namespaced10",
]

[target."cfg(unix)".dependencies.target-normal-and-dev]
Expand Down