已合并
fix(examples): 修复空格路径下的示例脚本定位 #30
fix(examples): 修复空格路径下的示例脚本定位 #30
已合并
bububu创建于 9月26日
bububu
9月26日

描述

四个 aclnn 示例启动脚本原先未引用 $BASH_SOURCE 派生的目录路径;checkout 路径含空格时,cd 将路径拆成多个参数,导致 CURRENT_DIR 错误并无法加载公共 runner。本 PR 仅对以下四个脚本的目录切换行补齐引用,并在切换成功后执行 pwd:

  • examples/aclnn/complex_mul/run.sh:18
  • examples/aclnn/complex_mul_grad/run.sh:18
  • examples/aclnn/fused_bias_softmax/run.sh:18
  • examples/aclnn/fused_softmax_grad/run.sh:18

这只修复启动脚本的路径定位,不改算子接口、构建参数或运行逻辑。与 cann/cmake#9 对 build.sh 工具链路径参数的处理不同,本 PR 仅覆盖本仓 $BASH_SOURCE 路径解析。

关联的Issue

关联Issue #3

测试

  • Bash 语法检查命令:
for f in examples/aclnn/complex_mul/run.sh examples/aclnn/complex_mul_grad/run.sh examples/aclnn/fused_bias_softmax/run.sh examples/aclnn/fused_softmax_grad/run.sh; do bash -n "$f" || exit 1; done; printf 'bash -n: all 4 scripts passed\n'

真实输出:bash -n: all 4 scripts passed。

  • 含空格路径回归命令(隔离 fixture 使用只打印变量的测试 runner 替身):
bash /root/cann-contrib/cases/oil-gas-ops-prospect-20260926-001/verify/test-space-paths.sh /root/cann-work/forks/ljh/oil-gas-ops-prospect-contrib

四个脚本均加载正确目录并保留对应的 ACLNN_EXE,真实输出:

loaded runner: CURRENT_DIR=/tmp/tmp.k1zjkxhIgd/checkout with spaces/examples/aclnn/complex_mul ACLNN_EXE=test_aclnn_complex_mul
loaded runner: CURRENT_DIR=/tmp/tmp.k1zjkxhIgd/checkout with spaces/examples/aclnn/complex_mul_grad ACLNN_EXE=test_aclnn_complex_mul_grad
loaded runner: CURRENT_DIR=/tmp/tmp.k1zjkxhIgd/checkout with spaces/examples/aclnn/fused_bias_softmax ACLNN_EXE=test_aclnn_fused_bias_softmax
loaded runner: CURRENT_DIR=/tmp/tmp.k1zjkxhIgd/checkout with spaces/examples/aclnn/fused_softmax_grad ACLNN_EXE=test_aclnn_fused_softmax_grad
  • diff 检查命令:git -C /root/cann-work/forks/ljh/oil-gas-ops-prospect-contrib diff upstream/master...HEAD --check;真实结果:通过,无错误输出。
  • 未运行 CANN 构建或 NPU 算子执行;本 PR 的回归检查覆盖脚本路径解析与公共 runner 加载。

文档更新

无。

类型标签

当前PR是否有AI参与:

[] 否
[x] 是
__1. Agent平台信息: Codex CLI 0.153.4
__2. 模型信息: gpt-5.6-luna
__3. Prompt摘要: 独立复核候选、验证四个示例脚本的含空格路径故障,并实施和静态验证仅涉及路径引用的最小修复。

希望检视人员了解:

  1. 人工参与说明:用户提供候选报告并指定仓库、基线和审核标准;Codex 完成独立复现、四处逐项核对、最小修复和真实静态回归。尚无第二位人工贡献者独立审查,提交后仍需人工贡献者审查并响应上游意见。
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 bububu 的贡献)
Bbububu
9月26日 创建了 pull request,commit cdd9646f
Bbububu
9月26日 关联了issue:[Bug-Report|缺陷反馈]: 四个 aclnn 示例启动脚本在路径含空格时无法定位公共 runner
CANN-robot
CANN-robot成员
9月26日 评论:

Hi @LiJianhao2, welcome to submitting your first PR to oil-gas-ops-prospect!

PR Merge Steps

1. CLA Signing

If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.

2. CI Check

Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.

3. Code Review

After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.

likedislike
CANN-robotCANN-robot成员
9月26日 添加了label:ai-co-authored
CANN-robotCANN-robot成员
9月26日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
9月26日 评论:

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
sig-oil-gas-engineering ✅ 胡艺馨, 徐澜 (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

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

likedislike
bububu
9月26日 评论:

compile

likedislike
Bbububu
9月26日 预合并成功(commit_id: 72dc6b9d416cf14465b33156b2e723521692e6a0)
CANN-robot
CANN-robot成员
9月26日 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
9月26日 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
9月26日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
9月26日 添加了label:ci-pipeline-passed
newbgirl
newbgirl成员
9月29日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
9月29日 添加了label:approved
Chris-Lan成员
9月29日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
9月29日 添加了label:lgtm
CANN-robotCANN-robot成员
9月29日 合入了pull request