Skip to content

Commit

Permalink
Introduced a Rust workspace for consolidating build dependencies
Browse files Browse the repository at this point in the history
Note that this workspace only includes the high-level
(platform-agnostic?) Veracruz libraries. This specifically excludes:

- rust-examples/*, which compile to WebAssembly

- runtime-manager/root-enclaves, sdks which have special requirements

This was a surprisingly unintrusive change, though required a few
tweaks:

- Fixed dependencies that disagreed, this is probably a good thing
  anyways

- Consolidated build profiles. There are package-specific
  build-profiles, but the only customization we had was for
  profile.release, and I suspect the crates that didn't customize
  profile.release were just never compiled outside of debug mode.

- Consolidated patches. This is probably a good thing as I suspect that
  the patches were required for all dependent crates, and this will
  reduce mistakes when adding new crates in the future.
  • Loading branch information
geky committed Aug 13, 2021
1 parent c0ca927 commit a3da971
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 62 deletions.
59 changes: 59 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[workspace]
members = [
"execution-engine",
"nitro-root-enclave-server",
"platform-services",
"proxy-attestation-server",
"psa-attestation",
"runtime-manager-bind",
"sdk/data-generators/*",
"sdk/freestanding-execution-engine",
"session-manager",
"sgx-root-enclave-bind",
"test-collateral/generate-policy",
"transport-protocol",
"veracruz-client",
"veracruz-server",
"veracruz-server-test",
"veracruz-test",
"veracruz-utils",
]
exclude = [
# we exclude rust-examples as these are actually WebAssembly programs
"sdk/rust-examples",
# we also exclude all enclaves as these require special build rules
"nitro-root-enclave",
"runtime-manager",
"sgx-root-enclave",
# and other non-native dependendencies
"incubator-teaclave-sgx-sdk",
"third-party",
"veracruz-mcu-client",
]

[profile.release]
lto = true
codegen-units = 1
opt-level = 3

# patches for SGX
[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_ucrypto.git = "https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git"
sgx_ucrypto.branch = "veracruz"
sgx_ucrypto.optional = true

sgx_types.git = "https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git"
sgx_types.branch = "veracruz"
sgx_types.optional = true

sgx_alloc.git = "https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git"
sgx_alloc.branch = "veracruz"
sgx_alloc.optional = true

[patch.crates-io]
rustls.git = "https://github.com/veracruz-project/rustls.git"
rustls.branch = "veracruz"

serde.git = "https://github.com/veracruz-project/serde.git"
serde.features = ["derive"]
serde.branch = "veracruz"
6 changes: 0 additions & 6 deletions execution-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,3 @@ cfg-if = "1"
name = "execution_engine"
path = "./src/lib.rs"

[patch.crates-io]
serde = { git = "https://github.com/veracruz-project/serde.git", features=["derive"], branch = "veracruz" }

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_alloc = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }
sgx_tstd = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }
4 changes: 0 additions & 4 deletions platform-services/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ nsm_io = { git = "https://github.com/aws/aws-nitro-enclaves-nsm-api.git/", bran
sgx_trts = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
optee-utee = { git = "https://github.com/veracruz-project/rust-optee-trustzone-sdk.git", branch = "veracruz", optional = true }

[profile.release]
lto=true
opt-level = 3
codegen-units = 1
3 changes: 0 additions & 3 deletions proxy-attestation-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,3 @@ sgx_urts = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.g
sgx-root-enclave-bind = { path = "../sgx-root-enclave-bind" }
psa-attestation = { path = "../psa-attestation" }

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_ucrypto = { git = "https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git", branch="veracruz", optional = true }
sgx_types = { git = "https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git", branch="veracruz", optional = true }
7 changes: 1 addition & 6 deletions sdk/data-generators/csv-encoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ bitflags = "=1.2.1"
clap = "2.33.0"
csv = "1.0"
env_logger = "0.7.1"
log = "0.4.8"
log = "=0.4.13"
pinecone = "*"
serde = { version = "1.0.103", features = ["derive"] }
toml = "0.5.6"

[profile.release]
lto = true
codegen-units = 1
opt-level = 3

5 changes: 0 additions & 5 deletions sdk/data-generators/shamir-secret-sharing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ authors = ["The Veracruz Development Team"]
edition = "2018"
description = "A utility for generating secrets for Veracruz's Shamir secret sharing example."

[profile.release]
lto = true
opt-level = 3
codegen-units = 1

[dependencies]
structopt = { version="0.3", features=["wrap_help"] }
rand = "0.8.3"
Expand Down
6 changes: 1 addition & 5 deletions sdk/freestanding-execution-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ veracruz-utils = { path = "../../veracruz-utils", features = ["std"] }
clap = "2.33.3"
bitflags = "=1.2.1"
env_logger = "0.7.1"
log = "0.4.8"
log = "=0.4.13"
serde = { version = "1.0.103", features = ["derive"] }
toml = "0.5.5"
wast = "=35.0.0"
Expand All @@ -24,7 +24,3 @@ wasi-types = { git = "https://github.com/veracruz-project/wasi-types.git", branc
name = "freestanding-execution-engine"
path = "src/main.rs"

[profile.release]
lto = true
codegen-units = 1
opt-level = 3
2 changes: 0 additions & 2 deletions session-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.g
sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
optee-utee = { git = "https://github.com/veracruz-project/rust-optee-trustzone-sdk.git", branch = "veracruz", optional = true }

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_alloc = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }
2 changes: 1 addition & 1 deletion test-collateral/generate-policy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ chrono = "0.4.19"
clap = "2.33.3"
data-encoding = "2.3.2"
env_logger = "0.8.2"
log = "0.4.14"
log = "=0.4.13"
ring = { git = "https://github.com/veracruz-project/ring.git", branch = "veracruz", features = ["non_sgx"] }
veracruz-utils = {path = "../../veracruz-utils", features = ["std"]}
serde = { git = "https://github.com/veracruz-project/serde.git", branch = "veracruz", features = ["std"] }
Expand Down
2 changes: 0 additions & 2 deletions transport-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.g
[build-dependencies]
protoc-rust = { git = "https://github.com/veracruz-project/rust-protobuf.git", branch = "veracruz" }

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_alloc = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }
2 changes: 0 additions & 2 deletions trustzone-root-enclave/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ bitflags = "=1.2.1"
[build-dependencies]
uuid = { version = "=0.7.4", features = ["v4"] }

[profile.release]
lto = true
8 changes: 1 addition & 7 deletions veracruz-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,13 @@ sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.
sgx_ucrypto = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
structopt = { version = "0.3", optional = true, features = ["wrap_help"] }
env_logger = { version = "0.7", optional = true }
log = { version = "0.4", optional = true }
log = { version = "=0.4.13", optional = true }
bitflags = "=1.2.1"

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_ucrypto = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }
sgx_types = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }

[dev-dependencies]
actix-web = "3.3.2"
futures = "0.3"
actix-rt = "1.1.1"
actix-session = "0.4.1"
actix-http = "2.2.0"

[patch.crates-io]
rustls = { git = "https://github.com/veracruz-project/rustls.git", branch = "self_signed" }
8 changes: 0 additions & 8 deletions veracruz-server-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,4 @@ sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.
sgx_ucrypto = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
sgx_urts = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_ucrypto = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }
sgx_types = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }
sgx_alloc = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }

[patch.crates-io]
rustls = { git = "https://github.com/veracruz-project/rustls.git", branch = "veracruz" }


2 changes: 1 addition & 1 deletion veracruz-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ lazy_static = "1.4"
actix-web = "3.3.2"
actix-http = "2.2.0"
futures = "0.3"
log = "0.4"
log = "=0.4.13"
err-derive = "0.2"
pinecone = "0.2"
hex = "=0.4.2"
Expand Down
5 changes: 0 additions & 5 deletions veracruz-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,3 @@ sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.
sgx_ucrypto = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
sgx_alloc = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_ucrypto = { git = "https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git", branch="veracruz", optional = true }
sgx_types = { git = "https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git", branch="veracruz", optional = true }
sgx_alloc = { git = "https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git", branch="veracruz", optional = true }

5 changes: 0 additions & 5 deletions veracruz-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,3 @@ ring = { git = "https://github.com/veracruz-project/ring.git", version = "=0.16.
[build-dependencies]
uuid = { version = "0.7", features = ["v4"] }

[patch.crates-io]
rustls = { git = "https://github.com/veracruz-project/rustls.git", branch = "self_signed", optional = true }

[patch."https://github.com/apache/teaclave-sgx-sdk.git"]
sgx_alloc = { branch="veracruz", git = 'https://github.com/veracruz-project/incubator-teaclave-sgx-sdk.git', optional = true }

0 comments on commit a3da971

Please sign in to comment.