Skip to content

Commit

Permalink
Fix simulator profile selection
Browse files Browse the repository at this point in the history
1. Fix Cargo.toml files to support building the simulator with different
   profiles
2. Update CI to test simulator with both profiles.
  • Loading branch information
jhand2 committed Dec 9, 2023
1 parent 674a175 commit f5a5fa4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ function build_rust_targets() {
cargo build --release --manifest-path crypto/Cargo.toml --no-default-features
cargo build --release --manifest-path platform/Cargo.toml --features=$profile --no-default-features
cargo build --release --manifest-path dpe/Cargo.toml --features=$profile --no-default-features
cargo build --release --manifest-path simulator/Cargo.toml #--features=$profile --no-default-features
cargo build --release --manifest-path simulator/Cargo.toml --features=$profile --no-default-features
cargo build --release --manifest-path tools/Cargo.toml --features=$profile --no-default-features

cargo build --manifest-path crypto/Cargo.toml --no-default-features
cargo build --manifest-path platform/Cargo.toml --features=$profile --no-default-features
cargo build --manifest-path dpe/Cargo.toml --features=$profile --no-default-features
cargo build --manifest-path simulator/Cargo.toml #--features=$profile
cargo build --manifest-path simulator/Cargo.toml --features=$profile --no-default-features
cargo build --manifest-path tools/Cargo.toml --features=$profile --no-default-features

cargo clippy --manifest-path crypto/Cargo.toml --no-default-features -- --deny=warnings
cargo clippy --manifest-path platform/Cargo.toml --features=$profile --no-default-features -- --deny=warnings
cargo clippy --manifest-path dpe/Cargo.toml --features=$profile --no-default-features -- --deny=warnings
cargo clippy --manifest-path simulator/Cargo.toml -- --deny=warnings #--features=$profile --no-default-features
cargo clippy --manifest-path simulator/Cargo.toml --features=$profile --no-default-features -- --deny=warnings
cargo clippy --manifest-path tools/Cargo.toml --features=$profile --no-default-features -- --deny=warnings
}

Expand All @@ -47,7 +47,7 @@ function test_rust_targets() {
cargo test --manifest-path platform/Cargo.toml --features=$profile --no-default-features
cargo test --manifest-path crypto/Cargo.toml --no-default-features
cargo test --manifest-path dpe/Cargo.toml --features=$profile --no-default-features
cargo test --manifest-path simulator/Cargo.toml #--features=$profile --no-default-features
cargo test --manifest-path simulator/Cargo.toml --features=$profile --no-default-features
}

# TODO: Support building the simulator for different profiles
Expand Down
6 changes: 3 additions & 3 deletions dpe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"

[features]
default = ["dpe_profile_p256_sha256"]
dpe_profile_p256_sha256 = []
dpe_profile_p384_sha384 = []
dpe_profile_p256_sha256 = ["platform/dpe_profile_p256_sha256"]
dpe_profile_p384_sha384 = ["platform/dpe_profile_p384_sha384"]

[dependencies]
bitflags = "2.4.0"
Expand All @@ -24,7 +24,7 @@ asn1 = "0.13.0"
openssl = "0.10.57"
x509-parser = "0.15.1"
crypto = {path = "../crypto", features = ["deterministic_rand", "openssl"]}
platform = {path = "../platform", features = ["openssl"]}
platform = {path = "../platform", default-features = false, features = ["openssl"]}
cms = "0.2.2"
der = "0.7.8"
spki = "0.7.2"
2 changes: 1 addition & 1 deletion platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ version = "0.1.0"
edition = "2021"

[features]
openssl = ["dep:openssl"]
default = ["dpe_profile_p256_sha256"]
openssl = ["dep:openssl"]
dpe_profile_p256_sha256 = []
dpe_profile_p384_sha384 = []

Expand Down

0 comments on commit f5a5fa4

Please sign in to comment.