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

prost_build::Config::prost_path is unusable. #939

Open
pompon0 opened this issue Nov 8, 2023 · 2 comments
Open

prost_build::Config::prost_path is unusable. #939

pompon0 opened this issue Nov 8, 2023 · 2 comments

Comments

@pompon0
Copy link

pompon0 commented Nov 8, 2023

If you set prost_path("x") in the config, then the generated rust structs will derive x::Message trait. However the derive macro expansion still assumes that prost crate is a direct dependency, which defies the purpose of customizing the prost_path in the first place.

@caspermeijn
Copy link
Collaborator

I see what you mean. When running cargo expand on a project which set prost_path, you will see impl ::prost::Message for Foo in the code. Can you provide a minimal, reproducible example of a failing project? This will help to create a test to verify your problem is resolved.

@pompon0
Copy link
Author

pompon0 commented Feb 23, 2024

Here you go
https://github.com/pompon0/prost-bug

gibbz00 added a commit to gibbz00/prost that referenced this issue Apr 28, 2024
Makes it easier to fix tokio-rs#939 because there were places where the
prost_path setting was being ignored when direct a direct alloc path
would suffice:

https://github.com/tokio-rs/prost/blob/691454307ccd2de4c780438da8acf2a1ddd994f6/prost-build/src/code_generator.rs#L648
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

No branches or pull requests

2 participants