Skip to content

cppwinrt should consistently panic on failure #3415

Merged
kennykerr merged 2 commits intomasterfrom
cppwinrt-panic
Jan 6, 2025
Merged

cppwinrt should consistently panic on failure #3415
kennykerr merged 2 commits intomasterfrom
cppwinrt-panic

Conversation

@kennykerr
Copy link
Copy Markdown
Collaborator

This brings the cppwinrt crate in line with the windows-bindgen crate that consistently panics on failure. As a build tool, this is simpler to consume and provides more reliable build failure information.

@kennykerr kennykerr requested a review from Copilot January 6, 2025 16:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • crates/tests/winrt/noexcept/build.rs: Evaluated as low risk
  • crates/tests/winrt/ref_params/build.rs: Evaluated as low risk
Comments suppressed due to low confidence (2)

crates/libs/cppwinrt/src/lib.rs:32

  • The panic message should provide more context. Consider changing it to panic!("cppwinrt failed: {}", String::from_utf8_lossy(&output.stderr)).
panic!("{}", String::from_utf8_lossy(&output.stderr))

crates/libs/cppwinrt/src/lib.rs:42

  • Ensure that the new behavior of panicking on failure is adequately covered by tests. The invalid_arg test should cover this scenario.
fn invalid_arg() {

@kennykerr kennykerr merged commit 5e8ce09 into master Jan 6, 2025
@kennykerr kennykerr deleted the cppwinrt-panic branch January 6, 2025 17:27
@kennykerr kennykerr mentioned this pull request Jan 6, 2025
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.

2 participants