Skip to content

Commit d81a5d6

Browse files
Merge pull request #1144 from Luap99/OUT-DIR
generate protobuf in OUT_DIR
2 parents 03c09b6 + 6217c49 commit d81a5d6

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ targets/
55
netavark.1
66
vendor/
77
.idea/*
8-
src/proto-build/netavark_proxy.rs
98
contrib/systemd/*/*.service
109
.vscode*

build.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use chrono::{DateTime, Utc};
22
use std::env;
3-
use std::path::{Path, PathBuf};
3+
use std::path::Path;
44
use std::process::Command;
55

66
fn main() {
@@ -32,8 +32,7 @@ fn main() {
3232
.type_attribute(
3333
"netavark_proxy.NetworkConfig",
3434
"#[derive(serde::Serialize)]",
35-
)
36-
.out_dir(PathBuf::from("src/proto-build"));
35+
);
3736

3837
builder
3938
.compile_protos(&[Path::new("src/proto/proxy.proto")], &[Path::new("proto")])

src/dhcp_proxy/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use tower::service_fn;
1919

2020
#[allow(clippy::unwrap_used)]
2121
pub mod g_rpc {
22-
include!("../proto-build/netavark_proxy.rs");
22+
include!(concat!(env!("OUT_DIR"), "/netavark_proxy.rs"));
2323
use crate::dhcp_proxy::lib::VectorConv;
2424
use crate::dhcp_proxy::types::{CustomErr, ProxyError};
2525
use mozim::DhcpV4Lease;

src/proto-build/.proto-build

Whitespace-only changes.

0 commit comments

Comments
 (0)