-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Helloworld tutorial is outdated? #765
Comments
Rust build scripts are being expected to be in the root folder, i.e a sibling folder to |
That's right but as I remember there will be an erorr because of I mean that In the tutorial there's snippets like these. // don't remember func name
tonic_build::.compile_prots("proto/helloworld.proto").unwrap(); # include `prost`
[dependencies]
# include `prost`
[build-dependencies]
tonic-build = { path = "../tonic-build", features = [] } And I was getting errors unless I changed them to the following (Which I found in your examples folder) let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
tonic_build::configure()
.file_descriptor_set_path(out_dir.join("helloworld_descriptor.bin"))
.compile(&["proto/helloworld.proto"], &["proto"])
.unwrap(); # include `prost`
[dependencies]
prost = "*"
# include `prost`
[build-dependencies]
tonic-build = { path = "../tonic-build", features = ["prost"] } |
To be precise here it is When you keep things as described in tutorial https://github.com/hyperium/tonic/blame/master/examples/helloworld-tutorial.md#L101-L122 https://github.com/hyperium/tonic/blame/master/examples/helloworld-tutorial.md#L130-L134
|
I don't really see what is missing in the tutorial, but I would accept a PR with suggestions you might have. |
I have the same problem, I solve it , add prost = "0.8" to cargo.toml |
That's what I meant (I guess), that probably it makes sense to note or make it more clear that as @small-lei mentioned
|
The prost thing is known #791 👀 |
Yeah this should be fixed on master right now and in the next release. |
Getting the same issue; following the helloworld tutorial example to the letter. |
@chokosabe can you post your cargo.toml file? The versions in the tutorial look fine to me. |
Same issue here after the routeguide tutorial. And I added the |
Faced the same problem in [package]
name = "helloworld-tonic"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]] # Bin to run the HelloWorld gRPC server
name = "helloworld-server"
path = "src/server.rs"
[[bin]] # Bin to run the HelloWorld gRPC client
name = "helloworld-client"
path = "src/client.rs"
[dependencies]
tonic = "0.7"
prost = "0.10"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
[build-dependencies]
tonic-build = "0.7" |
I solved it as follows: [[package]] So seems like they are conflicting and right version is not getting picked. So I changed the dependencies of prost version to prost = "0.11.9" and it build successfully. |
I did confirm the tutorial works with the latest version by to configure Cargo.toml as follows: [package]
name = "helloworld-tonic"
version = "0.1.0"
edition = "2021"
[[bin]] # Bin to run the HelloWorld gRPC server
name = "helloworld-server"
path = "src/server.rs"
[[bin]] # Bin to run the HelloWorld gRPC client
name = "helloworld-client"
path = "src/client.rs"
[dependencies]
tonic = "0.12"
prost = "0.13"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
[build-dependencies]
tonic-build = "0.12" |
@LucioFranco @zhiburt |
https://github.com/hyperium/tonic/blob/master/examples/helloworld-tutorial.md
Following the reference I was getting
Then I took a look at
build.rs
used inexamples
dir and in a bit different.And to fix it it was necessary to change a build.rs and Cargo.toml.
The text was updated successfully, but these errors were encountered: