Open
Description
As seen previously in #222, proto path options may be specified from a different relative location, e.g., workspace root, while the build process is done from the working directory of the Rust package.
Adding a current_dir
option to prost_build::Config
will make it easier to easier to compile Rust protos where the proto files are in a source tree separate from the rust code without needing to specify a relative path from the rust package dir to the protos dir, for example in a repo like:
.
├── Cargo.lock
├── Cargo.toml
├── README.md
├── crates
│ ├── my-package
│ ├── Cargo.toml
│ ├── build.rs
│ └── src
│ └── lib.rs
├── protos
│ └── my_package
│ └── example.proto
└── protos.json
where the build.rs
, and its dependencies, gets protobuf information from protos.json
that may look like:
{
"packages": [
{
"name": "my-package",
"protobuf": {
"sources": [
{
"include": "./protos",
"protos": [
"my_package/example.proto"
]
}
]
}
}
]
}
It is awkward to specify that the include dir in the example would need to be ../../protos
just for Rust.
Metadata
Metadata
Assignees
Labels
No labels