Improve signal 13 (SIGPIPE) handling in basic-cli
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先使用提供的 test.roc 和 set -o pipefail 命令复现问题,然后将 roc test.roc 与通过 roc build 构建的可执行文件进行比较。跟踪 SIGPIPE 诊断是来自 basic-cli 还是 Roc 编译器。完成的标准是明确处理方式和调用方可见的错误行为,并解决不需要的诊断信息。
由索引模型根据 Issue 内容生成。
描述
Seems like basic-cli does not handle SIGPIPE well. I'm not sure if this is one issue or two. Is compiler diagnostic redundant because it doesn't happen on the executable? And should broken pipe error be propagated to the caller?
Example worth thousands of words:
How to reproduce it
test.roc
app [main!] {
cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.21.0/4rAQg8kUYZ3Vksr4qMQHpaFYNiHSn9GgS7gVxghd1XYV.tar.zst",
}
import cli.Stdout
main! = |_args| write_lines!(100000)
write_lines! = |remaining| {
if remaining == 0 {
Ok({})
} else {
Stdout.line!("line")?
write_lines!(remaining - 1)
}
}
Run:
set -o pipefail
roc test.roc | head -n 1
echo $?
Get this result:
line
The program was killed by signal 13: Unknown signal.
This is likely a bug in the Roc compiler.
...
141
Note that executable (not roc run) works and returns 141 without any errors:
roc build test.roc
set -o pipefail
./test | head -n 1
echo $?
- 主要语言
- Rust
- 星标
- 121
- 派生
- 45
- 平均合并
- 19 小时 1 分钟
- 30 天内合并 PR
- 16
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
roc-lang/basic-cli 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 45/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 45/100
roc-lang/basic-cli#455 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 32/100
维护者通常 1 天内回复
查看 roc-lang/basic-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
aws-samples/sample-pacer#76 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
axodotdev/cargo-dist#2523 ·
维护者通常 2 天内回复