Skip to content

Commit 81cd611

Browse files
authored
fix(api): make proto/ vendor-able (console-rs#128)
I work with a large monorepo that `cargo vendor'`s all third-party code. We use tokio quite a bit, and want to experiment with `tokio/console` When vendoring `console-api` the `../proto` directory is lost, and the crate is unbuildable. I understand that keeping `proto/` as a top-level directory is probably desirable, so this change symlinks that directory into that sub-crate itself. My understanding is that this change may also be required once `console` is put on crates.io? `cargo vendor` before this change: ``` Cargo.toml build.rs src ``` after: ``` Cargo.toml build.rs proto src ``` This is basically copying what https://github.com/dtolnay/cxx does with symlinks
1 parent 95a6dab commit 81cd611

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

console-api/build.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ use std::error::Error;
22

33
fn main() -> Result<(), Box<dyn Error>> {
44
let iface_files = &[
5-
"../proto/trace.proto",
6-
"../proto/common.proto",
7-
"../proto/tasks.proto",
8-
"../proto/instrument.proto",
9-
"../proto/resources.proto",
10-
"../proto/async_ops.proto",
5+
"proto/trace.proto",
6+
"proto/common.proto",
7+
"proto/tasks.proto",
8+
"proto/instrument.proto",
9+
"proto/resources.proto",
10+
"proto/async_ops.proto",
1111
];
12-
let dirs = &["../proto"];
12+
let dirs = &["proto"];
1313

1414
tonic_build::configure()
1515
.build_client(true)

console-api/proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../proto

0 commit comments

Comments
 (0)