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

Support telling serde where it is, i.e. when re-exported as a transitive dependency. #108

Closed
wants to merge 1 commit into from

Conversation

lifning
Copy link

@lifning lifning commented Sep 15, 2022

Supported by the serde() annotation in derive macros, which otherwise will assume that serde is a direct crate dependency. When a macro emits a type that derives Serialize/Deserialize, the user of that macro would normally have to directly depend on serde themselves for the resulting expansion of those derive macros. This can be cumbersome when consuming serde transitively via some other crate (i.e. progenitor).

https://github.com/serde-rs/serde/blob/5a8dcac2ed1407fab3f7fd23f2d56af42dcd448f/serde_derive/src/internals/attr.rs#L556-L561

@lifning lifning requested a review from ahl September 15, 2022 08:22
@ahl
Copy link
Collaborator

ahl commented Sep 15, 2022

I don't think we should re-expert serde. We looked into this with Dropshot and decided against it. David Tolnay steered us away from it as I recall. oxidecomputer/dropshot#67

…ive dependency.

Supported by the `serde()` annotation in derive macros, which otherwise
will assume that serde is a direct crate dependency. When a macro emits
a type that derives Serialize/Deserialize, the user of that macro would
normally have to directly depend on serde themselves for the resulting
expansion of those derive macros. This can be cumbersome when consuming
serde transitively via some other crate (i.e. progenitor).

https://github.com/serde-rs/serde/blob/5a8dcac2ed1407fab3f7fd23f2d56af42dcd448f/serde_derive/src/internals/attr.rs#L556-L561
@lifning
Copy link
Author

lifning commented Sep 17, 2022

I don't think we should re-expert serde. We looked into this with Dropshot and decided against it. David Tolnay steered us away from it as I recall. oxidecomputer/dropshot#67

I see, though I imagine the situation for progenitor output might be different with regard to the concern about it being onerous and error-prone to include that attribute for every serde derive, being that it's automatically generated. Is it something we'd still be uncomfortable using here for other reasons?

@ahl
Copy link
Collaborator

ahl commented Sep 19, 2022

I see, though I imagine the situation for progenitor output might be different ...

Yes, agreed.

... with regard to the concern about it being onerous and error-prone to include that attribute for every serde derive, being that it's automatically generated. Is it something we'd still be uncomfortable using here for other reasons?

I guess I'm unclear on the problem we're seeking to address.

@ahl ahl closed this Dec 5, 2022
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.

2 participants