Improve signal 13 (SIGPIPE) handling in basic-cli
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from roc-lang/basic-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Unix socket supportOpen
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
roc-lang/basic-cli#455 · 1 comment ·
Maintainers usually reply within 1 day
All issues in roc-lang/basic-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
antithesishq/bombadil#361 ·
Maintainers usually reply within 1 day
-
test(executor_l0): assert execute() TaskOutcome, not only bus events / 断言 execute() 返回的 TaskOutcomeOpentype:debt
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
skaiy/wild_agentos#425 ·
Maintainers usually reply within 1 day
-
Default-import note suggests `import * as process` for velt:process, which does not name the builtinOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug ticket
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cratestack/cratestack#1154 ·
Maintainers usually reply within 1 day
-
status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day