已合并
修复两个实验环境脚本的 CRLF 行尾问题 #1092
修复两个实验环境脚本的 CRLF 行尾问题 #1092
已合并
KaranocaVe创建于 9月29日
KaranocaVe
KaranocaVe
9月29日

修复两个实验环境脚本的 CRLF 行尾问题

描述

reduce-priority-queue 和 MoE-sort 实验使用的 env_custom_opp.sh 均以 CRLF 保存。bash -n 会以状态码 2 失败,source 时报告 $'\r': command not found,导致文档中的构建流程无法加载生成的 custom OPP 环境。

将这两个脚本转换为 LF 行尾,不改变命令或环境行为。

测试

  • 两个脚本均通过 bash -n。
  • 在生成包模拟环境中 source 两个脚本后,ASCEND_CUSTOM_OPP_PATH 均正确设置。
  • mock CMake 后,MoE-sort runner 可继续执行到构建命令。
  • 修复 patch 可应用于当前 master,diff 仅包含行尾变化。

这些检查覆盖 shell 启动流程,不代表算子编译通过。

文档更新

无需修改;现有实验文档已包含 source 和构建步骤。

类型标签

关联 Issue: https://gitcode.com/cann/cann-learning-hub/issues/771

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 KaranocaVe 的贡献)
KaranocaVeKaranocaVe
9月29日 创建了 pull request,commit 9595414d
KaranocaVeKaranocaVe
9月29日 关联了issue:两个实验环境脚本的 CRLF 行尾导致 Bash 无法加载
atomgit-bot
atomgit-bot
9月29日 评论:

变更摘要

本次变更针对两个实验环境脚本 env_custom_opp.sh 的 CRLF 行尾问题,将 reduce-priority-queue(reduce_lab/scripts/env_custom_opp.sh)与 MoE-sort(moe_sort_lab/scripts/env_custom_opp.sh)两个脚本由 CRLF 转换为 LF 行尾。脚本内容本身未发生任何变动,命令与环境行为保持不变,仅通过统一行尾使其可被 bash -n 正确解析并正常 source,从而加载生成的 custom OPP 环境。

主要改动

  • 行尾格式统一:两个 env_custom_opp.sh 的全部行均由 CRLF 改为 LF,消除 source 时出现的 $'\r': command not found 及 bash -n 失败问题。
  • 脚本加载入口修复:#!/bin/bash 及 SCRIPT_DIR/PROJECT_DIR 路径解析相关行改为 LF,使脚本能被文档构建流程正常加载。
  • 环境变量设置保持一致:ASCEND_HOME_PATH、ASCEND_CUSTOM_OPP_PATH、LD_LIBRARY_PATH 的导出逻辑与 source "$SET_ENV_SCRIPT" 调用内容保持不变,仅行尾变化。
  • 输出提示保持一致:脚本末尾 echo "ASCEND_HOME_PATH=..."、echo "ASCEND_CUSTOM_OPP_PATH=..." 等提示行同样仅作行尾转换,未改变行为。
likedislike
不准确?
CANN-robot
CANN-robot成员
9月29日 评论:

Hi @KaranocaVe, welcome to submitting your first PR to cann-learning-hub!

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
atomgit-bot
atomgit-bot
9月29日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
9月29日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
9月29日 评论:

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
repo-cann/cann-learning-hub ✅ fuyangchenghu, waimaidaole (2/2) ✅ fuyangchenghu (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
KaranocaVe
KaranocaVe
9月29日 评论:

/compile

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

流水线任务触发成功
任务链接 [88e4946b7d1b458bb1c56ceca729435c][流水线指导]

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
pre-commit ✅ SUCCESS

[2026-09-29 01:32:16]    CI执行结束

likedislike
CANN-robotCANN-robot成员
9月29日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
9月29日 添加了label:ci-pipeline-passed
CANN-robotCANN-robot成员
9月29日 删除了label:ci-pipeline-passed
CANN-robotCANN-robot成员
9月29日 添加了label:ci-pipeline-passed
fuyangchenghu成员
23 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
23 天前 添加了label:approved
meme成员
23 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
23 天前 添加了label:lgtm
CANN-robotCANN-robot成员
23 天前 合入了pull request