From e8f71df12a2027b8fd0571cbf80489ded8f417aa Mon Sep 17 00:00:00 2001 From: wangyinghao Date: Mon, 26 May 2025 19:01:42 +0800 Subject: [PATCH] Fix dependency issues in tests Signed-off-by: wangyinghao Change-Id: If8bfc2f57f505fab67c59642f85989d65570a5dd Signed-off-by: wangyinghao --- bundle.json | 4 +++- services/key_enable/BUILD.gn | 4 ++-- services/key_enable/utils/BUILD.gn | 1 + test/common/BUILD.gn | 1 + test/unittest/BUILD.gn | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bundle.json b/bundle.json index 784acc6..39019e5 100644 --- a/bundle.json +++ b/bundle.json @@ -47,7 +47,9 @@ "screenlock_mgr", "common_event_service", "bounds_checking_function", - "rust_rust-openssl" + "rust_rust-openssl", + "selinux", + "rust_cxx" ], "third_party": [] }, diff --git a/services/key_enable/BUILD.gn b/services/key_enable/BUILD.gn index dc26b9e..03629e7 100644 --- a/services/key_enable/BUILD.gn +++ b/services/key_enable/BUILD.gn @@ -31,12 +31,12 @@ ohos_rust_executable("key_enable") { external_deps = common_external_deps if (!ohos_indep_compiler_enable) { deps += [ - "//third_party/rust/crates/cxx:lib", "//third_party/rust/crates/lazy-static.rs:lib", ] external_deps += [ "c_utils:utils_rust", "rust_rust-openssl:lib", + "rust_cxx:lib", ] } rustenv = [] @@ -62,12 +62,12 @@ ohos_rust_shared_ffi("key_enable_lib") { external_deps = common_external_deps if (!ohos_indep_compiler_enable) { deps += [ - "//third_party/rust/crates/cxx:lib", "//third_party/rust/crates/lazy-static.rs:lib", ] external_deps += [ "c_utils:utils_rust", "rust_rust-openssl:lib", + "rust_cxx:lib", ] } rustenv = [] diff --git a/services/key_enable/utils/BUILD.gn b/services/key_enable/utils/BUILD.gn index 0dece6e..80b4438 100644 --- a/services/key_enable/utils/BUILD.gn +++ b/services/key_enable/utils/BUILD.gn @@ -39,6 +39,7 @@ ohos_static_library("libkey_enable_utils") { "hilog:libhilog", "init:libbegetutil", "samgr:samgr_proxy", + "eventhandler:libeventhandler", ] defines = [] diff --git a/test/common/BUILD.gn b/test/common/BUILD.gn index e2597ab..1db7bb9 100644 --- a/test/common/BUILD.gn +++ b/test/common/BUILD.gn @@ -53,6 +53,7 @@ ohos_source_set("code_sign_test_common_source_set") { "access_token:libtokensetproc_shared", "c_utils:utils", "hilog:libhilog", + "ipc:ipc_core", ] subsystem_name = "security" part_name = "code_signature" diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 0a3e441..ee2890d 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -280,7 +280,6 @@ ohos_rust_static_library("rust_key_enable_lib") { sources = [ "${code_signature_root_dir}/services/key_enable/src/lib.rs" ] deps = [ "${code_signature_root_dir}/services/key_enable/utils:libkey_enable_utils", - "//third_party/rust/crates/cxx:lib", "//third_party/rust/crates/lazy-static.rs:lib", ] external_deps = [ @@ -289,6 +288,7 @@ ohos_rust_static_library("rust_key_enable_lib") { "hisysevent:hisysevent_rust", "rust_rust-openssl:lib", "ylong_json:lib", + "rust_cxx:lib" ] rustenv = [] if (build_variant == "root") { @@ -431,7 +431,7 @@ group("unittest_group") { ":multi_thread_local_sign_unittest", ":sign_and_enforce_unittest", ] - if (!use_clang_coverage) { + if (!use_clang_coverage && !ohos_indep_compiler_enable) { deps += [ ":rust_key_enable_unittest" ] } if (code_signature_support_oh_code_sign) { -- Gitee