`fold`ing Effectful `Path` crashes at runtime
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- cli
Research direction
Start by running the linked BUG-006 reproduction with the Roc code shown in the issue, focusing on the effectful Path.join fold and the Path.is_dir! call. Trace the runtime dispatch that produces the crash. Done means the relative-path example completes without a runtime crash and returns the expected Ok({}) result.
Written by the indexing model from the issue text.
Description
This contrived code should check if a relative path is a directory. e.g. if I passed in ./repro ., there'd be no / and I'd just expect it to return Ok({}). Instead, it builds just fine but then crashes at runtime with: [ROC CRASHED] dispatch on a value that can never exist.
Full easy reproduction (AI genn'ed, but I tested) here
app [main!] {
pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.22.0/F1JVZPYfWP71s8vk6tHcV1Qx1Ef6CZkwswGoCn8VHZmL.tar.zst",
}
import pf.OsStr
import pf.Path
require! = |root, relative| {
path = relative.split_on("/").fold(root, Path.join)
is_dir = Path.is_dir!(path)?
if is_dir Ok({}) else Err(Missing(relative))
}
main! = |args|
match args.drop_first(1).map(OsStr.display) {
[text] => require!(Path.utf8(text), "")
_ => Err(BadArgs)
}
- 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 3/5 1-2 days Newbie friendliness 52/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 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
Markdown Preview Fonts Don't Show Selected OptionPossibly taken @RadhiRasho claimed this today. Openstate:needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
zed-industries/zed#65300 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day