From 9556bbc9a9673c5f063789b4acef78cef9a12612 Mon Sep 17 00:00:00 2001 From: liangxinyan Date: Tue, 17 Mar 2026 10:17:27 +0800 Subject: [PATCH] IssueNo: https://gitcode.com/openharmony/developtools_integration_verification/issues/562 Signed-off-by: liangxinyan --- .../rules/chipsetsdk_dep_whitelist.json | 28 +++++++++++++++++++ .../rules_checker/base_innerapi_rule.py | 5 ++++ tools/deps_guard/rules_checker/base_rule.py | 27 +++++++++--------- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/tools/deps_guard/rules/chipsetsdk_dep_whitelist.json b/tools/deps_guard/rules/chipsetsdk_dep_whitelist.json index ca09faa9..c1cc4888 100644 --- a/tools/deps_guard/rules/chipsetsdk_dep_whitelist.json +++ b/tools/deps_guard/rules/chipsetsdk_dep_whitelist.json @@ -13962,5 +13962,33 @@ "dep_file_name": "librk_vpuapi.so", "dep_file_path": "", "description": "system only module libomxvpu_enc.z.so depends on librk_vpuapi.so which is unknown so type" + }, + { + "so_file_name": "libcj_environment.z.so", + "so_file_path": "vendor/lib/passthrough/indirect/libomxvpu_enc.z.so", + "dep_file_name": "libz.so", + "dep_file_path": "", + "description": "system only module libomxvpu_enc.z.so depends on librk_vpuapi.so which is unknown so type" + }, + { + "so_file_name": "libcj_environment.z.so", + "so_file_path": "vendor/lib/passthrough/indirect/libomxvpu_enc.z.so", + "dep_file_name": "libnative_buffer.so", + "dep_file_path": "", + "description": "system only module libomxvpu_enc.z.so depends on librk_vpuapi.so which is unknown so type" + }, + { + "so_file_name": "libace_napi.z.so", + "so_file_path": "vendor/lib/passthrough/indirect/libomxvpu_enc.z.so", + "dep_file_name": "libz.so", + "dep_file_path": "", + "description": "system only module libomxvpu_enc.z.so depends on librk_vpuapi.so which is unknown so type" + }, + { + "so_file_name": "libace_napi.z.so", + "so_file_path": "vendor/lib/passthrough/indirect/libomxvpu_enc.z.so", + "dep_file_name": "libnative_buffer.so", + "dep_file_path": "", + "description": "system only module libomxvpu_enc.z.so depends on librk_vpuapi.so which is unknown so type" } ] diff --git a/tools/deps_guard/rules_checker/base_innerapi_rule.py b/tools/deps_guard/rules_checker/base_innerapi_rule.py index 152ea016..8b55e4b4 100644 --- a/tools/deps_guard/rules_checker/base_innerapi_rule.py +++ b/tools/deps_guard/rules_checker/base_innerapi_rule.py @@ -34,6 +34,7 @@ class BaseInnerapiRule(BaseRule): "passthrough_indirect"] + self.__ignored_tags self.__base_sofiles = ["libc.so", "libutils.z.so", "ld-musl-aarch64.so.1", "libconfiguration.z.so", "libusbmanager.z.so", "libsms.z.so"] + self.load_lists() def check(self): passed = True @@ -75,6 +76,8 @@ class BaseInnerapiRule(BaseRule): for dep_name in mod["missing"]: if dep_name in self.__base_sofiles: continue + if dep_name in self.get_allow_list(): + continue in_whitelist = False for so_dict in white_lists: for k, v in so_dict.items(): @@ -124,6 +127,8 @@ class BaseInnerapiRule(BaseRule): for dep_name in mod["missing"]: if dep_name in self.__base_sofiles: continue + if dep_name in self.get_vendor_allow_list(): + continue in_whitelist = False for so_dict in white_lists: for k, v in so_dict.items(): diff --git a/tools/deps_guard/rules_checker/base_rule.py b/tools/deps_guard/rules_checker/base_rule.py index 0bc7027b..c84ec7e8 100755 --- a/tools/deps_guard/rules_checker/base_rule.py +++ b/tools/deps_guard/rules_checker/base_rule.py @@ -30,6 +30,13 @@ class BaseRule(object): self.__out_path = mgr.get_product_out_path() self.__base_sofiles = ["libc.so", "libutils.z.so", "ld-musl-aarch64.so.1", "libconfiguration.z.so", "libusbmanager.z.so", "libsms.z.so"] + + def load_lists(self): + self.__passthroughs_lists = self.load_list_json("Passthrough", "passthrough_info.json") + self.__llndk_lists = self.load_list_json("LLndk", "llndk_info.json") + self.__chipsetsdksp_lists = self.load_list_json("ChipsetsdkSP", "chipsetsdk_sp_info.json") + self.__chipsetsdk_lists = self.load_list_json("ChipsetSDK", "chipsetsdk_info.json") + def load_files(self, name): rules_dir = [] rules_dir.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../rules")) @@ -130,6 +137,7 @@ class BaseRule(object): def check_if_deps_correctly(self, check_modules, valid_mod_tags, valid_dep_tags, white_lists): # check if mod and callee have wrong innerapi tags + self.load_lists() passed = True for mod in check_modules: innerapi_tags = mod["innerapi_tags"] @@ -206,17 +214,10 @@ class BaseRule(object): return passed def get_allow_list(self): - passthroughs = self.load_list.json("Passthrough", "passthrough_info.json") - llndk = self.load_list.json("LLndk", "llndk_info.json") - chipsetsdk_sp = self.load_list.json("ChipsetsdkSP", "chipsetsdk_sp_info.json") - return passthroughs + llndk + chipsetsdk_sp + return self.__passthroughs_lists + self.__llndk_lists + self.__chipsetsdksp_lists def get_vendor_allow_list(self): - passthroughs = self.load_list.json("Passthrough", "passthrough_info.json") - llndk = self.load_list.json("LLndk", "llndk_info.json") - chipsetsdk_sp = self.load_list.json("ChipsetsdkSP", "chipsetsdk_sp_info.json") - chipsetsdk = self.load_list.json("Chipsetsdk", "chipsetsdk_info.json") - return passthroughs + llndk + chipsetsdk_sp + chipsetsdk + return self.__passthroughs_lists + self.__llndk_lists + self.__chipsetsdksp_lists + self.__chipsetsdk_lists def parser_rules_file(self, rules_file, res): try: @@ -239,22 +240,22 @@ class BaseRule(object): def load_list_json(self, rule_name, name): rules_dir = [] if self._args and self._args.rules: - self.log("****add more chipsetsdk info in:{}****".format(self._args.rules)) + self.log("****add more info in:{}****".format(self._args.rules)) rules_dir = rules_dir + self._args.rules chipsetsdk_rules_path = self.get_out_path().replace("out", "out/products_ext") new_rule_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../rules") if os.path.exists(chipsetsdk_rules_path): rules_dir.append(chipsetsdk_rules_path) - self.log("****add more chipsetsdk info in dir:{}****".format(chipsetsdk_rules_path)) + self.log("****add more info in dir:{}****".format(chipsetsdk_rules_path)) elif os.path.exists(new_rule_path): rules_dir.append(new_rule_path) - self.log("****add chipsetsdk_rules_path path:{}****".format(new_rule_path)) + self.log("****add path:{}****".format(new_rule_path)) res = [] for d in rules_dir: rules_file = os.path.join(d, rule_name, name) if os.path.isfile(rules_file): - res = self.__parser_rules_file(rules_file, res) + res = self.parser_rules_file(rules_file, res) else: self.warn("****rules path not exist: {}****".format(rules_file))