diff --git a/deny.toml b/deny.toml index 82e692829d8..1ea0bab3d27 100644 --- a/deny.toml +++ b/deny.toml @@ -19,6 +19,7 @@ allow = [ "ISC", "MIT", "OpenSSL", + "Zlib", ] [[licenses.clarify]] diff --git a/examples/Cargo.lock b/examples/Cargo.lock index 15df2ed5280..d2b62f9ee57 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock @@ -69,7 +69,7 @@ dependencies = [ "aggregator_grpc", "assert_matches", "env_logger", - "itertools 0.9.0", + "itertools", "log", "maplit", "oak", @@ -789,15 +789,6 @@ dependencies = [ "libc", ] -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.9.0" @@ -1121,7 +1112,7 @@ dependencies = [ "futures-util", "http", "hyper", - "itertools 0.9.0", + "itertools", "jsonwebtoken", "lazy_static", "log", @@ -1420,8 +1411,6 @@ dependencies = [ [[package]] name = "prost" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" dependencies = [ "bytes", "prost-derive", @@ -1430,12 +1419,10 @@ dependencies = [ [[package]] name = "prost-build" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" dependencies = [ "bytes", "heck", - "itertools 0.8.2", + "itertools", "log", "multimap", "petgraph", @@ -1448,11 +1435,9 @@ dependencies = [ [[package]] name = "prost-derive" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" dependencies = [ "anyhow", - "itertools 0.8.2", + "itertools", "proc-macro2", "quote", "syn", @@ -1461,8 +1446,6 @@ dependencies = [ [[package]] name = "prost-types" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" dependencies = [ "bytes", "prost", diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 11a883fcb0c..519ab633621 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -51,3 +51,7 @@ trusted_information_retrieval_client = { path = "trusted_information_retrieval/c # Third party. expect = { path = "../third_party/expect" } roughenough = { path = "../third_party/roughenough" } +prost = { path = "../third_party/prost" } +prost-build = { path = "../third_party/prost/prost-build" } +prost-derive = { path = "../third_party/prost/prost-derive" } +prost-types = { path = "../third_party/prost/prost-types" } diff --git a/oak/server/Cargo.lock b/oak/server/Cargo.lock index 05473ef9b43..199d6b23d4b 100644 --- a/oak/server/Cargo.lock +++ b/oak/server/Cargo.lock @@ -465,14 +465,6 @@ dependencies = [ "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "itertools" version = "0.9.0" @@ -666,9 +658,9 @@ version = "0.1.0" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "oak_utils 0.1.0", - "prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-build 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost 0.6.1", + "prost-build 0.6.1", + "prost-types 0.6.1", ] [[package]] @@ -682,7 +674,7 @@ dependencies = [ "oak_abi 0.1.0", "oak_runtime 0.1.0", "oak_utils 0.1.0", - "prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost 0.6.1", "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "signal-hook 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -710,9 +702,9 @@ dependencies = [ "oak_abi 0.1.0", "oak_utils 0.1.0", "prometheus 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-build 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost 0.6.1", + "prost-build 0.6.1", + "prost-types 0.6.1", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -734,8 +726,8 @@ dependencies = [ "anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-build 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost 0.6.1", + "prost-build 0.6.1", "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tonic-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -872,25 +864,23 @@ dependencies = [ [[package]] name = "prost" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost-derive 0.6.1", ] [[package]] name = "prost-build" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "multimap 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "petgraph 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost 0.6.1", + "prost-types 0.6.1", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "which 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -898,10 +888,9 @@ dependencies = [ [[package]] name = "prost-derive" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", @@ -910,10 +899,9 @@ dependencies = [ [[package]] name = "prost-types" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost 0.6.1", ] [[package]] @@ -1378,8 +1366,8 @@ dependencies = [ "hyper 0.13.6 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project 0.4.22 (registry+https://github.com/rust-lang/crates.io-index)", - "prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost 0.6.1", + "prost-derive 0.6.1", "tokio 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1398,7 +1386,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "prost-build 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "prost-build 0.6.1", "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1948,7 +1936,6 @@ dependencies = [ "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum indexmap 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" "checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" "checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" "checksum js-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "ce10c23ad2ea25ceca0093bd3192229da4c5b3c0f2de499c1ecac0d98d452177" @@ -1990,10 +1977,6 @@ dependencies = [ "checksum proc-macro-nested 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" "checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" "checksum prometheus 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0575e258dab62268e7236d7307caa38848acbda7ec7ab87bd9093791e999d20" -"checksum prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" -"checksum prost-build 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" -"checksum prost-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" -"checksum prost-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" "checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" "checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" diff --git a/oak/server/Cargo.toml b/oak/server/Cargo.toml index 1c22d0b1d4a..98a3f03642b 100644 --- a/oak/server/Cargo.toml +++ b/oak/server/Cargo.toml @@ -14,3 +14,7 @@ oak_runtime = { path = "rust/oak_runtime" } oak_utils = { path = "../../oak_utils" } # Third party. roughenough = { path = "../../third_party/roughenough" } +prost = { path = "../../third_party/prost" } +prost-derive = { path = "../../third_party/prost/prost-derive" } +prost-build = { path = "../../third_party/prost/prost-build" } +prost-types = { path = "../../third_party/prost/prost-types" } diff --git a/oak_abi/Cargo.lock b/oak_abi/Cargo.lock index a17f5042876..7fa3fc3d389 100644 --- a/oak_abi/Cargo.lock +++ b/oak_abi/Cargo.lock @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.8.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" dependencies = [ "either", ] @@ -155,8 +155,6 @@ dependencies = [ [[package]] name = "prost" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" dependencies = [ "bytes", "prost-derive", @@ -165,8 +163,6 @@ dependencies = [ [[package]] name = "prost-build" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" dependencies = [ "bytes", "heck", @@ -183,8 +179,6 @@ dependencies = [ [[package]] name = "prost-derive" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" dependencies = [ "anyhow", "itertools", @@ -196,8 +190,6 @@ dependencies = [ [[package]] name = "prost-types" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" dependencies = [ "bytes", "prost", diff --git a/oak_abi/Cargo.toml b/oak_abi/Cargo.toml index 4176f12aef8..8f8ca8f5cfc 100644 --- a/oak_abi/Cargo.toml +++ b/oak_abi/Cargo.toml @@ -15,3 +15,8 @@ prost-types = "*" [build-dependencies] oak_utils = { path = "../oak_utils" } prost-build = "*" + +[patch.crates-io] +prost-build = { path = "../third_party/prost/prost-build" } +prost = { path = "../third_party/prost" } +prost-types = { path = "../third_party/prost/prost-types" } diff --git a/oak_abi/build.rs b/oak_abi/build.rs index 8e24e0ccc26..746b7ab7cd7 100644 --- a/oak_abi/build.rs +++ b/oak_abi/build.rs @@ -14,10 +14,10 @@ // limitations under the License. // +// Keep clippy from complaining about a needless call to `Default::default()`. +#[allow(clippy::needless_update)] fn main() { - // Exclude generation of service code, as it would require a reference to the Oak SDK to - // compile. - oak_utils::compile_protos_without_services( + oak_utils::compile_protos_with_options( &[ "../oak/proto/application.proto", "../oak/proto/grpc_encap.proto", @@ -29,5 +29,11 @@ fn main() { "../third_party/google/rpc/status.proto", ], &[".."], + oak_utils::ProtoOptions { + // Exclude generation of service code, as it would require a reference to the Oak SDK to + // compile. + generate_services: false, + ..Default::default() + }, ); } diff --git a/oak_utils/Cargo.lock b/oak_utils/Cargo.lock index cf62a6751ee..e0439675513 100644 --- a/oak_utils/Cargo.lock +++ b/oak_utils/Cargo.lock @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.8.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" dependencies = [ "either", ] @@ -144,8 +144,6 @@ dependencies = [ [[package]] name = "prost" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" dependencies = [ "bytes", "prost-derive", @@ -154,8 +152,6 @@ dependencies = [ [[package]] name = "prost-build" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" dependencies = [ "bytes", "heck", @@ -172,8 +168,6 @@ dependencies = [ [[package]] name = "prost-derive" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" dependencies = [ "anyhow", "itertools", @@ -185,8 +179,6 @@ dependencies = [ [[package]] name = "prost-types" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" dependencies = [ "bytes", "prost", diff --git a/oak_utils/Cargo.toml b/oak_utils/Cargo.toml index 2046eb7bbf0..acb2de81668 100644 --- a/oak_utils/Cargo.toml +++ b/oak_utils/Cargo.toml @@ -22,3 +22,7 @@ tonic-build = { version = "*", default-features = false, features = [ "prost", "transport" ] } + +[patch.crates-io] +prost-build = { path = "../third_party/prost/prost-build" } +prost = { path = "../third_party/prost" } diff --git a/oak_utils/src/lib.rs b/oak_utils/src/lib.rs index c45c5efcb93..a817a6ae4b7 100644 --- a/oak_utils/src/lib.rs +++ b/oak_utils/src/lib.rs @@ -163,6 +163,25 @@ impl prost_build::ServiceGenerator for OakServiceGenerator { } } +/// Options for generating Protocol buffer Rust types. +pub struct ProtoOptions { + /// Generate Oak-specific service code for inter-node communication. + /// + /// Default: **true**. + /// + /// Generated code depends on the `oak` SDK crate. + pub generate_services: bool, +} + +/// The default option values. +impl Default for ProtoOptions { + fn default() -> ProtoOptions { + ProtoOptions { + generate_services: true, + } + } +} + /// Build Rust code corresponding to a set of protocol buffer message and service definitions, /// emitting generated code to crate's `OUT_DIR`. For gRPC service definitions, this /// function generates Oak-specific code that is suitable for use inside an Oak Node (i.e. *not* @@ -171,22 +190,16 @@ pub fn compile_protos
(inputs: &[P], includes: &[P])
where
P: AsRef (inputs: &[P], includes: &[P])
+/// Like `compile_protos`, but allows for configuring options through `ProtoOptions`.
+pub fn compile_protos_with_options (inputs: &[P], includes: &[P], options: ProtoOptions)
where
P: AsRef (generate_services: bool, inputs: &[P], includes: &[P])
-where
- P: AsRef