-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Switch public/private dependencies to a non-blocking feature gate #13308
Comments
@linyihai in case you didn't see this. If not interested at this time, thats fine. |
before I deep into this issue, I had glanced the code roughly. I still have some question.
Firstly, I can refer to PR #13296 to add the The question is whether I replace
This is a little vague to me. Do you mean check the code in
Besides, it would be great if there were examples like this in the past. @epage Please give me some guidance, thanks you a lot. |
I think your intention is only warning when run Or has nothing to do with |
Yes, delete the old feature and add the People are using this, so maybe we should offer a transition period? Unsure.
Intentionally so as the way to solve it is less important. I would expect a test that shows that the published or packaged Most likely, in
This has nothing to do with |
feat: Add "-Zpublic-dependency" for public-dependency feature. ### What does this PR try to resolve? Part of #13308, include: - Switching the cargo-features to a -Z - Warning if public is used without -Z and setting it to false These had not done yet: - We should also warn if the data type changes but that is less likely to happen and could possibly be skipped - Ensuring the published version of the package does not have public ### How should we test and review this PR? All test case should be pass. ### Additional information r? `@epage`
I will address this by next PR. |
test: Add test for packaging a public dependency ### What does this PR try to resolve? Add a test for packaging a public dependency. if no `-Zpublic-dependency`, the rewrited Cargo.toml does not have public, but if it does, public is in the rewrited Cargo.toml. According the test, it seems no need to unset public in `prepare_for_publish` ### How should we test and review this PR? ### Additional information Address #13308
test: Add test for packaging a public dependency ### What does this PR try to resolve? Add a test for packaging a public dependency. if no `-Zpublic-dependency`, the rewrited Cargo.toml does not have public, but if it does, public is in the rewrited Cargo.toml. According the test, it seems no need to unset public in `prepare_for_publish` ### How should we test and review this PR? ### Additional information Address #13308
@linyihai any reason for us to keep this open? There is a question of whether we should phase out the |
I agree. |
I'm done with my progress so far. If there is no improvement, suggest closing this |
I believe the difference is: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/mod.rs#L1514. In other words, -Zpublic-dependency is equivalent to unconditionally enabling public/private checks on all |
In rust-lang#13308, we decided to make the feature gate for public/private dependencies non-blocking. Generally, people opt-in to a feature that is non-blocking through `-Z` but some nightly users want an "always on" mode for this, so we offered both in rust-lang#13340. In rust-lang#13340, we made both feature gates work but we did not make them non-blocking for stable, only nightly. This change makes the feature gate non-blocking on stable.
fix(toml): Don't require MSRV bump for pub/priv ### What does this PR try to resolve? In #13308, we decided to make the feature gate for public/private dependencies non-blocking. Generally, people opt-in to a feature that is non-blocking through `-Z` but some nightly users want an "always on" mode for this, so we offered both in #13340. In #13340, we made both feature gates work but we did not make them non-blocking for stable, only nightly. This change makes the feature gate non-blocking on stable. Unfortunately, this means that 1.83 will be the MSRV for people using public dependencies. Good thing the feature is indefinitely blocked in rustc as that gives us more time. ### How should we test and review this PR? ### Additional information
In rust-lang#13308, we decided to make the feature gate for public/private dependencies non-blocking. Generally, people opt-in to a feature that is non-blocking through `-Z` but some nightly users want an "always on" mode for this, so we offered both in rust-lang#13340. In rust-lang#13340, we made both feature gates work but we did not make them non-blocking for stable, only nightly. This change makes the feature gate non-blocking on stable.
#13307 updates our documentation to distinguish blocking and non-blocking feature gates. Currently, public dependencies use a blocking feature gate and should be switched to a non-blocking feature gate.
When discussing this as a team, we tried to balance
Due to some outstanding rustc bugs, the timeline for stabilization is out of our hands and so we feel moving forward with switching to non-blocking gating is worth it.
Parts of this change include
cargo-features
to a-Z
public
is used without-Z
and setting it to falsepublic
The text was updated successfully, but these errors were encountered: