Skip to content

增加算子库构建环境报告#33

Open
ghangz wants to merge 2 commits into
MetaX-MACA:mainfrom
ghangz:mengz/add-mcoplib-build-env-report
Open

增加算子库构建环境报告#33
ghangz wants to merge 2 commits into
MetaX-MACA:mainfrom
ghangz:mengz/add-mcoplib-build-env-report

Conversation

@ghangz

@ghangz ghangz commented Jun 10, 2026

Copy link
Copy Markdown

这次改动补上了算子库构建环境报告,主要是为了解决算子库构建和诊断流程里相关信息不够集中、人工整理成本较高的问题,让日常排查、验证和结果归档更直接。

实现上补充了对应工具或脚本逻辑,同时尽量保持现有用法不变,避免影响已有流程。

这一分支已经在沐曦算力环境完成实际验证,相关检查均已通过,现提交合入。

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new diagnostic script, tools/collect_build_env.py, to collect build-time environment details for mcoplib MACA. The review feedback suggests a robust improvement to handle potential UnicodeDecodeError issues when running subprocesses in environments with minimal or misconfigured locales by adding errors="replace" to subprocess.run.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +23 to +30
proc = subprocess.run(
[executable, *command[1:]],
check=False,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
timeout=10,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

在一些精简的容器环境或未正确配置本地化(Locale)的环境中(例如 LANG=C),系统默认编码可能为 ASCII。如果被调用的外部命令(如 gccg++)输出中包含非 ASCII 字符(例如作者名字中的特殊字符或本地化的标点符号),subprocess.run 在使用 text=True 时会因为解码失败而抛出 UnicodeDecodeError,从而导致该工具的诊断信息获取失败。\n\n为了提高诊断脚本在各种复杂环境下的鲁棒性,建议在 subprocess.run 中显式指定 errors="replace"。这样在遇到无法解码的字符时会将其替换为 \ufffd,而不会中断执行。

        proc = subprocess.run(\n            [executable, *command[1:]],\n            check=False,\n            stdout=subprocess.PIPE,\n            stderr=subprocess.PIPE,\n            text=True,\n            errors="replace",\n            timeout=10,\n        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant