-
Notifications
You must be signed in to change notification settings - Fork 318
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
Add no-export in cbindgen.toml config #924
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: tison <[email protected]>
.export | ||
.no_export | ||
.iter() | ||
.any(|i| i == item.deref().export_name()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very sure if export_name
is desired here but it works for me locally.
@@ -179,6 +179,15 @@ impl Builder { | |||
self | |||
} | |||
|
|||
#[allow(unused)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how it works but follow the "include"/"exclude" pattern above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is probably fine with better docs and a test.
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
* Outer docs should be exported. | ||
*/ | ||
typedef struct { | ||
Inner *inner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilio weird. When I use the same code for opendal c binding, it generates something like struct Inner *inner
for such field. But in cbindgen tests it cannot generate the correct result.
It seems that for Style::Tag and Language::C, my work case can pass. But the test coverage also check for other style and language like pyx. The previous @emilio what would you suggest to write a test? I cannot write a proper test for it but it's the same as when we previously merge "no-export` attr. |
For tests, you can include relevant boilerplate using config.header or so to make the test files compile, right? We do that in a bunch of tests. |
@aidanhs @emilio
I need it for my c binding of OpenDAL and local tests pass with this change.
Let me know if this patch needs some improvement :D