Offload: a 'run' job reports PASS when its command failed (and the README's $BLD/b path does not exist)

未关闭 适合新手
#1,347 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bash, shell
领域
build-system, cli

调研方向

首先查看 tools/offload/run-offload.sh 以及 README 命令表中对 run 作业及其构建树路径的说明。使用一个早期流水线步骤失败的命令复现所报告的行为,然后让 run 传递完整命令的失败状态,并确定失败的命令。完成的标准是示例不再输出 PASS 或以 0 退出,并且文档中记录的构建路径与 run 使用的路径一致。

由索引模型根据 Issue 内容生成。

描述

tools/offload/run-offload.sh ... run <cmd> reports PASS and exits 0 when
the command it ran failed.

Seen today building a package on beryllium:

run bash -c 'cd $BLD/b && cpack -G DEB 2>&1 | tail -5; ls -lh *.deb | tail -5'

bash: line 1: cd: /home/andy/ecce-offload/build/main/b: No such file or directory
ls: cannot access '*.deb': No such file or directory
PASS: run bash -c ... on main (8825ee3dda) exit 0, 1470s

Nothing was built, and the job reported success.

Two causes, and the second is the one that matters:

  1. The README's command table says the build tree is $BLD/b. For a run
    job it is $BLD/bi, the same tree ctesti uses. Either the README or the
    variable should change; the path in the docs does not exist.
  2. run takes its status from the last command of the pipeline rather than
    from the whole command, so an early failure is invisible. Here cd
    failed, cpack never ran, ls failed, and the job still exited 0.

This is the same shape as #1301 (a ctest -R matching no test exiting 0) and
#1309: a step that did nothing reports success. An offload run is used for
measurement sweeps and packaging, where "it printed PASS" is often the only
thing anyone looks at.

Suggested: run should use set -o pipefail and fail on any non-zero status
in the command it was given, and say which command failed. A run whose
command produced no output at all is also worth failing, as #1309 does for
test scripts.

主要语言
C
星标
10
派生
8
平均合并
6 小时 32 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FriendsofECCE/ECCE 的其他 Issue

查看 FriendsofECCE/ECCE 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。