tonic-build: (docs) adds NixOS related hints (#444)

This commit is contained in:
Amanjeev Sethi
2020-08-31 13:05:53 -04:00
committed by GitHub
parent 48d5248925
commit 92a7cc86a6
+15
View File
@@ -40,7 +40,22 @@
//! )?;
//! Ok(())
//! }
//!```
//!
//! ## NixOS related hints
//!
//! On NixOS, it is better to specify the location of `PROTOC` and `PROTOC_INCLUDE` explicitly.
//!
//! ```bash
//! $ export PROTOBUF_LOCATION=$(nix-env -q protobuf --out-path --no-name)
//! $ export PROTOC=$PROTOBUF_LOCATION/bin/protoc
//! $ export PROTOC_INCLUDE=$PROTOBUF_LOCATION/include
//! $ cargo build
//! ```
//!
//! The reason being that if `prost_build::compile_protos` fails to generate the resultant package,
//! the failure is not obvious until the `include!(concat!(env!("OUT_DIR"), "/resultant.rs"));`
//! fails with `No such file or directory` error.
#![recursion_limit = "256"]
#![warn(