Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use WORKSPACE_ROOT to resolve protos. #4597

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions oak_attestation_verification/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
"proto/attestation/reference_value.proto",
"proto/attestation/verification.proto",
];
prost_build::compile_protos(&proto_paths, &[env!("WORKSPACE_ROOT")])
.expect("proto compilation failed");
prost_build::compile_protos(&proto_paths, &[".."]).expect("proto compilation failed");

// Tell cargo to rerun this build script if the proto file has changed.
// https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorerun-if-changedpath
Expand Down
9 changes: 2 additions & 7 deletions oak_functions_abi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ fn main() {
"proto/oak_functions/abi.proto",
"proto/oak_functions/lookup_data.proto",
];
prost_build::compile_protos(&file_paths, &[env!("WORKSPACE_ROOT")])
.expect("proto compilation failed");
prost_build::compile_protos(&file_paths, &[".."]).expect("proto compilation failed");

// Tell cargo to rerun this build script if the proto file has changed.
// https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorerun-if-changedpath
for proto_path in file_paths.iter() {
let file_path = std::path::Path::new(proto_path);
println!(
"cargo:rerun-if-changed={}{}",
env!("WORKSPACE_ROOT"),
file_path.display()
);
println!("cargo:rerun-if-changed=../{}", file_path.display());
}
}
7 changes: 2 additions & 5 deletions oak_functions_launcher/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

// Generate micro RPC code for exchanging messages with the enclave.
micro_rpc_build::compile(
&[format!(
"{}proto/oak_functions/service/oak_functions.proto",
env!("WORKSPACE_ROOT")
)],
&[env!("WORKSPACE_ROOT")],
&["proto/oak_functions/service/oak_functions.proto"],
&[".."],
Default::default(),
);

Expand Down
7 changes: 2 additions & 5 deletions oak_functions_sdk/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@

fn main() {
micro_rpc_build::compile(
&[format!(
"{}proto/oak_functions/sdk/oak_functions_wasm.proto",
env!("WORKSPACE_ROOT")
)],
&[format!("{}proto/oak_functions/sdk", env!("WORKSPACE_ROOT"))],
&["proto/oak_functions/sdk/oak_functions_wasm.proto"],
&[".."],
Default::default(),
);
}
7 changes: 2 additions & 5 deletions oak_functions_service/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ use micro_rpc_build::ReceiverType;

fn main() {
micro_rpc_build::compile(
&[format!(
"{}proto/oak_functions/service/oak_functions.proto",
env!("WORKSPACE_ROOT")
)],
&[env!("WORKSPACE_ROOT")],
&["proto/oak_functions/service/oak_functions.proto"],
&[".."],
micro_rpc_build::CompileOptions {
receiver_type: ReceiverType::RefSelf,
bytes: vec![".oak.functions.LookupDataEntry".to_string()],
Expand Down
16 changes: 5 additions & 11 deletions oak_remote_attestation/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,12 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
micro_rpc_build::compile(
&[
&format!(
"{}oak_remote_attestation/proto/v1/messages.proto",
env!("WORKSPACE_ROOT")
),
&format!("{}proto/attestation/dice.proto", env!("WORKSPACE_ROOT")),
&format!("{}proto/attestation/evidence.proto", env!("WORKSPACE_ROOT")),
&format!(
"{}proto/attestation/endorsement.proto",
env!("WORKSPACE_ROOT")
),
"oak_remote_attestation/proto/v1/messages.proto",
"proto/attestation/dice.proto",
"proto/attestation/evidence.proto",
"proto/attestation/endorsement.proto",
],
&[env!("WORKSPACE_ROOT")],
&[".."],
Default::default(),
);

Expand Down