Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cppwinrt should consistently panic on failure #3415

Merged
merged 2 commits into from
Jan 6, 2025
Merged

Conversation

kennykerr
Copy link
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

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
75 checks passed
@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.

1 participant