From 79bfbeaf260b6e2258aaa5abe1ea7a7a49fd841d Mon Sep 17 00:00:00 2001 From: liangxinyan Date: Thu, 3 Jul 2025 18:06:06 +0800 Subject: [PATCH 1/2] IssueNo: https://gitee.com/openharmony/developtools_integration_verification/issues/ICIF1H Signed-off-by: liangxinyan --- .../rules/ChipsetSDK/chipsetsdk_info.json | 54 +++++++++++++++++ .../ChipsetsdkSP/chipsetsdk_sp_info.json | 60 +++++++++++++++++++ .../rules/Passthrough/passthrough_info.json | 24 ++++++++ .../rules_checker/base_innerapi_rule.py | 6 +- tools/deps_guard/rules_checker/base_rule.py | 6 +- tools/deps_guard/rules_checker/chipsetsdk.py | 6 +- .../deps_guard/rules_checker/chipsetsdk_sp.py | 23 +++++-- tools/deps_guard/rules_checker/passthrough.py | 4 +- 8 files changed, 167 insertions(+), 16 deletions(-) diff --git a/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_info.json b/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_info.json index f792a7e..0a03e09 100644 --- a/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_info.json +++ b/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_info.json @@ -671,5 +671,59 @@ "so_file_name": "libyuv.z.so", "path": "", "headers": [] + }, + { + "name": "hdf:libdisplay_buffer_proxy_1.2", + "so_file_name": "libpower_proxy_1.2.z.so", + "path": "", + "headers": [] + }, + { + "name": "hdf:libdisplay_buffer_hdi_impl_v1_1", + "so_file_name": "libdisplay_buffer_hdi_impl_v1_1.z.so", + "path": "", + "headers": [] + }, + { + "name": "hdf:libsensor_proxy_3.0", + "so_file_name": "libsensor_proxy_3.0.z.so", + "path": "", + "headers": [] + }, + { + "name": "hdf:libdisplay_buffer_proxy_1.1", + "so_file_name": "libdisplay_buffer_proxy_1.1.z.so", + "path": "", + "headers": [] + }, + { + "name": "hdf:libdisplay_buffer_proxy_1.3", + "so_file_name": "libpower_proxy_1.3.z.so", + "path": "", + "headers": [] + }, + { + "name": "hdf:libsensor_proxy_2.0", + "so_file_name": "libsensor_proxy_2.0.z.so", + "path": "", + "headers": [] + }, + { + "name": "hdf:libdisplay_buffer_hdi_impl", + "so_file_name": "libdisplay_buffer_hdi_impl.z.so", + "path": "", + "headers": [] + }, + { + "name": "hdf:libdisplay_buffer_hdi_impl_v1_2", + "so_file_name": "libdisplay_buffer_hdi_impl_v1_2.z.so", + "path": "", + "headers": [] + }, + { + "name": "thirdparty:turbojpeg", + "so_file_name": "libturbojpeg.z.so", + "path": "", + "headers": [] } ] diff --git a/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json b/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json index 4cbf06e..5d76f79 100755 --- a/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json +++ b/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json @@ -130,5 +130,65 @@ "so_file_name": "libc++.so", "path": "//build/common/musl:musl-libcxx.so", "headers": [] + }, + { + "name": "build_framework:libc++_shared.so", + "so_file_name": "libc++_shared.so", + "path": "//build/common/libcpp:libc++_shared.so", + "headers": [] + }, + { + "name": "hiviewdfx:libhitracechain", + "so_file_name": "libhitracechain.so", + "path": "//base/hiviewdfx/hitrace/interfaces/native/innerkits:libhitracechain", + "headers": [] + }, + { + "name": "systemabilitymgr:samgr_proxy", + "so_file_name": "libsamgr_proxy.z.so", + "path": "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", + "headers": [] + }, + { + "name": "customization:configpolicy_util", + "so_file_name": "libconfigpolicy_util.z.so", + "path": "//base/customization/config_policy/frameworks/config_policy:configpolicy_util", + "headers": [] + }, + { + "name": "hiviewdfx:libhisysevent", + "so_file_name": "libhisysevent.z.so", + "path": "//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent:libhisysevent", + "headers": [] + }, + { + "name": "startup:libbeget_proxy", + "so_file_name": "libbeget_proxy.z.so", + "path": "//base/startup/init/interfaces/innerkits:libbeget_proxy", + "headers": [] + }, + { + "name": "hdf_core:libhdf_ipc_adapter", + "so_file_name": "libhdf_ipc_adapter.z.so", + "path": "//drivers/hdf_core/adapter/uhdf2/ipc:libhdf_ipc_adapter", + "headers": [] + }, + { + "name": "thirdparty:jsoncpp", + "so_file_name": "libjsoncpp.z.so", + "path": "//third_party/jsoncpp:jsoncpp", + "headers": [] + }, + { + "name": "commonlibrary:libdmabufheap", + "so_file_name": "libdmabufheap.z.so", + "path": "//commonlibrary/memory_utils/libdmabufheap:libdmabufheap", + "headers": [] + }, + { + "name": "thirdparty:shared_libz", + "so_file_name": "libshared_libz.z.so", + "path": "//third_party/zlib:shared_libz", + "headers": [] } ] \ No newline at end of file diff --git a/tools/deps_guard/rules/Passthrough/passthrough_info.json b/tools/deps_guard/rules/Passthrough/passthrough_info.json index e6cd709..14beb1a 100755 --- a/tools/deps_guard/rules/Passthrough/passthrough_info.json +++ b/tools/deps_guard/rules/Passthrough/passthrough_info.json @@ -118,5 +118,29 @@ "so_file_name": "libmetadata_service_1.1.z.so", "path": "//drivers/peripheral/display/buffer/hdi_service:libmetadata_service_1.1", "headers": [] + }, + { + "name": "hdf:libinput_interfaces_service_1.0", + "so_file_name": "libinput_interfaces_service_1.0.z.so", + "path": "//drivers/peripheral/input/hdi_service:libinput_interfaces_service_1.0", + "headers": [] + }, + { + "name": "hdf:libdisplay_buffer_vendor", + "so_file_name": "libdisplay_buffer_vendor.z.so", + "path": "//device/soc/rockchip/rk3568/hardware/display:libdisplay_buffer_vendor", + "headers": [] + }, + { + "name": "hdf:libcodec_component_manager_service_4.0", + "so_file_name": "libcodec_component_manager_service_4.0.z.so", + "path": "//drivers/peripheral/codec/hal/idl_service:libcodec_component_manager_service_4.0", + "headers": [] + }, + { + "name": "hdf:libdisplay_buffer_vdi_impl", + "so_file_name": "libdisplay_buffer_vdi_impl.z.so", + "path": "//device/soc/rockchip/rk3568/hardware/display:libdisplay_buffer_vdi_impl", + "headers": [] } ] \ No newline at end of file diff --git a/tools/deps_guard/rules_checker/base_innerapi_rule.py b/tools/deps_guard/rules_checker/base_innerapi_rule.py index a23bd70..171e826 100644 --- a/tools/deps_guard/rules_checker/base_innerapi_rule.py +++ b/tools/deps_guard/rules_checker/base_innerapi_rule.py @@ -55,9 +55,9 @@ class BaseInnerapiRule(BaseRule): all(item in self.__valid_system_tags for item in callee_innerapi_tags): continue else: - self.warn("NEED MODIFY: system only module %s depends on wrong module as %s in %s, dep module path is %s" + self.error("NEED MODIFY: system only module %s depends on wrong module as %s in %s, dep module path is %s" %(mod["name"], callee["name"], mod["labelPath"], callee["path"])) - passed = True + passed = False # mod is vendor only scene elif self.is_only(self.__ignored_tags, mod) == "vendor" and \ all(item in self.__valid_vendor_tags for item in innerapi_tags): @@ -70,5 +70,5 @@ class BaseInnerapiRule(BaseRule): else: self.error("NEED MODIFY: system only module %s depends on wrong module as %s in %s, dep module path is %s" %(mod["name"], callee["name"], mod["labelPath"], callee["path"])) - passed = True + passed = False return passed \ No newline at end of file diff --git a/tools/deps_guard/rules_checker/base_rule.py b/tools/deps_guard/rules_checker/base_rule.py index e4ae0c6..5854559 100755 --- a/tools/deps_guard/rules_checker/base_rule.py +++ b/tools/deps_guard/rules_checker/base_rule.py @@ -89,11 +89,11 @@ class BaseRule(object): passed = True wrong_tags = [item for item in dep_innerapi_tags if item not in valid_dep_tags] - self.warn("NEED MODIFY: %s's dep file %s with %s contains wrong dep innerapi_tags [%s] in innerapi_tags [%s]" - %(mod["name"], callee["name"], callee["labelPath"], ",".join(wrong_tags), ",".join(dep_innerapi_tags))) + self.warn("NEED MODIFY: %s with innerapi_tags [%s] has dep file %s with %s contains wrong dep innerapi_tags [%s] in innerapi_tags [%s]" + %(mod["name"], ",".join(innerapi_tags), callee["name"], callee["labelPath"], ",".join(wrong_tags), ",".join(dep_innerapi_tags))) else: wrong_tags = [item for item in innerapi_tags if item not in valid_mod_tags] - self.warn("NEED MODIFY: module %s with %s contains wrong mod innerapi_tags [%s] in innerapi_tags [%s]" + self.error("NEED MODIFY: module %s with %s contains wrong mod innerapi_tags [%s] in innerapi_tags [%s]" %(mod["name"], mod["labelPath"], ",".join(wrong_tags), ",".join(innerapi_tags))) return True diff --git a/tools/deps_guard/rules_checker/chipsetsdk.py b/tools/deps_guard/rules_checker/chipsetsdk.py index aac7edf..b4300b3 100755 --- a/tools/deps_guard/rules_checker/chipsetsdk.py +++ b/tools/deps_guard/rules_checker/chipsetsdk.py @@ -210,8 +210,8 @@ class ChipsetSDKRule(BaseRule): continue # Not allowed - passed = True - self.warn("NEED MODIFY: chipset module %s in %s depends on non Chipset SDK module %s in %s" + passed = False + self.error("NEED MODIFY: chipset module %s in %s depends on non Chipset SDK module %s in %s" % (mod["name"], mod["labelPath"], callee["name"], mod["labelPath"])) return passed @@ -226,7 +226,7 @@ class ChipsetSDKRule(BaseRule): for mod in self.__modules_with_chipsetsdk_tag: if mod["name"] not in self.get_white_lists(): passed = True - self.warn('NEED MODIFY: non chipsetsdk module %s with innerapi_tags="chipsetsdk", %s' + self.error('NEED MODIFY: non chipsetsdk module %s with innerapi_tags="chipsetsdk", %s' % (mod["name"], mod["labelPath"])) for mod in self.__modules_with_chipsetsdk_indirect_tag: diff --git a/tools/deps_guard/rules_checker/chipsetsdk_sp.py b/tools/deps_guard/rules_checker/chipsetsdk_sp.py index aacff5c..a19a332 100644 --- a/tools/deps_guard/rules_checker/chipsetsdk_sp.py +++ b/tools/deps_guard/rules_checker/chipsetsdk_sp.py @@ -31,6 +31,8 @@ class ChipsetsdkSPRule(BaseRule): self.__white_lists = self.load_chipsetsdk_json("chipsetsdk_sp_info.json") self.__ignored_tags = ["platformsdk", "sasdk", "platformsdk_indirect", "ndk"] self.__valid_mod_tags = ["llndk", "chipsetsdk_sp", "chipsetsdk_sp_indirect"] + self.__ignored_tags + self.__valid_vendor_tags = ["chipsetsdk", "chipsetsdk_sp", "llndk", "passthrough", + "passthrougth_indirect"] + self.__ignored_tags def get_white_lists(self): return self.__white_lists @@ -174,6 +176,9 @@ class ChipsetsdkSPRule(BaseRule): if mod["path"].startswith("system"): continue + if not mod["name"].endswith(".so"): + continue + # Check chipset modules depends for dep in mod["deps"]: callee = dep["callee"] @@ -191,6 +196,12 @@ class ChipsetsdkSPRule(BaseRule): if callee["name"] in lists: continue + dep_innerapi_tags = callee["innerapi_tags"] + if dep_innerapi_tags and all(item in self.__valid_vendor_tags for item in dep_innerapi_tags): + continue + elif not dep_innerapi_tags: + continue + # If callee is asan library, it is OK if callee["name"].endswith(".asan.so"): continue @@ -200,9 +211,9 @@ class ChipsetsdkSPRule(BaseRule): continue # Not allowed - passed = True - self.warn("NEED MODIFY: chipset_sp module %s in %s depends on non ChipsetSDKSP module %s in %s" - % (mod["name"], mod["labelPath"], callee["name"], mod["labelPath"])) + passed = False + self.error("NEED MODIFY: chipset_sp module %s in %s depends on non ChipsetSDKSP module %s in %s" + % (mod["name"], mod["labelPath"], callee["name"], callee["labelPath"])) return passed @@ -212,11 +223,13 @@ class ChipsetsdkSPRule(BaseRule): if not self.__is_chipsetsdk_sp_tagged(mod): self.warn('ChipsetSDK module %s has no innerapi_tags with "chipsetsdk_sp", add it in %s' % (mod["name"], mod["labelPath"])) + + print(f"----------------white_list:{','.join(self.get_white_lists())}------------") for mod in self.__modules_with_chipsetsdk_sp_tag: if mod["name"] not in self.get_white_lists(): - passed = True - self.warn('NEED MODIFY: non chipsetsdk_sp module %s with innerapi_tags="chipsetsdk_sp", %s' + passed = False + self.error('NEED MODIFY: non chipsetsdk_sp module %s with innerapi_tags="chipsetsdk_sp", %s' % (mod["name"], mod["labelPath"])) for mod in self.__modules_with_chipsetsdk_sp_indirect_tag: diff --git a/tools/deps_guard/rules_checker/passthrough.py b/tools/deps_guard/rules_checker/passthrough.py index 3d9115c..d249fc1 100644 --- a/tools/deps_guard/rules_checker/passthrough.py +++ b/tools/deps_guard/rules_checker/passthrough.py @@ -205,7 +205,7 @@ class PassthroughRule(BaseRule): continue # Not allowed - passed = True + passed = False self.error("NEED MODIFY: passthrough module %s in %s depends on non passthrough module %s in %s" % (mod["name"], mod["labelPath"], callee["name"], mod["labelPath"])) @@ -220,7 +220,7 @@ class PassthroughRule(BaseRule): for mod in self.__modules_with_passthrough_tag: if mod["name"] not in self.get_white_lists(): - passed = True + passed = False self.error('NEED MODIFY: non passthrough %s with innerapi_tags="passthrough", %s' % (mod["name"], mod["labelPath"])) -- Gitee From 5d87361d843c8eab23cf50c7f2811ee90951323c Mon Sep 17 00:00:00 2001 From: liangxinyan123 Date: Thu, 3 Jul 2025 11:02:16 +0000 Subject: [PATCH 2/2] update tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json. Signed-off-by: liangxinyan123 --- tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json b/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json index 5d76f79..633e0cd 100755 --- a/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json +++ b/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json @@ -190,5 +190,11 @@ "so_file_name": "libshared_libz.z.so", "path": "//third_party/zlib:shared_libz", "headers": [] + }, + { + "name": "thirdparty:libunwind", + "so_file_name": "libunwind.z.so", + "path": "//third_party/libunwind:libunwind", + "headers": [] } ] \ No newline at end of file -- Gitee