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
Fix examples #8
Fix examples #8
Conversation
Got: cargo run --example server unix:///tmp/1 error[E0425]: cannot find value VERSION_2_8_0 in crate protobuf This commit makes it necessary for users to generate codes themeselves before running examples to avoid above errors. Signed-off-by: Tim Zhang <tim@hyper.sh>
Add instructions of how to run examples and notes about protobuf version. Signed-off-by: Tim Zhang <tim@hyper.sh>
I would like we keep these files until this file can be auto generated with build. |
@teawater I have tried to generate *.rs file from .proto automatically by build.rs today, it works but I think it is not a good idea because build.rs will run with |
@Tim-Zhang Cool! I really like build.rs example. That is a really important example for user. Please keep it. If it cannot be a part of normal example, maybe we can change example to a special directory name or something. |
039c65c
to
f260dea
Compare
@teawater @lifupan I have pushed the commit. In this commit I have renamed examples to example to make it a standalone cargo project, and I have created a file |
.gitignore
Outdated
example/protocols/empty.rs | ||
example/protocols/health.rs | ||
example/protocols/oci.rs | ||
example/protocols/types.rs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xxx_ttrpc.rs should add to this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think ttrpc supports generate codes programmatically for now, so leave it alone.
Why "cargo build --examples" cannot generate "protocols/*_ttrpc.rs" but "hack/update-generated-proto.sh" can generate them? |
f260dea
to
174f037
Compare
@teawater I just updated the pull request: remove *_ttrpc.rs and call |
Rename examples to example to make it a standalone cargo project so that we can use build script, independent dependencies, etc. in example. Signed-off-by: Tim Zhang <tim@hyper.sh>
174f037
to
b52a5fc
Compare
Got:
cargo run --example server unix:///tmp/1
error[E0425]: cannot find value VERSION_2_8_0 in crate protobuf
The above error is caused by protobuf version checking mechanism in the generated codes in examples.
For more information:
This PR remove generated files in example and add instructions to README to fix the above error and explain how to avoid the error.