已合并
【PR】: clean code #2161
zhangke创建于 5月14日
【PR】: clean code #2161
已合并
zhangke创建于 5月14日
已删除 :master合入到cann/runtimemaster
zhangke成员
5月14日

Pull Request

描述

请清晰准确地描述本次 Pull Request 的意图和变更内容。
1、lost “set -e”

变更类型

请选择本次引入的变更类型:

关联的Issue

如何测试

描述测试此变更的步骤和前提条件:
1.
2.

核对清单

其他信息

在此添加任何其他关于本次 PR 的说明。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhangke 的贡献)
Zzhangke成员
5月14日 创建了 pull request,commit 32878ae2
Zzhangke成员
5月14日 添加了label:enhancement
CANN-robot
CANN-robot成员
5月14日 评论:

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
example Turing_JasonWen, luoyuzhou2 (2/2) luoyuzhou2 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
5月14日 将zhaozhixuan,wda1991,wangtao43,zhangpengpeng8,changhaixun,vaceciliachen,yanmingxiang,turing_yhy,Reyn52166,luoyuzhou2,Turing_JasonWen,phy-zhao,Axiaolei,ykl999,sunnana_004434229,YzQnWyx,houyanbao,wangluyao17,zhou-wuxiao,tingwood设为评审人
CANN-robotCANN-robot成员
5月14日 将zhaozhixuan,wda1991,wangtao43,zhangpengpeng8,changhaixun,vaceciliachen,yanmingxiang,turing_yhy,Reyn52166,luoyuzhou2,Turing_JasonWen,phy-zhao,Axiaolei,ykl999,sunnana_004434229,YzQnWyx,houyanbao,wangluyao17,zhou-wuxiao,tingwood设为审查人
zhangke成员
5月14日 评论:

compile

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月14日 评论:

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

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS
Check_Pr ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS
precommit ⚠️ WARNING >>>>> >>>>>
UT_Test_acl ✅ SUCCESS >>>>>
UT_Test_rts_v201 ✅ SUCCESS >>>>>
UT_Test_rts_c ✅ SUCCESS >>>>>
UT_Test_rts_david ✅ SUCCESS >>>>>
UT_Test_rts_910b ✅ SUCCESS >>>>>
UT_Test_rts_common ✅ SUCCESS >>>>>
UT_Test_platform ✅ SUCCESS >>>>>
UT_Test_qs ✅ SUCCESS >>>>>
UT_Test_aicpusd ✅ SUCCESS >>>>>
UT_Test_tsd ✅ SUCCESS >>>>>
UT_Test_dfx ✅ SUCCESS >>>>>
UT_Test_mmpa ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_A900_npupool ✅ SUCCESS >>>>>
UT_Test_rts_report ✅ SUCCESS >>>>>

[2026-05-14 19:23:19]    CI执行结束

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-passed
zhangke成员
5月14日 评论:

/ai review

likedislike
atomgit-bot
atomgit-bot
5月14日 评论:

代码审查

为 4 个 shell 脚本添加 set -euo pipefail 严格模式。其中示例 run.sh 脚本无问题,但 uninstall.sh 中 $in_hetero_arch 变量在未传 --hetero-arch 参数时未定义,与 set -u 冲突导致脚本必然崩溃;且 sh 子进程失败后的错误处理分支因 set -e 变为死代码。

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

⛔ 需要修改

likedislike
atomgit-bot
atomgit-bot5月14日进行代码检视2
scripts/package/runtime/scripts/uninstall.sh
已过期
@@ -9,6 +9,8 @@
99# See LICENSE in the root of the software repository for the full text of the License.
1010# -----------------------------------------------------------------------------------------------------------
1111 
12+set -euo pipefail
atomgit-bot
atomgit-bot5月14日评论:

🔴 Critical

in_hetero_arch 仅在命令行传入 --hetero-arch 选项时于 line 287 赋值。当未传入该选项时变量未定义,但 line 305 的 elif [ "$in_hetero_arch" = "y" ] 和 line 308 的 if [ "$in_hetero_arch" = "y" ] 均无条件引用该变量。set -u 会在此处触发脚本退出,导致常规卸载流程(未使用 --hetero-arch)完全无法执行。

同一段代码其他问题

likedislike
System
系统消息系统
5月14日 评论:

changed this line on 09dd20da view diff detail

Zzhangke成员
5月14日 解决了最后一个问题
Zzhangke成员
5月14日 update merge request[project id: 8810053, iid: 2161, commit_id: 66624dd5f7a00eb50d7f530d02604c0c45029f05] virtual merging success
Zzhangke成员
5月14日 强制推送  1 个提交:09dd20da-clean code
Zzhangke成员
5月14日 update merge request[project id: 8810053, iid: 2161, commit_id: 20d8301731df4b235be25a0cde9f1ada0babbd49] virtual merging success
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-passed
CANN-robot
CANN-robot成员
5月14日 评论:

Notification

This pull request source branch has changed, so removes the following label(s): ci-pipeline-passed.

likedislike
CANN-robotCANN-robot成员
5月14日 移除了审查人tingwood
zhangke成员
5月14日 评论:

compile

likedislike
zhangke成员
5月14日 评论:

/ai review

likedislike
CANN-robotCANN-robot成员
5月14日 删除了label:api-check-pass
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月14日 评论:

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

任务名称状态日志下载链接
codecheck ✅ SUCCESS
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS
Check_Pr ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS
precommit ⚠️ WARNING >>>>> >>>>>
UT_Test_acl ✅ SUCCESS >>>>>
UT_Test_rts_v201 ✅ SUCCESS >>>>>
UT_Test_rts_c ✅ SUCCESS >>>>>
UT_Test_rts_david ✅ SUCCESS >>>>>
UT_Test_rts_910b ✅ SUCCESS >>>>>
UT_Test_rts_common ✅ SUCCESS >>>>>
UT_Test_platform ✅ SUCCESS >>>>>
UT_Test_qs ✅ SUCCESS >>>>>
UT_Test_aicpusd ✅ SUCCESS >>>>>
UT_Test_tsd ✅ SUCCESS >>>>>
UT_Test_dfx ✅ SUCCESS >>>>>
UT_Test_mmpa ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_A900_npupool ✅ SUCCESS >>>>>
UT_Test_rts_report ✅ SUCCESS >>>>>

[2026-05-14 19:48:56]    CI执行结束

likedislike
atomgit-bot
atomgit-bot
5月14日 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-passed
luoyuzhou2
5月14日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:approved
Turing_JasonWen成员
5月14日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:lgtm
CANN-robot
CANN-robot成员
5月14日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: luoyuzhou2.
Reviewers who wrote a comment of /lgtm are: luoyuzhou2, Turing_JasonWen.

likedislike
CANN-robotCANN-robot成员
5月14日 合入了pull request