已合并
[fix]add schema_version #5198
sjtulxh创建于 18 天前
[fix]add schema_version #5198
已合并
sjtulxh创建于 18 天前
sjtulxh成员
18 天前

描述

生成jit so时json字段添加schema_version=“1.0”

关联的Issue

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 sjtulxh 的贡献)
gao_dafa成员
18 天前 评论:

sjtulxh,感谢您的提交,建议在完成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_zhugeascendhjh,我们会为您分配合适的committer进行代码检视。

再次感谢您参与CANN的社区贡献。

likedislike
Ssjtulxh成员
18 天前 创建了 pull request,commit d5e2502e
atomgit-bot
atomgit-bot
18 天前 评论:

变更摘要

该 PR 旨在为生成 JIT SO 时的 manifest JSON 自动添加 schema_version 字段(值为 "1.0")。核心改动位于 tools/build/asc_compile_exporter/collected_manifest_repository.cppValidateAndExtractResourcePath 函数:将入参 textconst std::string& 改为可修改的 std::string&,在解析并校验 manifest 后向其注入 schema_version 字段并重新序列化回 text;同时拒绝加载已包含 schema_version 字段的 manifest。配套测试同步调整:移除测试用例中手写的 schema_version 字段,并新增校验自动注入与拒绝已有版本号行为的测试用例。

主要改动

  • 自动注入 schema_versionValidateAndExtractResourcePath 在成功解析并校验 manifest 后,执行 manifest["schema_version"] = "1.0"; 并通过 manifest.dump() 将结果写回 text,使生成的 manifest JSON 统一携带 schema_version
  • 拒绝已含 schema_version 的 manifest:解析后若 manifest 已包含 schema_version 字段,则记录错误日志 "Manifest must not contain schema_version: %s" 并返回 false,避免版本号冲突或覆盖。
  • 移除测试辅助数据中的硬编码版本号tests/tools/utils/asc_compile_exporter/test_support.htest_asc_compile_exporter.cpp 中手工拼装的 manifest JSON 不再写入 "schema_version":"1.0",改由导出器逻辑自动补充。
  • 新增行为测试test_collected_manifest_repository.cpp 新增 RepositoryAddsSchemaVersionToManifestJson(验证加载后 manifest 包含 schema_version 且值为 "1.0")和 RepositoryRejectsManifestWithSchemaVersion(验证已含 schema_version(如 "2.0")的 manifest 会导致 Load 失败)。
likedislike
atomgit-bot
atomgit-bot
18 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
18 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
18 天前 评论:

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.
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 诸葛洵, XuebinYang (2/2) 诸葛洵, XuebinYang (2/1)
tools/build XuebinYang, 诸葛洵 (2/2) XuebinYang (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robot
CANN-robot成员
18 天前 评论:

CLA Signature Pass

sjtulxh, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
18 天前 将zengjuan,zhanghao_0689,suqwe,wulinyu,kong0808,dengjing_aoe,YeZZzzz1,bluesky901,yangbinhua,zhudi22,chenyiyuan,xun_zhuge,XuebinYang,bianque,houyuyang,Lycheeeee,chentianyu19,shi_nanxiang,wuyang_hw,jiangxinyu3,ascendhjh,hujiawen_kaven,wangxiaozhi,DragonBornHD84,louyuxuan,hyolee,yukangchen设为评审人
CANN-robotCANN-robot成员
18 天前 将zengjuan,zhanghao_0689,suqwe,wulinyu,kong0808,dengjing_aoe,YeZZzzz1,bluesky901,yangbinhua,zhudi22,chenyiyuan,xun_zhuge,XuebinYang,bianque,houyuyang,Lycheeeee,chentianyu19,shi_nanxiang,wuyang_hw,jiangxinyu3,ascendhjh,hujiawen_kaven,wangxiaozhi,DragonBornHD84,louyuxuan,hyolee,yukangchen设为审查人
sjtulxh成员
18 天前 评论:

compile

likedislike
Ssjtulxh成员
18 天前 update merge request[project id: 8547062, iid: 5198, commit_id: aab2ffa1951e19bc7923af90f5d4517920a02da6] virtual merging success
CANN-robotCANN-robot成员
18 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
18 天前 评论:

流水线任务触发成功
任务链接 [e763dfea1aca4c9380f704f931edb9db][流水线指导]

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
pre_comment ✅ SUCCESS >>>>>
codecheck_codestyle ✅ SUCCESS >>>>>
codecheck_precommit ✅ SUCCESS >>>>>
StaticCheck_md ✅ SUCCESS

[2026-08-19 14:21:18]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
18 天前 评论:

流水线任务触发成功
任务链接 [08e641d117aa4ecca96bea558207d035][流水线指导]

任务名称状态日志下载链接
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-19 14:28:45]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
18 天前 评论:

流水线任务触发成功
任务链接 [4f52ba4726ee4c8c82fedcfd2b715d53][流水线指导]

任务名称状态日志下载链接
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-19 14:31:07]    CI执行结束

likedislike
CANN-robotCANN-robot成员
18 天前 添加了label:api-check-pass
CANN-robotCANN-robot成员
18 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
18 天前 添加了label:ci-pipeline-passed
zhugexun_sjtu
zhugexun_sjtu成员
18 天前 评论:

/lgtm
/approve

likedislike
XuebinYang成员
18 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
18 天前 添加了label:lgtm
XuebinYang成员
18 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
18 天前 添加了label:approved
CANN-robotCANN-robot成员
18 天前 合入了pull request