mirror of
https://github.com/openharmony/developtools_integration_verification.git
synced 2026-07-25 06:05:30 -04:00
Feature: update chipset sdk rule checker
1)兼容asan库 2)对于hdi proxy类型的库,不加入到chipsetsdk中 3) 刷新chipset sdk检查规则的文档 Signed-off-by: handyohos <zhangxiaotian@huawei.com> Change-Id: I19d8dd1ce3755db56731e6e48e79f58be9854461 #I6DT5H
This commit is contained in:
@@ -16,7 +16,7 @@ Chipset SDK集合中的单个模块称之为ChipsetSDK模块。
|
||||
|
||||
## 2. 规则解释
|
||||
|
||||
Chipset SDK白名单规则有三个方面的含义:
|
||||
Chipset SDK白名单规则有几个方面的含义:
|
||||
|
||||
### 2.1 Chipset SDK模块需要在编译模板中标识
|
||||
|
||||
@@ -30,28 +30,44 @@ ohos_shared_library(sample_sa_module) {
|
||||
}
|
||||
```
|
||||
|
||||
如果没有此标记,编译时会提示如下类型的告警:
|
||||
|
||||
```shell
|
||||
[WARNING]: Chipset SDK module libinit_stub_empty.so has no innerapi_tags with "chipsetsdk" or "csdk", add it in //base/startup/init/interfaces/innerkits/init_module_engine:libinit_stub_empty
|
||||
```
|
||||
|
||||
同样,非Chipset SDK不要增加此标记。
|
||||
|
||||
### 2.2 芯片组件模块不允许依赖Chipset SDK集合之外的模块
|
||||
|
||||
### 2.3 系统组件模块不允许依赖任何芯片组件模块
|
||||
违法此规则时,会产生如下格式的NOT ALLOWED错误:
|
||||
|
||||
```
|
||||
[NOT ALLOWED]: chipset module libNNN.z.so depends on non Chipset SDK module libsystemMMM.z.so in //NNNpath:libNNN
|
||||
```
|
||||
|
||||
该错误的含义是:芯片组件的libNNN.z.so模块依赖了libsystemMMM.z.so,而libsystemMMM.z.so并不是被认可(白名单中)的模块。
|
||||
|
||||
违法此规则时,参考下一章节的处理方案进行消除:
|
||||
|
||||
## 3. 违规场景及处理方案建议
|
||||
|
||||
### 3.1 检查违规模块的安装组件是否正确
|
||||
|
||||
首先确认libNNN.z.so是否应该是芯片组件产物,只有与硬件相关的HDI实现模块才需要安装到芯片组件。
|
||||
|
||||
如下所示,每个模块是通过install_images选项来决定安装到系统组件还是芯片组件;如果系统组件模块错误的安装到芯片组件,可能会因为该模块依赖了Chipset SDK之外的系统组件模块而违反此规则。
|
||||
|
||||
```go
|
||||
ohos_shared_library(sample_module) {
|
||||
ohos_shared_library(libNNN) {
|
||||
...
|
||||
install_images = [ chipset_base_dir ]
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
因此,首先需要检查违规模块是否安装到了错误的组件。
|
||||
因此,首先需要检查违规模块是否安装到了错误的组件;如果libNNN.z.so不是芯片组件的产物,则install_images里不能填chipset_base_dir;删除install_images后,默认就是安装到系统组件。
|
||||
|
||||
### 3.2 申请新的Chipset SDK模块
|
||||
|
||||
如果经过分析,需要引入新的Chipset SDK模块,可向架构SIG申请加入Chipset SDK白名单。
|
||||
如果经过分析,芯片组件的libNNN.z.so确实需要引入新的Chipset SDK模块,可向架构SIG申请加入Chipset SDK白名单。
|
||||
|
||||
@@ -73,10 +73,15 @@ class ChipsetSDKRule(BaseRule):
|
||||
continue
|
||||
|
||||
if callee not in chipsetsdks:
|
||||
chipsetsdks.append(callee)
|
||||
if "hdiType" not in callee or callee["hdiType"] != "hdi_proxy":
|
||||
chipsetsdks.append(callee)
|
||||
# If callee is in Chipset SDK white list module, it is OK
|
||||
if callee["name"] in lists:
|
||||
continue
|
||||
|
||||
# If callee is asan library, it is OK
|
||||
if callee["name"].endswith(".asan.so"):
|
||||
continue
|
||||
|
||||
# If callee is hdi proxy module, it is OK
|
||||
if "hdiType" in callee and callee["hdiType"] == "hdi_proxy":
|
||||
|
||||
Reference in New Issue
Block a user