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

Enable default features in prost dependencies #1344

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

stefanvanburen
Copy link
Member

Since we're not supporting no_std crates, we should enable the std feature by default. (This happens to be the same as default_features currently, but that may change in the future.)

Since we're not supporting `no_std` crates, we should enable the `std`
feature by default.
@stefanvanburen
Copy link
Member Author

Related public slack post. Ultimately, not all crates need the std features, but this doesn't (currently) add any additional dependencies to the graph, just flips some codegen bits so you don't need to manually cargo add prost@<matching-version> --features std.

@@ -16,6 +16,7 @@ registry:
- name: "prost"
req: "0.12.3"
default_features: false
features: ["std"]
Copy link
Member

Choose a reason for hiding this comment

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

Is this difference between this and setting default_features: true that it would enable the derive feature too?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, that's the difference. Not sure if we want to enable derive or not. My vague understanding (from the README) is that it's more for user-generated types, but OTOH the custom derive macro is added to the generated code.

Let's maybe just add it (by using default_features: true) — it's a single extra crate with no dependencies.

@@ -16,6 +16,7 @@ registry:
- name: "prost"
req: "0.12.3"
default_features: false
features: ["std"]
# prost-types is necessary for any module using the WKTs.
- name: "prost-types"
Copy link
Member

Choose a reason for hiding this comment

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

@stefanvanburen stefanvanburen merged commit 03fa550 into main Jul 15, 2024
4 checks passed
@stefanvanburen stefanvanburen deleted the svanburen/add-prost-std-feature branch July 15, 2024 15:11
@stefanvanburen stefanvanburen changed the title Add std feature to prost dependency Enable default features in prost dependencies Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants