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

RFC: Remove implicit features in a new edition #3491

Merged
merged 10 commits into from Oct 14, 2023
Merged

Conversation

epage
Copy link
Contributor

@epage epage commented Sep 19, 2023

Rendered

This would resolve issues like rust-lang/cargo#12173

@epage epage added the T-cargo Relevant to the Cargo team, which will review and decide on the RFC. label Sep 19, 2023
Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines +47 to +53
```toml
[features]
gif = ["dep:giffy"]

[dependencies]
giffy = { version = "0.11.1", optional = true }
```
Copy link
Member

Choose a reason for hiding this comment

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

I assume gif = ["dep:gif"] (matching names) also works? if so, maybe this should be explicitly mentioned or even used as the example to avoid people from thinking that this would not be allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it does.

I wrote it from the perspective of someone reading it in 5 years where there is no historical baggage around assuming dependencies and features are in the same namespace.

@c410-f3r
Copy link

I just would like to thank you for pursuing this feature

@epage
Copy link
Contributor Author

epage commented Sep 28, 2023

🦗 ok, let's FCP this

@rfcbot fcp merge

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 28, 2023

Team member @epage has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. disposition-merge This RFC is in PFCP or FCP with a disposition to merge it. labels Sep 28, 2023
text/3491-remove-implicit-features.md Outdated Show resolved Hide resolved
Comment on lines 57 to 59
In addition to `cfg(feature = "gif")` syntax, you can reference this as
`cfg(feature = "giffy")` in the code though users may get confused at error
messages when used on a public API.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused by this. Is this suggesting that cargo starts setting a --cfg feature=giffy? That's not how it works today (there is no explicit cfg that can be used for the dependency name).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I had misunderstood; I had though we were setting a cfg for dependencies. Removed it in fa464d1

For existing editions, `cargo` will warn when parsing a workspace member's
package when an optional dependency is not referenced via `dep:` in the
features ([rust-lang/cargo#9088](https://github.com/rust-lang/cargo/issues/9088)) using the
planned warning control system ([rust-lang/cargo#12235](https://github.com/rust-lang/cargo/issues/12235)).
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be helpful to write down a contingency plan if that warning system is not available before the edition needs to be ready. I don't know what the timeline for either the warning system or the edition looks like, so I'm uncertain if the two can line up. But my suggestion would be to add some text along the lines of:

If the user-controllable warning system isn't implemented in time for the next edition, cargo fix --edition will still automatically fix Cargo.toml to migrate it to the next edition (just potentially using a less generalized implementation specific for this RFC).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on our discussion in the team meeting, I re-worked this to focus on the primary end-user affect we are going for (cargo fix --edition) in b1c02ae.

epage and others added 2 commits October 3, 2023 13:42
@rfcbot rfcbot added the final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. label Oct 3, 2023
@rfcbot
Copy link
Collaborator

rfcbot commented Oct 3, 2023

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. label Oct 3, 2023
Co-authored-by: Arlo Siemsen <arkixml@gmail.com>
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this RFC. to-announce and removed final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. labels Oct 13, 2023
@rfcbot
Copy link
Collaborator

rfcbot commented Oct 13, 2023

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@ehuss ehuss merged commit f1cfc16 into rust-lang:master Oct 14, 2023
@ehuss
Copy link
Contributor

ehuss commented Oct 14, 2023

Huzzah! The @rust-lang/cargo team has decided to accept this RFC.

To track further discussion, subscribe to the tracking issue here:
rust-lang/cargo#12826

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2024 Area: The 2024 edition disposition-merge This RFC is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this RFC. T-cargo Relevant to the Cargo team, which will review and decide on the RFC. to-announce
Projects
No open projects
Status: Accepted
Development

Successfully merging this pull request may close these issues.

None yet

6 participants