From b5b9a325d79956caeade61d2189fd162d10e4221 Mon Sep 17 00:00:00 2001 From: Hyounggyu Choi Date: Tue, 7 May 2024 08:23:22 +0200 Subject: [PATCH] AS: Make verifier configurable differently for s390x We are encountering an issue on s390x when compiling AS with `all-verifier`. The error message is as follows: ``` error: failed to run custom build command for `tss-esapi-sys v0.5.0` ``` A platform-specific verifier (e.g., `se-verifier`) is used here. (https://github.com/confidential-containers/guest-components/pull/492) Although we can easily configure the verifier using `--features`, this approach lacks flexibility when the crate is selectively called from outside (e.g., kbs) based on `target_arch`. The optimal solution would be to open up room for configuring the verifier at a `dependencies` level rather than a `features` level. This commit aims to remove `all-verifier` from the default feature set and configure it differently for s390x. Signed-off-by: Hyounggyu Choi --- attestation-service/attestation-service/Cargo.toml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/attestation-service/attestation-service/Cargo.toml b/attestation-service/attestation-service/Cargo.toml index d3bda03d33..dc6fd49906 100644 --- a/attestation-service/attestation-service/Cargo.toml +++ b/attestation-service/attestation-service/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [features] -default = [ "restful-bin", "rvps-grpc", "rvps-builtin", "all-verifier" ] +default = [ "restful-bin", "rvps-grpc", "rvps-builtin" ] all-verifier = [ "verifier/all-verifier" ] tdx-verifier = [ "verifier/tdx-verifier" ] sgx-verifier = [ "verifier/sgx-verifier" ] @@ -62,7 +62,12 @@ thiserror = { workspace = true, optional = true } tokio.workspace = true tonic = { workspace = true, optional = true } uuid = { version = "1.1.2", features = ["v4"] } -verifier = { path = "../verifier", default-features = false } + +[target.'cfg(not(target_arch = "s390x"))'.dependencies] +verifier = { path = "../verifier", default-features = false, features = ["all-verifier"] } + +[target.'cfg(target_arch = "s390x")'.dependencies] +verifier = { path = "../verifier", default-features = false, features = ["se-verifier"] } [build-dependencies] shadow-rs.workspace = true