Avoid panics for non-UTF-8 Wave source file names
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
## Problem
The Unix filesystem permits file names that are not valid UTF-8. The Wave object/build path in `src/runner.rs` calls `file_stem().unwrap().to_str().unwrap()`, so a valid source path can crash the compiler instead of returning a CLI diagnostic or producing the requested output.
## Scope
- Remove the UTF-8 and missing-stem unwraps from Wave compile/build paths.
- Keep paths as `Path`/`OsStr` where possible.
- Return a structured CLI error when a usable output name truly cannot be derived.
- Add a Unix-only regression using `OsStringExt` and a non-UTF-8 temporary file name.
- Verify explicit `--out-dir` or output paths still work.
## Completion criteria
- [ ] The regression exits normally without an internal panic.
- [ ] No lossy conversion can cause two different input names to overwrite one output.
- [ ] Normal UTF-8 paths behave exactly as before.
- [ ] `cargo test --locked --test codegen_regressions --jobs 2` passes.
Contributor guide
Research direction
Start in src/runner.rs at the Wave compile/build paths using file_stem(), to_str(), and unwrap(), then run cargo test --locked --test codegen_regressions --jobs 2. Add the Unix-only regression with OsStringExt and a non-UTF-8 temporary filename, checking normal exit, output handling, and explicit --out-dir behavior. Done means no internal panic, no lossy-name collisions, and unchanged UTF-8 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100