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

Auto generate rust bindings #4696

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

youyuanwu
Copy link

Description

The FFI definitions for rust should be auto generated instead of manually written.
This PR adds a new rust crate with auto generated bindings aiming to replace or remove all the manual bindings in the existing crate. Existing code is not changed. In future, the safe rust wrappers should be written on top of this generated bindings.

The generated code is from winmd and windows-bindgen tool chain and is cross platform. It does not have any function that requires linking, and I plan to leave those functions to be dynamically loaded.

Testing

NA

Documentation

TBD

@youyuanwu youyuanwu requested a review from a team as a code owner December 9, 2024 18:00
@@ -143,8 +143,10 @@ mod status {
#[cfg(target_os = "linux")]
Copy link
Author

Choose a reason for hiding this comment

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

I must have run cargo fmt. This might need to be reverted.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's revert that, and maybe bring it in a separate PR if you think it's really needed.

@nibanks nibanks added the Language: Rust Related to the Rust interop layer label Dec 9, 2024
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.68%. Comparing base (d22ec11) to head (d2f8ed1).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4696      +/-   ##
==========================================
+ Coverage   85.87%   86.68%   +0.80%     
==========================================
  Files          56       56              
  Lines       17361    17361              
==========================================
+ Hits        14909    15049     +140     
+ Misses       2452     2312     -140     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language: Rust Related to the Rust interop layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants