From 225f8616d3f2b9e50d7cceb0698c318a949f5d7a Mon Sep 17 00:00:00 2001 From: liangxinyan Date: Sat, 7 Jun 2025 14:42:46 +0800 Subject: [PATCH 1/4] IssueNo: https://gitee.com/openharmony/developtools_integration_verification/issues/ICD5XQ Signed-off-by: liangxinyan --- .../rules/ChipsetSDK/chipsetsdk_indirect.json | 90 ++++++++++++ .../rules/ChipsetSDK/chipsetsdk_info.json | 70 +++++++++ .../chipsetsdk_sp_indirect_info.json | 62 ++++++++ .../ChipsetsdkSP/chipsetsdk_sp_info.json | 134 ++++++++++++++++++ tools/deps_guard/rules/LLndk/llndk_info.json | 14 ++ .../rules/NO-Depends-On-NAPI/whitelist.json | 3 +- .../passthrough_indirect_info.json | 8 ++ .../rules/Passthrough/passthrough_info.json | 122 ++++++++++++++++ tools/deps_guard/rules_checker/__init__.py | 8 +- .../rules_checker/base_innerapi_rule.py | 22 ++- tools/deps_guard/rules_checker/base_rule.py | 10 +- tools/deps_guard/rules_checker/chipsetsdk.py | 44 ++---- .../deps_guard/rules_checker/chipsetsdk_sp.py | 48 ++----- tools/deps_guard/rules_checker/llndk.py | 3 +- tools/deps_guard/rules_checker/passthrough.py | 52 ++----- 15 files changed, 559 insertions(+), 131 deletions(-) diff --git a/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_indirect.json b/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_indirect.json index 2362637..3b516a0 100755 --- a/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_indirect.json +++ b/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_indirect.json @@ -269,5 +269,95 @@ "headers": [ "//foundation/filemanagement/storage_service/interfaces/innerkits/acl/native/" ] + }, + { + "name": "faultloggerd:libasync_stack", + "so_file_name": "libasync_stack.z.so", + "path": "//base/hiviewdfx/faultloggerd/interfaces/innerkits/async_stack:libasync_stack", + "headers": [] + }, + { + "name": "faultloggerd:crash_exception", + "so_file_name": "libcrash_exception.z.so", + "path": "//base/hiviewdfx/faultloggerd/interfaces/innerkits/crash_exception:crash_exception", + "headers": [] + }, + { + "name": "faultloggerd:dfx_signalhandler", + "so_file_name": "libdfx_signalhandler.z.so", + "path": "//base/hiviewdfx/faultloggerd/interfaces/innerkits/signal_handler:dfx_signalhandler", + "headers": [] + }, + { + "name": "hicollie:libfaultlogger", + "so_file_name": "libfaultlogger.z.so", + "path": "//base/hiviewdfx/hiview/plugins/faultloggerd:libfaultlogger", + "headers": [] + }, + { + "name": "drivers_interface_display:libdisplay_buffer_hdi_impl_v1_1", + "so_file_name": "libdisplay_buffer_hdi_impl_v1_1.z.so", + "path": "//drivers/interface/display/buffer/v1_1:libdisplay_buffer_hdi_impl_v1_1", + "headers": [] + }, + { + "name": "drivers_interface_display:libdisplay_buffer_proxy_1.1", + "so_file_name": "libdisplay_buffer_proxy_1.1.z.so", + "path": "//drivers/interface/display/buffer/v1_1:libdisplay_buffer_proxy_1.1", + "headers": [] + }, + { + "name": "ability_base:extractortool", + "so_file_name": "libextractortool.z.so", + "path": "//foundation/ability/ability_base:extractortool", + "headers": [] + }, + { + "name": "ability_base:string_utils", + "so_file_name": "libstring_utils.z.so", + "path": "//foundation/ability/ability_base:string_utils", + "headers": [] + }, + { + "name": "libjpeg-turbo:turbojpeg", + "so_file_name": "libturbojpeg.z.so", + "path": "//third_party/libjpeg-turbo:turbojpeg", + "headers": [] + }, + { + "name": "libsnd:sndfile", + "so_file_name": "libsndfile.z.so", + "path": "//third_party/libsnd:sndfile", + "headers": [] + }, + { + "name": "pcre2:libpcre2", + "so_file_name": "libsndfile.z.so", + "path": "//third_party/libsnd:sndfile", + "headers": [] + }, + { + "name": "pulseaudio:pulsecore", + "so_file_name": "libpulsecore.z.so", + "path": "//third_party/pulseaudio/ohosbuild/src/pulsecore:pulsecore", + "headers": [] + }, + { + "name": "pulseaudio:pulsecommon", + "so_file_name": "libpulsecommon.z.so", + "path": "//third_party/pulseaudio/ohosbuild/src:pulsecommon", + "headers": [] + }, + { + "name": "pulseaudio:speexresampler", + "so_file_name": "libspeexresampler.z.so", + "path": "//third_party/pulseaudio/speex:speexresampler", + "headers": [] + }, + { + "name": "selinux:libselinux", + "so_file_name": "libselinux.z.so", + "path": "//third_party/selinux:libselinux", + "headers": [] } ] diff --git a/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_info.json b/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_info.json index c464406..f792a7e 100644 --- a/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_info.json +++ b/tools/deps_guard/rules/ChipsetSDK/chipsetsdk_info.json @@ -601,5 +601,75 @@ "headers": [ "//base/security/huks/interfaces/inner_api/huks_standard/main/include" ] + }, + { + "name": "tee_client:libteec_vendor", + "so_file_name": "libteec_vendor.so", + "path": "//base/tee/tee_client/frameworks/build/standard:libteec_vendor", + "headers": [ + "//base/tee/tee_client/interfaces/inner_api" + ] + }, + { + "name": "drivers_interface_display:display_buffer", + "so_file_name": "libdisplay_buffer_proxy_1.0.z.so", + "path": "//drivers/interface/display/buffer/v1.0:libdisplay_buffer_proxy_1.0", + "headers": [ + "//drivers/interface/display/buffer/v1.0" + ] + }, + { + "name": "drivers_interface_camera:libcamera_secure_proxy_1.1", + "so_file_name": "libcamera_secure_proxy_1.1.z.so", + "path": "", + "headers": [] + }, + { + "name": "bounds_checking_function:libsec_shared", + "so_file_name": "libsec_shared.so", + "path": "//third_party/bounds_checking_function:libsec_shared", + "headers": [] + }, + { + "name": "protobuf:protobuf_lite", + "so_file_name": "libprotobuf_lite.so", + "path": "//third_party/protobuf:protobuf_lite", + "headers": [] + }, + { + "name": "zlib:shared_libz", + "so_file_name": "libshared_libz.so", + "path": "//third_party/zlib:shared_libz", + "headers": [] + }, + { + "name": "hilog:hilog_ndk", + "so_file_name": "libhilog_ndk.z.so", + "path": "", + "headers": [] + }, + { + "name": "face_auth:faceauth_framework", + "so_file_name": "libfaceauth_framework.z.so", + "path": "", + "headers": [] + }, + { + "name": "hianalytics_service:ha_client_lite", + "so_file_name": "libha_client_lite.z.so", + "path": "", + "headers": [] + }, + { + "name": "container_comm:uds_channel", + "so_file_name": "libuds_channel.z.so", + "path": "", + "headers": [] + }, + { + "name": "libyuv:yuv", + "so_file_name": "libyuv.z.so", + "path": "", + "headers": [] } ] diff --git a/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_indirect_info.json b/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_indirect_info.json index e69de29..c1a920e 100755 --- a/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_indirect_info.json +++ b/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_indirect_info.json @@ -0,0 +1,62 @@ +[ + { + "name": "faultloggerd:libdfx_dumpcatcher", + "so_file_name": "libdfx_dumpcatcher.z.so", + "path": "//base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher:libdfx_dumpcatcher", + "headers": [] + }, + { + "name": "faultloggerd:libfaultloggerd", + "so_file_name": "libfaultloggerd.z.so", + "path": "//base/hiviewdfx/faultloggerd/interfaces/innerkits/faultloggerd_client:libfaultloggerd", + "headers": [] + }, + { + "name": "faultloggerd:libdfx_procinfo", + "so_file_name": "libdfx_procinfo.z.so", + "path": "//base/hiviewdfx/faultloggerd/interfaces/innerkits/procinfo:libdfx_procinfo", + "headers": [] + }, + { + "name": "faultloggerd:libunwinder", + "so_file_name": "libunwinder.z.so", + "path": "//base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder:libunwinder", + "headers": [] + }, + { + "name": "hitrace:libhitracechain", + "so_file_name": "libhitracechain.so", + "path": "//base/hiviewdfx/hitrace/interfaces/innerkits/native/innerkits:libhitracechain", + "headers": [] + }, + { + "name": "hiview:libucollection_client", + "so_file_name": "libucollection_client.z.so", + "path": "//base/hiviewdfx/hiview/interfaces/inner_api/unified_collection/client:libcollection_client", + "headers": [] + }, + { + "name": "eventhandler:libeventhandler", + "so_file_name": "libeventhandler.z.so", + "path": "//base/notification/eventhandler/frameworks/eventhandler:libeventhandler", + "headers": [] + }, + { + "name": "storage_service:storage_manager_acl", + "so_file_name": "libstorage_manager_acl.z.so", + "path": "//foundation/filemanagement/storage_service/interfaces/innerkits/acl/native:storage_manager_acl", + "headers": [] + }, + { + "name": "resource_schedule_service:ressched_client", + "so_file_name": "libressched_client.z.so", + "path": "//foundation/resourceschedule/resource_schedule_service/ressched/interfaces/innerkits/ressched_client:ressched_client", + "headers": [] + }, + { + "name": "lzma:lzma_shared", + "so_file_name": "lzma_shared.z.so", + "path": "//third_party/lzma:lzma_shared", + "headers": [] + } +] \ No newline at end of file diff --git a/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json b/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json index e69de29..4cbf06e 100755 --- a/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json +++ b/tools/deps_guard/rules/ChipsetsdkSP/chipsetsdk_sp_info.json @@ -0,0 +1,134 @@ +[ + { + "name": "faultloggerd:libbacktrace_local", + "so_file_name": "libbacktrace_local.so", + "path": "//base/hiviewdfx/faultloggerd/interfaces/innerkits/backtrace:libbacktrace_local", + "headers": [] + }, + { + "name": "hisysevent:libhisysevent", + "so_file_name": "libhisysevent.so", + "path": "//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent:libhisysevent", + "headers": [] + }, + { + "name": "cJSON:cjson", + "so_file_name": "libcjson.z.so", + "path": "//third_party/cJSON:cjson", + "headers": [] + }, + { + "name": "hicollie:libhicollie", + "so_file_name": "libhicollie.z.so", + "path": "//third_party/cJSON:cjson", + "headers": [] + }, + { + "name": "hitrace:hitrace_meter", + "so_file_name": "libhitrace_meter.so", + "path": "//base/hiviewdfx/hitrace/interfaces/native/innerkits:hitrace_meter", + "headers": [] + }, + { + "name": "init:libbeget_proxy", + "so_file_name": "libbeget_proxy.so", + "path": "//base/startup/init/interfaces/innerkits:libbeget_proxy", + "headers": [] + }, + { + "name": "init:libbegetutil", + "so_file_name": "libbegetutil.z.so", + "path": "//base/startup/init/interfaces/innerkits:libbegetutil", + "headers": [] + }, + { + "name": "c_utils:utils", + "so_file_name": "libutils.z.so", + "path": "//commonlibrary/c_utils/base:utils", + "headers": [] + }, + { + "name": "ets_utils:utils", + "so_file_name": "libutils.z.so", + "path": "//commonlibrary/ets_utils/js_concurrent_module/utils:utils", + "headers": [] + }, + { + "name": "hdf_core:libhdi", + "so_file_name": "libhdi.z.so", + "path": "//drivers/hdf_core/adapter/uhdf2/hdi:libhdi", + "headers": [] + }, + { + "name": "hdf_core:libhdf_ipc_adatper", + "so_file_name": "libhdf_ipc_adatper.z.so", + "path": "//drivers/hdf_core/adapter/uhdf2/ipc:libhdf_ipc_adatper", + "headers": [] + }, + { + "name": "hdf_core:libpub_utils", + "so_file_name": "libpub_utils.z.so", + "path": "//drivers/hdf_core/adapter/uhdf2/pub_utils:libpub_utils", + "headers": [] + }, + { + "name": "hdf_core:libhdf_utils", + "so_file_name": "libhdf_utils.z.so", + "path": "//drivers/hdf_core/adapter/uhdf2/utils:libhdf_utils", + "headers": [] + }, + { + "name": "drivers_interface_codec:libcodec_proxy_3.0", + "so_file_name": "libcodec_proxy_3.0.z.so", + "path": "//drivers/interface/codec/v3.0:libcodec_proxy_3.0", + "headers": [] + }, + { + "name": "drivers_interface_display:libhdifd_parcelable", + "so_file_name": "libhdifd_parcelable.z.so", + "path": "//drivers/interface/display/composer/hdifd_parcelable:libhdifd_parcelable", + "headers": [] + }, + { + "name": "graphic_surface:buffer_handle", + "so_file_name": "libbuffer_handle.z.so", + "path": "//foundation/graphic/graphic_surface/buffer_handle:buffer_handle", + "headers": [] + }, + { + "name": "ffrt:libffrt", + "so_file_name": "libffrt.so", + "path": "//foundation/resourceschedule/ffrt:libffrt", + "headers": [] + }, + { + "name": "bounds_checking_function:libsec_shared", + "so_file_name": "libsec_shared.z.so", + "path": "//third_party/bounds_checking_function:libsec_shared", + "headers": [] + }, + { + "name": "hilog:libhilog", + "so_file_name": "libhilog.so", + "path": "", + "headers": [] + }, + { + "name": "graphic_surface:surface", + "so_file_name": "libsurface.z.so", + "path": "//foundation/graphic/graphic_surface/surface:surface", + "headers": [] + }, + { + "name": "graphic_surface:sync_fence", + "so_file_name": "libsync_fence.z.so", + "path": "//foundation/graphic/graphic_surface/surface_fence:sync_fence", + "headers": [] + }, + { + "name": "build_framework:musl-libcxx.so", + "so_file_name": "libc++.so", + "path": "//build/common/musl:musl-libcxx.so", + "headers": [] + } +] \ No newline at end of file diff --git a/tools/deps_guard/rules/LLndk/llndk_info.json b/tools/deps_guard/rules/LLndk/llndk_info.json index e69de29..d2be205 100755 --- a/tools/deps_guard/rules/LLndk/llndk_info.json +++ b/tools/deps_guard/rules/LLndk/llndk_info.json @@ -0,0 +1,14 @@ +[ + { + "name": "build_framework:ld-musl-arm.so.1", + "so_file_name": "ld-musl-aarch64.so.1", + "path": "//build/common/musl:ld-musl-arm.so.1", + "headers": [] + }, + { + "name": "build_framework:musl-libcxx.so", + "so_file_name": "libcxx.so", + "path": "//build/common/musl:musl-libcxx.so", + "headers": [] + } +] \ No newline at end of file diff --git a/tools/deps_guard/rules/NO-Depends-On-NAPI/whitelist.json b/tools/deps_guard/rules/NO-Depends-On-NAPI/whitelist.json index a0a14af..1020050 100644 --- a/tools/deps_guard/rules/NO-Depends-On-NAPI/whitelist.json +++ b/tools/deps_guard/rules/NO-Depends-On-NAPI/whitelist.json @@ -1,5 +1,6 @@ [ "accessibility", "remote_file_share_native", - "medialibrary" + "medialibrary", + "utils" ] diff --git a/tools/deps_guard/rules/Passthrough/passthrough_indirect_info.json b/tools/deps_guard/rules/Passthrough/passthrough_indirect_info.json index e69de29..d7aea2e 100755 --- a/tools/deps_guard/rules/Passthrough/passthrough_indirect_info.json +++ b/tools/deps_guard/rules/Passthrough/passthrough_indirect_info.json @@ -0,0 +1,8 @@ +[ + { + "name": "hdf:drivers_peripheral_input", + "so_file_name": "libhdi_input.z.so", + "path": "//drivers/peripheral/input/hal:hdi_input", + "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 e69de29..e6cd709 100755 --- a/tools/deps_guard/rules/Passthrough/passthrough_info.json +++ b/tools/deps_guard/rules/Passthrough/passthrough_info.json @@ -0,0 +1,122 @@ +[ + { + "name": "drivers_peripheral_bluetooth:audio_bluetooth_hdi_proxy_server", + "so_file_name": "libaudio_bluetooth_hdi_proxy_server.z.so", + "path": "//drivers/peripheral/bluetooth/audio/hal/hdi_binder/proxy:audio_bluetooth_hdi_proxy_server", + "headers": [] + }, + { + "name": "drivers_peripheral_bluetooth:audio_bluetooth_hdi_proxy_server", + "so_file_name": "libaudio_bluetooth_hdi_proxy_server.z.so", + "path": "", + "headers": [] + }, + { + "name": "drivers_peripheral_huks_override:libhuks_ca_hdi", + "so_file_name": "libhuks_ca_hdi.z.so", + "path": "", + "headers": [] + }, + { + "name": "drivers_peripheral_huks_override:libhuks_ext_hdi_service_1.0", + "so_file_name": "libhuks_ext_hdi_service_1.0.z.so", + "path": "", + "headers": [] + }, + { + "name": "drivers_peripheral_huks_override:libhuks_hdi_service_1.1", + "so_file_name": "libhuks_ext_hdi_service_1.1.z.so", + "path": "", + "headers": [] + }, + { + "name": "hiai:libai_client", + "so_file_name": "libai_client.so", + "path": "", + "headers": [] + }, + { + "name": "higpu:vulkan.hvgr", + "so_file_name": "libmaleoon_v200.so", + "path": "", + "headers": [] + }, + { + "name": "hiai:libai_fmk_hcl_model_runtime", + "so_file_name": "libai_fmk_hcl_model_runtime.so", + "path": "", + "headers": [] + }, + { + "name": "hiai:libai_infra_client", + "so_file_name": "libai_infra_client.so", + "path": "", + "headers": [] + }, + { + "name": "hiai:libai_mnt_client", + "so_file_name": "libai_mnt_client.so", + "path": "", + "headers": [] + }, + { + "name": "ffrt_key:libffrt_acc", + "so_file_name": "libffrt_acc.so", + "path": "", + "headers": [] + }, + { + "name": "gnss_driver_ext:liblbsservice_tagloc", + "so_file_name": "liblbsservice_tagloc.z.so", + "path": "", + "headers": [] + }, + { + "name": "higpu:vulkan.hvgr", + "so_file_name": "libmaleoon_v200.so", + "path": "", + "headers": [] + }, + { + "name": "connectivity_config:package_cal_dis", + "so_file_name": "libmeasure_alg_hisi.z.so", + "path": "", + "headers": [] + }, + { + "name": "video:libvpp.core", + "so_file_name": "libvpp.core.so", + "path": "", + "headers": [] + }, + { + "name": "algorithm_camera:libimage_process_client", + "so_file_name": "libimage_process_client.so", + "path": "", + "headers": [] + }, + { + "name": "drivers_peripheral_codec:libcodec_component_manager_service_3.0", + "so_file_name": "libcodec_component_manager_service_3.0.z.so", + "path": "//drivers/peripheral/codec/hal/idl_service:libcodec_component_manager_service_3.0", + "headers": [] + }, + { + "name": "drivers_peripheral_display:libmapper_service_1.0", + "so_file_name": "libmapper_service_1.0.z.so", + "path": "//drivers/peripheral/display/buffer/hdi_service:libmapper_service_1.0", + "headers": [] + }, + { + "name": "drivers_peripheral_display:libmapper_service_1.2", + "so_file_name": "libmapper_service_1.2.z.so", + "path": "//drivers/peripheral/display/buffer/hdi_service:libmapper_service_1.2", + "headers": [] + }, + { + "name": "drivers_peripheral_display:libmetadata_service_1.1", + "so_file_name": "libmetadata_service_1.1.z.so", + "path": "//drivers/peripheral/display/buffer/hdi_service:libmetadata_service_1.1", + "headers": [] + } +] \ No newline at end of file diff --git a/tools/deps_guard/rules_checker/__init__.py b/tools/deps_guard/rules_checker/__init__.py index 1133b7d..2265a73 100755 --- a/tools/deps_guard/rules_checker/__init__.py +++ b/tools/deps_guard/rules_checker/__init__.py @@ -21,6 +21,9 @@ from .sa_rule import SaRule from .hdi_rule import HdiRule from .chipsetsdk import ChipsetSDKRule from .base_innerapi_rule import BaseInnerapiRule +from .chipsetsdk_sp import ChipsetsdkSPRule +from .llndk import LLndkRule +from .passthrough import PassthroughRule def check_all_rules(mgr, args): @@ -29,7 +32,10 @@ def check_all_rules(mgr, args): SaRule, HdiRule, ChipsetSDKRule, - BaseInnerapiRule + BaseInnerapiRule, + ChipsetsdkSPRule, + LLndkRule, + PassthroughRule ] passed = True diff --git a/tools/deps_guard/rules_checker/base_innerapi_rule.py b/tools/deps_guard/rules_checker/base_innerapi_rule.py index 63c8399..a23bd70 100644 --- a/tools/deps_guard/rules_checker/base_innerapi_rule.py +++ b/tools/deps_guard/rules_checker/base_innerapi_rule.py @@ -30,16 +30,10 @@ class BaseInnerapiRule(BaseRule): self.__ignored_tags = ["platformsdk", "sasdk", "platformsdk_indirect", "ndk"] self.__valid_system_tags = ["llndk", "chipsetsdk", "chipsetsdk_indirect", "chipsetsdk_sp" "chipsetsdk_sp_indirect"] + self.__ignored_tags - self.__valid_vendor_tags = ["chipsetsdk", "chipsetsdk_indirect", "chipsetsdk_sp", "llndk", "passthrough", - "chipsetsdk_sp_indirect", "passthrough_indirect"] + self.__ignored_tags + self.__valid_vendor_tags = ["chipsetsdk", "chipsetsdk_sp", "llndk", "passthrough", + "passthrough_indirect"] + self.__ignored_tags def is_only(self, ignored_tags, mod): - innerapi_tags = mod["innerapi_tags"] - # check whether each innerapi_tag of mod in ignored tags - if innerapi_tags: - for innerapi_tag in innerapi_tags: - if innerapi_tag not in ignored_tags: - return False # check mod belongs to system module or vendor module if mod["path"].startswith("system"): return "system" @@ -61,9 +55,9 @@ class BaseInnerapiRule(BaseRule): all(item in self.__valid_system_tags for item in callee_innerapi_tags): continue else: - self.error("system only module %s depends on wrong module as %s in %s" - %(mod["name"], callee["name"], mod["labelPath"])) - passed = False + self.warn("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 # 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): @@ -74,7 +68,7 @@ class BaseInnerapiRule(BaseRule): all(item in self.__valid_vendor_tags for item in callee_innerapi_tags): continue else: - self.error("vendor only module %s depends on wrong module as %s in %s" - %(mod["name"], callee["name"], mod["labelPath"])) - passed = False + 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 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 7b96d0a..f42bf93 100755 --- a/tools/deps_guard/rules_checker/base_rule.py +++ b/tools/deps_guard/rules_checker/base_rule.py @@ -84,14 +84,14 @@ class BaseRule(object): elif not dep_innerapi_tags: continue - passed = False + passed = True wrong_tags = [item for item in dep_innerapi_tags if item not in valid_dep_tags] - self.error("module %s with %s contains wrong dep innerapi_tags [%s] in innerapi_tags [%s]" - %(callee["name"], callee["labelPath"], ",".join(wrong_tags), ",".join(dep_innerapi_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))) else: wrong_tags = [item for item in innerapi_tags if item not in valid_mod_tags] - self.error("module %s with %s contains wrong mod innerapi_tags [%s] in innerapi_tags [%s]" + self.warn("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 False + return True return passed \ No newline at end of file diff --git a/tools/deps_guard/rules_checker/chipsetsdk.py b/tools/deps_guard/rules_checker/chipsetsdk.py index e2a1f89..aac7edf 100755 --- a/tools/deps_guard/rules_checker/chipsetsdk.py +++ b/tools/deps_guard/rules_checker/chipsetsdk.py @@ -64,6 +64,7 @@ class ChipsetSDKRule(BaseRule): def check(self): self.__load_chipsetsdk_indirects() + white_lists = self.get_white_lists() # Check if all chipset modules depends on chipsetsdk modules only passed = self.__check_depends_on_chipsetsdk() @@ -71,12 +72,6 @@ class ChipsetSDKRule(BaseRule): if not passed: return passed - # Check if all chipsetsdk module depends on chipsetsdk or chipsetsdk_indirect modules only - passed = self.__check_chipsetsdk_indirect() - self.log(f"****check_chipsetsdk_indirect result:{passed}****") - if not passed: - return passed - # Check if all ChipsetSDK modules are correctly tagged by innerapi_tags passed = self.__check_if_tagged_correctly() self.log(f"****check_if_tagged_correctly result:{passed}****") @@ -84,13 +79,13 @@ class ChipsetSDKRule(BaseRule): return passed passed = self.check_if_deps_correctly( - self.__modules_with_chipsetsdk_tag, self.__valid_mod_tags, self.__valid_mod_tags) + self.__modules_with_chipsetsdk_tag, self.__valid_mod_tags, self.__valid_mod_tags, white_lists) self.log(f"****check_if_deps_correctly result:{passed}****") if not passed: return passed passed = self.check_if_deps_correctly( - self.__modules_with_chipsetsdk_tag, self.__valid_mod_tags, self.__valid_mod_tags) + self.__modules_with_chipsetsdk_tag, self.__valid_mod_tags, self.__valid_mod_tags, self.__indirects) self.log(f"****check_if_deps_correctly indirect result:{passed}****") if not passed: return passed @@ -161,32 +156,11 @@ class ChipsetSDKRule(BaseRule): "chipsetsdk_info.json"), os.O_WRONLY | os.O_CREAT, 0o644), "w") as f: json.dump(headers, f, indent=4) - except: + except FileNotFoundError as e: pass return headers - def __check_chipsetsdk_indirect(self): - passed = True - for mod in self.__chipsetsdks: - for dep in mod["deps"]: - callee = dep["callee"] - - # Chipset SDK is OK - if callee["name"] in self.get_white_lists(): - continue - - # chipsetsdk_indirect module is OK - if self.__is_chipsetsdk_indirect(callee) or callee["name"] in self.__indirects: - continue - - # Not correct - passed = False - self.error('Chipset SDK module %s should not depends on non Chipset SDK module \ - %s in %s with "chipsetsdk_indirect"' % (mod["name"], callee["name"], callee["labelPath"])) - - return passed - def __check_depends_on_chipsetsdk(self): lists = self.get_white_lists() @@ -236,9 +210,9 @@ class ChipsetSDKRule(BaseRule): continue # Not allowed - passed = False - self.error("chipset module %s depends on non Chipset SDK module %s in %s" - % (mod["name"], callee["name"], mod["labelPath"])) + passed = True + self.warn("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 @@ -251,8 +225,8 @@ class ChipsetSDKRule(BaseRule): for mod in self.__modules_with_chipsetsdk_tag: if mod["name"] not in self.get_white_lists(): - passed = False - self.error('non chipsetsdk module %s with innerapi_tags="chipsetsdk", %s' + passed = True + self.warn('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 8418004..8678302 100644 --- a/tools/deps_guard/rules_checker/chipsetsdk_sp.py +++ b/tools/deps_guard/rules_checker/chipsetsdk_sp.py @@ -63,19 +63,14 @@ class ChipsetsdkSPRule(BaseRule): def check(self): self.__load_chipsetsdk_indirects() + white_lists = self.get_white_lists() # Check if all chipset modules depends on chipsetsdk_sp modules only - passed = self.__check_depends_on_chipsetsdk() + passed = self.__check_depends_on_chipsetsdk_sp() self.log(f"****check_depends_on_chipsetsdk result:{passed}****") if not passed: return passed - # Check if all chipsetsdk_sp module depends on chipsetsdk_sp or chipsetsdk_sp_indirect modules only - passed = self.__check_chipsetsdk_sp_indirect() - self.log(f"****check_chipsetsdk_sp_indirect result:{passed}****") - if not passed: - return passed - # Check if all chipsetsdk_sp modules are correctly tagged by innerapi_tags passed = self.__check_if_tagged_correctly() self.log(f"****check_if_tagged_correctly result:{passed}****") @@ -83,13 +78,13 @@ class ChipsetsdkSPRule(BaseRule): return passed passed = self.check_if_deps_correctly( - self.__modules_with_chipsetsdk_sp_tag, self.__valid_mod_tags, self.__valid_mod_tags) + self.__modules_with_chipsetsdk_sp_tag, self.__valid_mod_tags, self.__valid_mod_tags, white_lists) self.log(f"****check_if_deps_correctly result:{passed}****") if not passed: return passed passed = self.check_if_deps_correctly( - self.__modules_with_chipsetsdk_sp_indirect_tag, self.__valid_mod_tags, self.__valid_mod_tags) + self.__modules_with_chipsetsdk_sp_indirect_tag, self.__valid_mod_tags, self.__valid_mod_tags, self.__indirects) self.log(f"****check_if_deps_correctly indirect result:{passed}****") if not passed: return passed @@ -160,33 +155,12 @@ class ChipsetsdkSPRule(BaseRule): "chipsetsdk_sp_info.json"), os.O_WRONLY | os.O_CREAT, 0o644), "w") as f: json.dump(headers, f, indent=4) - except: + except FileExistsError as e: pass return headers - def __check_chipsetsdk_sp_indirect(self): - passed = True - for mod in self.__chipsetsdk_sps: - for dep in mod["deps"]: - callee = dep["callee"] - - # ChipsetSDK SP is OK - if callee["name"] in self.get_white_lists(): - continue - - # chipsetsdk_sp_indirect module is OK - if self.__is_chipsetsdk_sp_indirect(callee) or callee["name"] in self.__indirects: - continue - - # Not correct - passed = False - self.error('ChipsetSPSDK module %s should not depends on non ChipsetSPSDK module \ - %s in %s with "chipsetsdk_indirect"' % (mod["name"], callee["name"], callee["labelPath"])) - - return passed - - def __check_depends_on_chipsetsdk(self): + def __check_depends_on_chipsetsdk_sp(self): lists = self.get_white_lists() passed = True @@ -235,9 +209,9 @@ class ChipsetsdkSPRule(BaseRule): continue # Not allowed - passed = False - self.error("chipset module %s depends on non ChipsetSDKSP module %s in %s" - % (mod["name"], callee["name"], mod["labelPath"])) + passed = True + self.error("NEED MODIFY: chipset_sp module %s in %s depends on non ChipsetSDKSP module %s in %s" + % (mod["name"], mod["labelPath"], callee["name"], mod["labelPath"])) return passed @@ -250,8 +224,8 @@ class ChipsetsdkSPRule(BaseRule): for mod in self.__modules_with_chipsetsdk_sp_tag: if mod["name"] not in self.get_white_lists(): - passed = False - self.error('non chipsetsdk_sp module %s with innerapi_tags="chipsetsdk_sp", %s' + passed = True + 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/llndk.py b/tools/deps_guard/rules_checker/llndk.py index 0f636fb..acf15cd 100644 --- a/tools/deps_guard/rules_checker/llndk.py +++ b/tools/deps_guard/rules_checker/llndk.py @@ -63,6 +63,7 @@ class LLndkRule(BaseRule): def check(self): self.__modules_with_llndk_tag = [] + white_lists = self.get_white_lists() for mod in self.get_mgr().get_all(): if self.__is_llndk_tagged(mod): @@ -75,7 +76,7 @@ class LLndkRule(BaseRule): return passed passed = self.check_if_deps_correctly( - self.__modules_with_llndk_tag, self.__valid_mod_tags, self.__valid_mod_tags) + self.__modules_with_llndk_tag, self.__valid_mod_tags, self.__valid_mod_tags, white_lists) self.log(f"****check_if_deps_correctly result:{passed}****") if not passed: return passed diff --git a/tools/deps_guard/rules_checker/passthrough.py b/tools/deps_guard/rules_checker/passthrough.py index 66b030b..7f2e9d4 100644 --- a/tools/deps_guard/rules_checker/passthrough.py +++ b/tools/deps_guard/rules_checker/passthrough.py @@ -63,6 +63,7 @@ class PassthroughRule(BaseRule): def check(self): self.__load_passthrough_indirects() + white_lists = self.get_white_lists() # Check if all chipset modules depends on chipsetsdk modules only passed = self.__check_depends_on_passthrough() @@ -70,12 +71,6 @@ class PassthroughRule(BaseRule): if not passed: return passed - # Check if all chipsetsdk module depends on chipsetsdk or chipsetsdk_indirect modules only - passed = self.__check_passthrough_indirect() - self.log(f"****check_chipsetsdk_indirect result:{passed}****") - if not passed: - return passed - # Check if all ChipsetSDK modules are correctly tagged by innerapi_tags passed = self.__check_if_passthrough_tagged_correctly() self.log(f"****check_if_tagged_correctly result:{passed}****") @@ -83,13 +78,13 @@ class PassthroughRule(BaseRule): return passed passed = self.check_if_deps_correctly( - self.__modules_with_passthrough_tag, self.__valid_mod_tags, self.__valid_mod_tags) + self.__modules_with_passthrough_tag, self.__valid_mod_tags, self.__valid_mod_tags, white_lists) self.log(f"****check_if_deps_correctly result:{passed}****") if not passed: return passed passed = self.check_if_deps_correctly( - self.__modules_with_passthrough_tag, self.__valid_mod_tags, self.__valid_mod_tags) + self.__modules_with_passthrough_tag, self.__valid_mod_tags, self.__valid_mod_tags, self.__indirects) self.log(f"****check_if_deps_correctly indirect result:{passed}****") if not passed: return passed @@ -160,32 +155,11 @@ class PassthroughRule(BaseRule): "passthrough_info.json"), os.O_WRONLY | os.O_CREAT, 0o644), "w") as f: json.dump(headers, f, indent=4) - except: + except FileExistsError as e: pass return headers - def __check_passthrough_indirect(self): - passed = True - for mod in self.__passthroughs: - for dep in mod["deps"]: - callee = dep["callee"] - - # Passthrough is OK - if callee["name"] in self.get_white_lists(): - continue - - # Passthrough_indirect module is OK - if self.__is_passthrough_indirect(callee) or callee["name"] in self.__indirects: - continue - - # Not correct - passed = False - self.error('Passthrough module %s should not depends on non Passthrough module \ - %s in %s with "chipsetsdk_indirect"' % (mod["name"], callee["name"], callee["labelPath"])) - - return passed - def __check_depends_on_passthrough(self): lists = self.get_white_lists() @@ -206,7 +180,11 @@ class PassthroughRule(BaseRule): self.__modules_with_passthrough_indirect_tag.append(mod) # Check chipset modules only - if mod["path"].startswith("system"): + if mod["path"].startswith("vendor"): + continue + + # Check passthrough so only + if not mod["path"].endswith("so"): continue # Check chipset modules depends @@ -214,7 +192,7 @@ class PassthroughRule(BaseRule): callee = dep["callee"] # If callee is chipset module, it is OK - if not callee["path"].startswith("system"): + if not callee["path"].startswith("vendor"): continue # Add to list @@ -235,9 +213,9 @@ class PassthroughRule(BaseRule): continue # Not allowed - passed = False - self.error("chipset module %s depends on non Chipset SDK module %s in %s" - % (mod["name"], callee["name"], mod["labelPath"])) + passed = True + 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"])) return passed @@ -250,8 +228,8 @@ class PassthroughRule(BaseRule): for mod in self.__modules_with_passthrough_tag: if mod["name"] not in self.get_white_lists(): - passed = False - self.error('non passthrough %s with innerapi_tags="passthrough", %s' + passed = True + self.error('NEED MODIFY: non passthrough %s with innerapi_tags="passthrough", %s' % (mod["name"], mod["labelPath"])) for mod in self.__modules_with_passthrough_indirect_tag: -- Gitee From f8914c775a6d01bd1ba774061e10be39a955b0a2 Mon Sep 17 00:00:00 2001 From: liangxinyan123 Date: Sat, 7 Jun 2025 07:06:53 +0000 Subject: [PATCH 2/4] update tools/deps_guard/rules_checker/base_rule.py. Signed-off-by: liangxinyan123 --- tools/deps_guard/rules_checker/base_rule.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/deps_guard/rules_checker/base_rule.py b/tools/deps_guard/rules_checker/base_rule.py index f42bf93..e4ae0c6 100755 --- a/tools/deps_guard/rules_checker/base_rule.py +++ b/tools/deps_guard/rules_checker/base_rule.py @@ -69,7 +69,7 @@ class BaseRule(object): # Default pass return True - def check_if_deps_correctly(self, check_modules, valid_mod_tags, valid_dep_tags): + 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 passed = True for mod in check_modules: @@ -84,6 +84,9 @@ class BaseRule(object): elif not dep_innerapi_tags: continue + if callee["name"] in white_lists: + continue + 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]" -- Gitee From 0067b8db49e33acda8d81c5ac01bd03cf2bc8d5a Mon Sep 17 00:00:00 2001 From: liangxinyan123 Date: Sat, 7 Jun 2025 07:43:27 +0000 Subject: [PATCH 3/4] update tools/deps_guard/rules_checker/chipsetsdk_sp.py. Signed-off-by: liangxinyan123 --- tools/deps_guard/rules_checker/chipsetsdk_sp.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tools/deps_guard/rules_checker/chipsetsdk_sp.py b/tools/deps_guard/rules_checker/chipsetsdk_sp.py index 8678302..aacff5c 100644 --- a/tools/deps_guard/rules_checker/chipsetsdk_sp.py +++ b/tools/deps_guard/rules_checker/chipsetsdk_sp.py @@ -149,15 +149,6 @@ class ChipsetsdkSPRule(BaseRule): for f in innerapi["header_files"]: item["headers"].append(os.path.join(base, f)) headers.append(item) - - try: - with os.fdopen(os.open(os.path.join(self.get_mgr().get_product_images_path(), - "chipsetsdk_sp_info.json"), - os.O_WRONLY | os.O_CREAT, 0o644), "w") as f: - json.dump(headers, f, indent=4) - except FileExistsError as e: - pass - return headers def __check_depends_on_chipsetsdk_sp(self): @@ -210,7 +201,7 @@ class ChipsetsdkSPRule(BaseRule): # Not allowed passed = True - self.error("NEED MODIFY: chipset_sp module %s in %s depends on non ChipsetSDKSP module %s in %s" + 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"])) return passed @@ -225,7 +216,7 @@ class ChipsetsdkSPRule(BaseRule): for mod in self.__modules_with_chipsetsdk_sp_tag: if mod["name"] not in self.get_white_lists(): passed = True - self.error('NEED MODIFY: non chipsetsdk_sp module %s with innerapi_tags="chipsetsdk_sp", %s' + self.warn('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: -- Gitee From 0a2716b1f7748bbf704afa3b93c35f498d25376b Mon Sep 17 00:00:00 2001 From: liangxinyan123 Date: Sat, 7 Jun 2025 07:44:29 +0000 Subject: [PATCH 4/4] update tools/deps_guard/rules_checker/passthrough.py. Signed-off-by: liangxinyan123 --- tools/deps_guard/rules_checker/passthrough.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/deps_guard/rules_checker/passthrough.py b/tools/deps_guard/rules_checker/passthrough.py index 7f2e9d4..3d9115c 100644 --- a/tools/deps_guard/rules_checker/passthrough.py +++ b/tools/deps_guard/rules_checker/passthrough.py @@ -150,14 +150,6 @@ class PassthroughRule(BaseRule): item["headers"].append(os.path.join(base, f)) headers.append(item) - try: - with os.fdopen(os.open(os.path.join(self.get_mgr().get_product_images_path(), - "passthrough_info.json"), - os.O_WRONLY | os.O_CREAT, 0o644), "w") as f: - json.dump(headers, f, indent=4) - except FileExistsError as e: - pass - return headers def __check_depends_on_passthrough(self): -- Gitee