Skip to content

Commit

Permalink
Don't rebuild existing protos in oak_containers_launcher
Browse files Browse the repository at this point in the history
Otherwise, we end up with two similarly-named types that aren't
compatible.

Change-Id: I915b766266060ae444ecb822d5fe7f77af9a3e26
  • Loading branch information
jblebrun committed Jul 12, 2024
1 parent 60e098d commit afcc181
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 26 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ oak_functions_containers_container_bundle_tar:
oak_functions_containers_launcher:
env cargo build --release --package='oak_functions_containers_launcher'

all_oak_functions_containers_binaries: stage0_bin stage1_cpio oak_containers_kernel oak_containers_system_image oak_functions_containers_container_bundle_tar oak_functions_containers_launcher
oak_functions_launcher:
env cargo build --release --package='oak_functions_launcher'

all_oak_functions_containers_binaries: stage0_bin stage1_cpio oak_containers_kernel oak_containers_system_image oak_functions_containers_container_bundle_tar oak_functions_containers_launcher oak_functions_launcher

ensure_no_std package:
RUSTFLAGS="-C target-feature=+sse,+sse2,+ssse3,+sse4.1,+sse4.2,+avx,+avx2,+rdrand,-soft-float" cargo build --target=x86_64-unknown-none --package='{{package}}'
Expand Down
6 changes: 2 additions & 4 deletions oak_containers_hello_world_untrusted_app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ mod proto {
mod app_client;

use oak_containers_launcher::{
proto::oak::{
key_provisioning::v1::{GetGroupKeysRequest, GetGroupKeysResponse},
session::v1::EndorsedEvidence,
},
proto::oak::key_provisioning::v1::{GetGroupKeysRequest, GetGroupKeysResponse},
Launcher,
};
use oak_proto_rust::oak::session::v1::EndorsedEvidence;

use crate::proto::oak::crypto::v1::{EncryptedRequest, EncryptedResponse};

Expand Down
2 changes: 0 additions & 2 deletions oak_containers_launcher/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ rust_library(
crate_name = "oak_containers_launcher",
deps = [
":build",
"//oak_attestation",
"//oak_crypto",
"//oak_proto_rust",
"@oak_crates_index//:anyhow",
"@oak_crates_index//:async-stream",
Expand Down
2 changes: 0 additions & 2 deletions oak_containers_launcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ env_logger = "*"
futures = "*"
log = "*"
nix = { version = "*", features = ["process"] }
oak_attestation = { workspace = true }
oak_crypto = { workspace = true }
oak_proto_rust = { workspace = true }
opentelemetry-proto = { version = "*", default-features = false, features = [
"gen-tonic",
Expand Down
14 changes: 10 additions & 4 deletions oak_containers_launcher/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use oak_grpc_utils::{generate_grpc_code, CodegenOptions};
use oak_grpc_utils::{generate_grpc_code, CodegenOptions, ExternPath};

fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(not(feature = "bazel"))]
Expand All @@ -25,13 +25,19 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
generate_grpc_code(
&[
"../proto/containers/interfaces.proto",
"../proto/crypto/crypto.proto",
"../proto/key_provisioning/key_provisioning.proto",
"../proto/containers/hostlib_key_provisioning.proto",
"../proto/session/messages.proto",
],
&included_protos,
CodegenOptions { build_client: true, build_server: true, ..Default::default() },
CodegenOptions {
build_client: true,
build_server: true,
extern_paths: vec![
ExternPath::new(".oak.crypto.v1", "::oak_proto_rust::oak::crypto::v1"),
ExternPath::new(".oak.session.v1", "::oak_proto_rust::oak::session::v1"),
ExternPath::new(".oak.attestation.v1", "::oak_proto_rust::oak::attestation::v1"),
],
},
)?;

Ok(())
Expand Down
14 changes: 5 additions & 9 deletions oak_containers_launcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub mod proto {
tonic::include_proto!("oak.containers.v1");
}
}
pub use oak_attestation::proto::oak::{attestation, session};
pub use oak_proto_rust::oak::crypto;
pub mod key_provisioning {
pub mod v1 {
#![allow(clippy::return_self_not_must_use)]
Expand All @@ -44,8 +42,9 @@ use std::{

use anyhow::Context;
use clap::{Parser, ValueEnum};
use oak_proto_rust::oak::attestation::v1::{
endorsements, Endorsements, Evidence, OakRestrictedKernelEndorsements,
use oak_proto_rust::oak::{
attestation::v1::{endorsements, Endorsements, Evidence, OakRestrictedKernelEndorsements},
session::v1::EndorsedEvidence,
};
pub use qemu::Params as QemuParams;
use tokio::{
Expand All @@ -57,11 +56,8 @@ use tokio::{
use tokio_vsock::{VsockAddr, VsockListener, VMADDR_CID_HOST};
use tonic::transport::Channel as TonicChannel;

use crate::proto::oak::{
key_provisioning::v1::{
key_provisioning_client::KeyProvisioningClient, GetGroupKeysRequest, GetGroupKeysResponse,
},
session::v1::EndorsedEvidence,
use crate::proto::oak::key_provisioning::v1::{
key_provisioning_client::KeyProvisioningClient, GetGroupKeysRequest, GetGroupKeysResponse,
};
pub use crate::qemu::VmType;

Expand Down
1 change: 0 additions & 1 deletion oak_functions_containers_launcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ clap = { version = "*", features = ["derive"] }
env_logger = "*"
futures = "*"
log = "*"
oak_attestation = { workspace = true }
oak_containers_launcher = { workspace = true }
oak_crypto = { workspace = true }
oak_functions_launcher = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions oak_proto_rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
"../proto/oak_functions/application_config.proto",
"../proto/oak_functions/lookup_data.proto",
"../proto/session/session.proto",
"../proto/session/messages.proto",
"../proto/oak_functions/sdk/oak_functions_wasm.proto",
"../proto/oak_functions/service/oak_functions.proto",
"../proto/oak_functions/testing.proto",
Expand Down

0 comments on commit afcc181

Please sign in to comment.