Skip to content

Avoid panics for non-UTF-8 Wave source file names #400

Closed

Description

@LunaStev

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.

Activity

  1. added
    bug
    good first issue
    needs testing
    cross-platform
    on Aug 28, 2026
  2. self-assigned this
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcross-platformgood first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions