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

tonic-build output #62

Closed
blittable opened this issue Oct 9, 2019 · 4 comments
Closed

tonic-build output #62

blittable opened this issue Oct 9, 2019 · 4 comments

Comments

@blittable
Copy link
Contributor

nice to have..

Some users may wish to use tonic-build as an separate step, so:

  1. If OUT_DIR is not correctly set, the error "No such file or directory" might be the proto sources or the generated directory. So, a better error message would be helpful.

Handled in this neighborhood:

  15: core::result::Result<T,E>::unwrap
             at /rustc/fa5c2f3e5724bce07bf1b70020e5745e7b693a57/src/libcore/result.rs:933
  16: tonic_build::fmt
             at /home/john/code/tonic/tonic-build/src/lib.rs:200
  17: tonic_build::Builder::compile
  1. The current output from a bin invocation:
 tonic_build::compile_protos("proto/helloworld/helloworld.proto")?;
out: Output { status: ExitStatus(ExitStatus(0)), stdout: "", stderr: "" }
out: Output { status: ExitStatus(ExitStatus(0)), stdout: "", stderr: "" }
out: Output { status: ExitStatus(ExitStatus(0)), stdout: "", stderr: "" }

It would be helpful if it detailed the generated files.

Alternatively, for 1 above - update the README to reflect the OUT_DIR requirement.

Version

tonic-benches v0.1.0 (/home/john/code/tonic/tonic-benches)
├── tonic v0.1.0-alpha.2 (/home/john/code/tonic/tonic)
└── tonic-build v0.1.0-alpha.2 (/home/john/code/tonic/tonic-build)
├── tonic v0.1.0-alpha.2 (/home/john/code/tonic/tonic) ()
├── tonic-build v0.1.0-alpha.2 (/home/john/code/tonic/tonic-build) (
)

Platform

l
Linux tribble 5.0.0-31-generic #33~18.04.1
-Ubuntu SMP Tue Oct 1 10:20:39 UTC 2019 x8
6_64 x86_64 x86_64 GNU/Linux

Crates

tonic-build

@LucioFranco
Copy link
Member

@blittable so its possible to set the out_dir config option in the tonic_build::Builder. We could probably provide a better error message though when out_dir does not exist.

@blittable
Copy link
Contributor Author

Thanks. I got there another way (macro was invoked after cargo bench command). I was also in a loop where I was told to set the out directory, and when I did such via the env variable, it then prepending the original out_dir to the macro invocation. I'll try to pin it down.

There are a couple of doc issues for this scenario (the readme doesn't make it explicit it's a build.rs and the api doc is not generating or missing). Is that WIP or best logged?

@LucioFranco
Copy link
Member

@blittable if there are doc things missing we should def open an issue. I'd love if we opened an issue around issues with building tonic stuff and made a list of things that were found to be difficult.

@blittable
Copy link
Contributor Author

good idea. opened #67 - closing here.

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