Merged
feat(ccu): 随 run 包交付 asccomm-config.cmake #7287
DragonBornHD84Add on 16 days ago
feat(ccu): 随 run 包交付 asccomm-config.cmake #7287
Merged
DragonBornHD84Add on 16 days ago
DragonBornHD84
DragonBornHD84Collaborators
16 days ago

描述

asc-comm 新增了 cmake/asccomm-config.cmake,用于向消费者提供 asccomm_ccu_headers 头文件库。为让 CANN 安装目录下的消费者可以直接 find_package(asccomm),asc-devkit 需要在构建与打包两个环节把它放到 lib64/cmake/ 下。

改动方法:

  1. cmake/third_party/asc-comm.cmake:在构建 asc-comm CCU 库的同一分支内 install(FILES ${ASC_COMM_SOURCE_PATH}/cmake/asccomm-config.cmake DESTINATION ${INSTALL_LIBRARY_DIR}/lib64/cmake COMPONENT asc-devkit),与既有 asc-config.cmake 安装目录一致。
  2. scripts/package/asc-devkit/asc-devkit.xml:新增 asccomm_config file_info,将 asccomm-config.cmake 交付到 $(TARGET_ENV)/lib64/cmake;src_path="lib/host" 与相邻 asc-config.cmake 条目保持一致,不配置 install_softlink。

配套改动在 asc-comm 仓:新增该 config 文件、样例改用 find_package(asccomm)、run 包同步交付。

关联的Issue

无

测试

  • asc-devkit 侧:cmake -S . -B build 配置成功;cmake --install build --component asc-devkit --prefix /tmp/devkitinstall 产出 aarch64-linux/lib64/cmake/asccomm-config.cmake,对应安装规则见 build/impl/adv_api/cmake_install.cmake:157
  • 联调:asc-comm 样例以 find_package(asccomm REQUIRED) 配置并编译通过(ccu_allgather)
  • asc-comm run 包:构建、解包校验、安装、卸载、权限断言通过,manifest 194 行
  • 未执行二级冒烟与上板测试

文档更新

无

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for DragonBornHD84's contribution.)
DragonBornHD84DragonBornHD84Collaborators
16 days ago Created pull request, commit cf7e935d
atomgit-bot
atomgit-bot
16 days ago Comments:

变更摘要

本 PR 为 asc-comm 的 impl 头文件交付补齐 CMake 侧标准入口:新增 cmake/asccomm-config.cmake 以支持 find_package(asccomm) 并暴露 INTERFACE 库 asccomm_ccu_headers,样例改为标准 find_package 用法,同时把该 config 纳入 run 包打包、安装与测试断言链路。本次实际代码改动集中在构建安装与包描述配置两处,将该 config 文件安装到 lib64/cmake 并登记到 asc-devkit 包清单中。

主要改动

  • 安装规则新增 asccomm-config.cmake 发布: 在 cmake/third_party/asc-comm.cmake 的 CCU 头文件安装块内追加 install(FILES .../cmake/asccomm-config.cmake DESTINATION ${INSTALL_LIBRARY_DIR}/lib64/cmake COMPONENT asc-devkit),使 config 随 asc-devkit 组件安装产出。
  • 包描述新增 config 文件条目: 在 scripts/package/asc-devkit/asc-devkit.xml 中新增 file_info 条目 asccomm_config,声明 asccomm-config.cmake 从 lib/host 拷贝并安装到 $(TARGET_ENV)/lib64/cmake,install_type="all"、install_mod="440",使该文件进入交付包清单与安装流程。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
16 days ago Comments:

代码审查

审查结论

发现的问题(1 项)

P2|cmake/third_party/asc-comm.cmake:140-142|为 asccomm-config.cmake 的 install 增加 EXISTS 守卫 / INSTALL_OPTIONAL

新增的 install(FILES ${ASC_COMM_SOURCE_PATH}/cmake/asccomm-config.cmake ...) 安装的是 asc-comm 仓库(非本仓库)的文件,却没有任何存在性判断:

  • 本文件第 12 行的 ASC_COMM_TAG_ID 本次未更新(第 11 行注释明确“更新 asc-comm 代码需同步更新 change id”),一旦走第 44-51 行 FetchContent 回退路径,取到旧 tag 的源码树里不含该新文件;
  • 同文件其它 asc-comm 安装规则普遍带 if(EXISTS ...) 守卫(第 108、119、162 行),同类的 aicpu-config.cmake/asc-config.cmake 安装(cmake/CMakeLists.txt:26-31)也都带 ${INSTALL_OPTIONAL},本条两者皆无。

失败模式:install(FILES <不存在路径>) 会在生成/安装阶段报 file INSTALL cannot find ".../cmake/asccomm-config.cmake",导致 cmake --install 与整包 staging 中断,而不是仅少一个 cmake config 文件。建议加 if(EXISTS) 或用 ${INSTALL_OPTIONAL} 包住,并确认 ASC_COMM_TAG_ID 指向包含该文件的 asc-comm 提交。


各变更文件审查结果

文件 结论
cmake/third_party/asc-comm.cmake 1 个问题(P2:新增 install 缺少存在性守卫/可选标记,依赖未更新的固定 tag)
scripts/package/asc-devkit/asc-devkit.xml 未发现问题 —— 新增 asccomm_config 条目的 dst_path/install_path($(TARGET_ENV)/lib64/cmake)与第 79 行 dir_info 目录白名单、以及第 226-228 行既有 aicpu-config.cmake/asc-config.cmake 条目的约定一致;XML 结构合法、无重复 key、无 XXE/DTD、无明文凭据;install_mod="440" 与该包内其它 asc-comm 交付文件一致,不构成缺陷

总体风险判断

改动面很小(+6 行,纯交付配置),主链路(样例编译、包内目录白名单、安装路径约定)自洽,风险集中在 asc-comm 侧新文件与本仓库固定 tag 的版本耦合:只要 ASC_COMM_TAG_ID 未同步提升,任何依赖 FetchContent 取源的构建都会在 install 阶段硬失败。建议合入前确认 tag 已更新,或在安装处补上守卫。

类型 数量
🔴 阻塞 0
🟡 建议 1

💬 仅评论

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
16 days ago Added label: stat/needs-squash
CANN-robotCANN-robotCollaborators
16 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
16 days ago Comments:

CLA Signature Pass

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

likedislike
CANN-robot
CANN-robotCollaborators
16 days ago Comments:

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
cmake/third_party ✅ 诸葛洵, dengjing_aoe (2/2) ✅ 诸葛洵 (1/1)
scripts ✅ 诸葛洵, dengjing_aoe (2/2) ✅ 诸葛洵 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
16 days ago updated PR
CANN-robotCANN-robotCollaborators
16 days ago Set zhanghao_0689,suqwe,kevin365,kong0808,YeZZzzz1,bluesky901,xun_zhuge,chentianyu19,shi_nanxiang,jiangxinyu3 as approver
DragonBornHD84DragonBornHD84Collaborators
16 days ago Change title to "feat(ccu): 随 run 包交付 asccomm-config.cmake", originally titled "feat(ccu): 新增 asccomm-config.cmake,以 find_package 方式交付 asccomm_ccu_headers".
DragonBornHD84DragonBornHD84Collaborators
16 days ago Modify description of pull request
atomgit-bot
atomgit-bot16 days agoStart code review1
cmake/third_party/asc-comm.cmake
@@ -139,1 +139,4 @@
139139 FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp")
140+ install(FILES ${ASC_COMM_SOURCE_PATH}/cmake/asccomm-config.cmake
141+ DESTINATION ${INSTALL_LIBRARY_DIR}/lib64/cmake
142+ COMPONENT asc-devkit)
atomgit-bot
atomgit-bot16 days agoComments:

🟡 Medium Priority

变更行:新增 install(FILES ${ASC_COMM_SOURCE_PATH}/cmake/asccomm-config.cmake DESTINATION ${INSTALL_LIBRARY_DIR}/lib64/cmake COMPONENT asc-devkit),被安装的配置文件来自 asc-comm 仓库(非本仓库),且未做存在性判断。

契约/一致性证据:

  1. 本文件第 12 行仍为固定 tag ASC_COMM_TAG_ID 9a65345c...(本次 diff 未更新),第 11 行注释明确“更新 asc-comm 代码需同步更新 change id”。当环境未预置 asc-comm 源码、走第 44-51 行 FetchContent 回退路径时,拉取到的是旧 tag 的源码树,其中不含新文件 cmake/asccomm-config.cmake。
  2. 同文件内其它 asc-comm 安装规则普遍带守卫:第 108 行 if(EXISTS "${ASC_COMM_AICPU_HEADER_DIR}")、第 119/162 行 if(EXISTS ".../CMakeLists.txt")。
  3. 同类 config 文件的既有安装规则(cmake/CMakeLists.txt:26-31 安装 aicpu-config.cmake / asc-config.cmake)在 DESTINATION 后都带有 ${INSTALL_OPTIONAL};本条缺失,使得“源文件不存在”从“跳过该文件”退化为硬失败。

失败模式:install(FILES <不存在路径>) 会在 CMake 生成/安装阶段报 file INSTALL cannot find ".../cmake/asccomm-config.cmake",导致 cmake --install(以及整包 staging)直接中断——即 asc-devkit run 包在 asc-comm 源码未包含该文件的所有构建配置下都无法产包,而不是仅缺失一个 cmake config。

建议:用 if(EXISTS ...) 包裹该 install(FILES ...) 规则(或加 ${INSTALL_OPTIONAL}),并同步把 ASC_COMM_TAG_ID 更新到包含 cmake/asccomm-config.cmake 的 asc-comm 提交。

Suggestions
142
+ if(EXISTS "${ASC_COMM_SOURCE_PATH}/cmake/asccomm-config.cmake")
143
+ install(FILES ${ASC_COMM_SOURCE_PATH}/cmake/asccomm-config.cmake
144
+ DESTINATION ${INSTALL_LIBRARY_DIR}/lib64/cmake ${INSTALL_OPTIONAL}
142
- COMPONENT asc-devkit)
145
+ COMPONENT asc-devkit)
146
+ endif()
Apply suggestion
likedislike
Incorrect?
DragonBornHD84DragonBornHD84Collaborators
16 days ago Pre merge succeeded (commit_id: 550b17cf6de1682c26fd497125dba966946b59ab)
DragonBornHD84DragonBornHD84Collaborators
16 days ago Force-pushed 1 commits:b9794369-feat(ccu): 随 run 包交付 asccomm-config.cmake
DragonBornHD84DragonBornHD84Collaborators
16 days ago Pre merge succeeded (commit_id: 04885325dc1a70ab129a59f28c7bbcae8b34b22d)
CANN-robotCANN-robotCollaborators
16 days ago Removed label: cann-cla/yes
CANN-robotCANN-robotCollaborators
16 days ago Removed label: stat/needs-squash
CANN-robot
CANN-robotCollaborators
16 days ago Comments:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): stat/needs-squash.

likedislike
CANN-robotCANN-robotCollaborators
16 days ago Added label: cann-cla/yes
DragonBornHD84
DragonBornHD84Collaborators
12 days ago Comments:

compile

likedislike
DragonBornHD84DragonBornHD84Collaborators
12 days ago Pre merge succeeded (commit_id: c39b4ace5e99d701889e790bf217c8e5927dae15)
CANN-robot
CANN-robotCollaborators
12 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
12 days ago Added label: ci-pipeline-running
8 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
12 days ago Added label: ci-pipeline-passed
DragonBornHD84
DragonBornHD84Collaborators
12 days ago Comments:

compile

likedislike
DragonBornHD84DragonBornHD84Collaborators
12 days ago Pre merge succeeded (commit_id: fb922ad7d8e8a54c159489f8963bde6d555a66a9)
CANN-robot
CANN-robotCollaborators
12 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
12 days ago Removed label: ci-pipeline-passed
CANN-robotCANN-robotCollaborators
12 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
12 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
12 days ago Added label: ci-pipeline-passed
zhugexun_sjtu
zhugexun_sjtuCollaborators
12 days ago Comments:

/lgtm
/approve

likedislike
changxianyu
changxianyuCollaborators
12 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
12 days ago Added label: approved
dengjing_aoe
dengjing_aoeCollaborators
12 days ago Comments:

/lgtm

likedislike
CANN-robot
CANN-robotCollaborators
12 days ago Comments:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: changxianyu
/lgtm: changxianyu

likedislike
CANN-robotCANN-robotCollaborators
12 days ago Added label: lgtm
CANN-robot
CANN-robotCollaborators
12 days ago Comments:

The MR can not be merged, because of CodeReview discussion not resolved

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike
DragonBornHD84DragonBornHD84Collaborators
12 days ago Resolved final issue
CANN-robotCANN-robotCollaborators
12 days ago Merged pull request