tonic-build: (docs) adds NixOS related hints (#444)
This commit is contained in:
@@ -40,7 +40,22 @@
|
|||||||
//! )?;
|
//! )?;
|
||||||
//! Ok(())
|
//! 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"]
|
#![recursion_limit = "256"]
|
||||||
#![warn(
|
#![warn(
|
||||||
|
|||||||
Reference in New Issue
Block a user