Skip to content

fix(cli): replace panicking unwrap/index with proper error propagation in linker#5329

Open
junovhs wants to merge 1 commit intoDioxusLabs:mainfrom
junovhs:fix/linker-panic-on-missing-output-arg
Open

fix(cli): replace panicking unwrap/index with proper error propagation in linker#5329
junovhs wants to merge 1 commit intoDioxusLabs:mainfrom
junovhs:fix/linker-panic-on-missing-output-arg

Conversation

@junovhs
Copy link

@junovhs junovhs commented Feb 20, 2026

run_link_inner could have a panic in two ways when fixing the output path -

  • .unwrap() on .position() when searching for -o in linker args, it panics if -o is absent
  • Direct index access args[out + 1] , it panics if -o is the last argument with nothing after it
  • .unwrap() on .find() for /OUT: on Windows. same issue.

I also was inclined to replace .expect("Failed to run linker") on cmd.output() with .context(...)? so that the linker spawn failures propagate clean.

extracted the output path resolution into resolve_output_path for clarity. Errors now propagate via anyhow::Context instead of paniking.

@junovhs junovhs requested a review from a team as a code owner February 20, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant