合并受阻
变更摘要
本 PR 修复 scripts/kernel/binary_script/gen_output_json.py 中缺失 OPC 输出 JSON 分支的控制流问题:该分支在打印 [ERROR] 提示后首先执行 continue,导致其后针对 *_failed.json 的清理逻辑以及 raise FileNotFoundError() 永远无法到达。删除该 continue 后,清理与预期抛错得以执行,使构建在 kernel 失败时以非零状态退出,而非仅打印红色错误文本却仍返回成功。改动最小且聚焦于该 Issue。
主要改动
- 移除提前跳过的
continue: 在generate_operator_json_content中删除缺失 OPC 输出 JSON 分支里的continue,使该分支不再直接结束当前迭代。 - 恢复
*_failed.json清理逻辑: 由于不再提前跳出,后续基于opc_json_file_name + "_failed"拼接并判断os.path.exists(failed_json_file)的失败 JSON 清理代码得以执行。 - 恢复
raise FileNotFoundError()触发: 原本被continue遮挡的抛错语句重新可达,使 kernel 失败时构建能按代码意图报错退出,避免出现 CI 假绿。


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
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/ops-ras | ❌ (0/2)(You can also ask: 冯彤, 陈兴宇, yue-ma, 王林木, 周奇龙) | ❌ (0/1)(You can also ask: 王林木, 唐燕峰, 於欣洁, 周奇龙, yue-ma) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
NUAA_wqy, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/compile


/compile


流水线任务触发成功
任务链接 [f7b23896b42b46338e523f293bb39b42][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| API_Check | ✅ SUCCESS | >>>>> |
[2026-10-21 18:30:31] CI执行结束


流水线任务触发成功
任务链接 [863919a539ce46b58885fdd582d89e64][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-10-21 18:29:20] CI执行结束


描述
In gen_output_json.py the branch for a missing opc output json called
continue before the *_failed.json cleanup and the
aise FileNotFoundError(), so those five lines never executed. The
build then only printed [ERROR] and continued, exiting 0 with a failed
kernel (red error text but a green CI pipeline). Removing the
continue lets the cleanup and the intended raise run, failing the
build as the code clearly intended.
变更类型
关联的Issue
Fixes #60
测试
已完成的测试用例和场景:
补充的UT用例:见 commit message / 描述中的验证说明(如仓内新增测试文件,已随本 MR 一并提交)
文档更新
NA
合入检查