Merged
统一patch到third_party/patch目录,mockcpp补丁下载从configure迁移至build阶段 #272
zhaoyingdongAdd on Aug 11
统一patch到third_party/patch目录,mockcpp补丁下载从configure迁移至build阶段 #272
Merged
zhaoyingdongAdd on Aug 11
Merged fromDeleted :masterintocann/cmakemaster
zhaoyingdongCollaborators
Aug 11

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

PR功能描述 / 为什么需要这个合入**:

统一patch到third_party/patch目录,mockcpp补丁下载从configure迁移至build阶段

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

改动类型 / Change Type

测试信息 / Testing

检查清单 / Checklist

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for zhaoyingdong's contribution.)
ZzhaoyingdongCollaborators
Aug 11 Created pull request, commit 1fde288c
atomgit-bot
atomgit-bot
Aug 11 Comments:

变更摘要

此 PR 主要完成了两项工作:一是将所有第三方库的补丁文件(.patch)统一迁移至 third_party/patch/ 目录下集中管理;二是将 mockcpp 和 pybind11 的补丁/源码下载从 configure 阶段(file(DOWNLOAD) / execute_process)迁移至 build 阶段(ExternalProject_Add),使构建流程更规范。同时为 20 余个 ExternalProject_Add 调用统一添加了 TIMEOUT 超时参数,并为部分 cmake 文件补充了 CMAKE_C_COMPILER_LAUNCHER / CMAKE_CXX_COMPILER_LAUNCHER 编译加速器支持。此外还对 mockcpp.cmake 的构建逻辑做了简化清理。

主要改动

  • 补丁文件统一迁移至 third_party/patch/ 目录:将 grpc-fix-compile-bug-in-device.patch、json_3.12.0_change_version.patch、protobuf-hide_absl_symbols.patch、protobuf_25.1_change_version.patch、re2-add_compatible_functions.patch、symengine_add_mod.patch、zlib_add_minizip_static_lib.patch 共 7 个补丁文件从 third_party/ 根目录迁移到 third_party/patch/,相应 .cmake 文件中的 PATCH_COMMAND 路径全部更新为 ${CMAKE_CURRENT_LIST_DIR}/patch/...。

  • mockcpp 补丁下载从 configure 阶段迁移至 build 阶段:移除原有的 file(DOWNLOAD ...) 方式下载补丁,改为 ExternalProject_Add(mockcpp_patch ...) 在 build 阶段下载并校验 SHA256;mockcpp_static_build 新增 DEPENDS mockcpp_patch 依赖;补丁应用方式从 git init && git apply 改为 patch -p1。

  • pybind11 源码获取方式从 configure 迁移至 build 阶段:移除 file(DOWNLOAD) + execute_process(tar) 的 configure 阶段下载解压逻辑,改用 ExternalProject_Add(pybind11_build ...) 在 build 阶段完成下载解压;安装路径从 ${CANN_3RD_LIB_PATH}/pybind11 调整为 ${CANN_3RD_LIB_PATH}/lib_cache/pybind11。

  • mockcpp.cmake 构建逻辑简化:移除 ABI_ZERO 变量及相关条件分支,统一使用 USE_CXX11_ABI 控制 _GLIBCXX_USE_CXX11_ABI;移除 BUILD_WRAPPER、BUILD_TYPE、IS_MAKE 等变量及条件编译逻辑,BUILD_COMMAND 统一为 $(MAKE);移除 find_package_handle_standard_args 检查调用。

  • 统一为 ExternalProject_Add 添加 TIMEOUT 超时参数:在 abseil-cpp、boost、grpc、protobuf、gtest、openssl、eigen、llvm、re2、zlib、json、jpeg、symengine、rdma-core、seccomp、cares、csec、benchmark、libboundscheck、makeself-fetch、secure_c 等 20 余个 cmake 文件中新增 TIMEOUT 60 / TIMEOUT 300 / TIMEOUT 600 配置,防止下载操作无限等待。

likedislike
Incorrect?
atomgit-bot
atomgit-bot
Aug 11 Comments:

🤖 AI Code Review

⚠️ 审查未能完成

本次代码审查未能完成,可能是临时性故障。

你可以在评论区输入 /ai review 重新发起审查。若多次失败,请联系管理员并附上下方追踪 ID。

追踪 ID: task-177733-run-170491

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Aug 11 Added label: stat/needs-squash
CANN-robotCANN-robotCollaborators
Aug 11 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Aug 11 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


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/cmake ✅ 宋常霞, yangbinhua (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

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

likedislike
ZzhaoyingdongCollaborators
Aug 11 Pre merge succeeded (commit_id: f1bcad3a4544f8464bb00ab23f026d0b675fab25)
ZzhaoyingdongCollaborators
Aug 11 Pushed 1 commits:99a15175-mockcpp删除冗余的BUILD_COMMAND和INSTALL_COMMAND,使用ExternalProject默认行为
ZzhaoyingdongCollaborators
Aug 11 Pre merge succeeded (commit_id: bc60091b94f69b2d9a52195f161de2952ee4fd31)
CANN-robotCANN-robotCollaborators
Aug 11 Removed label: cann-cla/yes
CANN-robotCANN-robotCollaborators
Aug 11 Added label: cann-cla/yes
zhaoyingdongCollaborators
Aug 12 Comments:

/compile

likedislike
ZzhaoyingdongCollaborators
Aug 12 Pre merge succeeded (commit_id: 71b627d3102d572461a26cee9d70e346c83ea771)
CANN-robotCANN-robotCollaborators
Aug 12 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Aug 12 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Aug 12 Added label: ci-pipeline-passed
yangbinhua
yangbinhuaCollaborators
Aug 12 Comments:

/lgtm

likedislike
songchangxiaCollaborators
Aug 12 Comments:

/approve
/lgtm

likedislike
CANN-robotCANN-robotCollaborators
Aug 12 Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
Aug 12 Merged pull request