Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Improve signal 13 (SIGPIPE) handling in basic-cli

未关闭
#476 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
cli

调研方向

首先使用提供的 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 模板
  • 阅读贡献指南

从这里开始

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

roc-lang/basic-cli 的其他 Issue

查看 roc-lang/basic-cli 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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