Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Improve signal 13 (SIGPIPE) handling in basic-cli

Open
#476 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start by reproducing the issue with the provided test.roc and the set -o pipefail commands, then compare roc test.roc with the built executable from roc build. Trace whether the SIGPIPE diagnostic comes from basic-cli or the Roc compiler. Done means the handling and caller-visible error behavior are clarified and the unwanted diagnostic is resolved.

Written by the indexing model from the issue text.

Description

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 $?
Dominant language
Rust
Stars
121
Forks
46
Avg merge
20h 53m
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from roc-lang/basic-cli

All issues in roc-lang/basic-cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.