Pull Request已成功合入, 合并人@CANN-robot
(感谢 好好说话95号 的贡献)变更摘要
本 PR 修复 ResourceRegistry 加载编译资源 manifest 时允许空 resource_id 的问题,并补充相应回归测试。核心改动是在 tools/aclrtc/specialization/resource_registry.cpp 的 ParseResourceId() 中新增对空 resource_id 的校验:当解析出的 resource_id 为空字符串时记录错误日志(ASCENDLOGE)并返回 ResourceStatus::InvalidResource,从而阻止空 resource_id 的 manifest 被接受。同时在 tests/tools/aclrtc/test_resource_registry.cpp 中新增回归用例,覆盖直接加载空 resource_id manifest 以及通过公开 Load() 加载包含非法 bundle 的场景。
主要改动
ParseResourceId()增加空值校验:在tools/aclrtc/specialization/resource_registry.cpp中,解析resource_id后若结果为空字符串,则输出包含source_type、so、manifest等字段的错误日志并返回ResourceStatus::InvalidResource。- 补充直接加载空
resource_idmanifest 的断言:在LoadManifestValidatesJsonOwnershipSourceAndDuplicate测试中新增EXPECT_EQ(loadText(R"({"resource_id":""})"), ResourceStatus::InvalidResource),并断言 stage 的 external resources 中不包含空 key。 - 新增公开
Load()的回归测试:新增LoadRejectsEmptyResourceIdAndDoesNotCommitPartialBundle用例,构造"合法 manifest + 空resource_idmanifest"的非法 bundle,断言Load()返回InvalidResource且FindResource("")、FindResource("valid-resource")均为空(非法 bundle 不会提交任何资源);随后加载仅含合法 manifest 的 bundle,断言返回Success且Lookup("valid-resource")可正常查询到资源。


compile


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/asc-devkit | ✅ sjtulxh, chenyiyuan, YANXI_ZHAO (3/2) | ✅ sjtulxh, chenyiyuan, YANXI_ZHAO (3/1) |
| tools/aclrtc | ✅ chenyiyuan, YANXI_ZHAO, sjtulxh (3/2) | ✅ YANXI_ZHAO (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
huxj153, thanks for your pull request. All authors of the commits have signed the CLA. 👍


流水线任务触发成功
任务链接 [ff60d431208d479ab7562ce94276f7ea][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| pre_comment | ✅ SUCCESS | >>>>> | |
| codecheck_codestyle | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_md | ✅ SUCCESS |
[2026-08-25 14:17:55] CI执行结束


huxj153,感谢您的提交,建议在完成PR充分自验证后,再触发线上构建任务。
若您的PR已具备检视条件,可根据下表的责任田,@对应的committer进行代码检视,我们会在第一时间对您的提交进行处理。
代码责任田:
| module | committer |
|---|---|
| adv_api | chenyiyuan, wuyang_hw |
| basic_api | chenyiyuan, wuyang_hw |
| c_api | pangfd, haipingmao |
| cmake | xun_zhuge, DragonBornHD84 |
| docs | munanhw, ai_xin |
| examples | changxianyu, bianque |
| simt_api | wulinyu, zhanghao_0689 |
| scripts | xun_zhuge, kevin365 |
| tools | YANXI_ZHAO, XuebinYang, sjtulxh |
💡 如您不确定可以@谁,可以直接@我或者ascend-c sig的maintainer,xun_zhuge和ascendhjh,我们会为您分配合适的committer进行代码检视。
再次感谢您参与CANN的社区贡献。


流水线任务触发成功
任务链接 [21ffc4d365604606a62645a3de365964][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> |
[2026-08-25 14:25:42] CI执行结束


流水线任务触发成功
任务链接 [749b7fe311fc4674a8e189abd69f5b75][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_adv_test_one | ✅ SUCCESS | ||
| UT_Test_adv_test_two | ✅ SUCCESS | ||
| UT_Test_basic_test_one | ✅ SUCCESS | ||
| UT_Test_basic_test_two | ✅ SUCCESS | ||
| UT_Test_basic_test_three | ✅ SUCCESS | ||
| UT_Test_basic_test_four | ✅ SUCCESS | ||
| UT_Test_basic_test_five | ✅ SUCCESS | ||
| UT_Test_arm | ✅ SUCCESS | ||
| API_Check | ✅ SUCCESS | >>>>> | |
| UT_Test_report | ✅ SUCCESS | >>>>> |
[2026-08-25 14:28:24] CI执行结束


/lgtm
/approve


/lgtm
/approve


描述
修复
ResourceRegistry加载编译资源 manifest 时允许空resource_id的问题。同时在
tests/tools/aclrtc/test_resource_registry.cpp中补充回归测试:LoadManifest()直接加载空resource_idmanifest 的场景,断言返回InvalidResource且 stage 中不包含空 key。Load()加载 bundle 的场景,断言包含空resource_id的非法 bundle 不会提交任何资源,同时保留合法 bundle 可正常加载和查询的对照。关联的Issue
关联Issue:ResourceRegistry 加载 manifest 时缺少空
resource_id校验测试
文档更新
无文档更新。
类型标签