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

Wrong generated signature for some Harfbuzz functions #53

Open
aeldemery opened this issue Jul 1, 2022 · 3 comments
Open

Wrong generated signature for some Harfbuzz functions #53

aeldemery opened this issue Jul 1, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@aeldemery
Copy link

Hello, thank you for this useful project.

I've pulled the new gtk4 version 0.13.0 and tried to compile helloworld demo after updating the generated binding against local libraries, but compiler gave some errors in some of the generated functions in harfbuzz library version 4.4.1 like

Dependencies are satisfied
Building: hello_gtk
Error target hello_gtk failed to compile:
Showing last frame. Use --error-trace for full trace.

In lib/gtk4/lib/gi-crystal/src/auto/harf_buzz-0.0/lib_harf_buzz.cr:443:35

 443 | fun hb_ft_font_create(ft_face : Void, destroy : Void*) : Pointer(Void)
                                       ^---
Error: can't use Void as parameter type

changing all Void reference to Void* abolished the error.

here are all functions

fun hb_ft_face_create(ft_face : Void, destroy : Void*) : Pointer(Void)
fun hb_ft_face_create_cached(ft_face : Void) : Pointer(Void)
fun hb_ft_face_create_referenced(ft_face : Void) : Pointer(Void)
fun hb_ft_font_create(ft_face : Void, destroy : Void*) : Pointer(Void)
fun hb_ft_font_create_referenced(ft_face : Void) : Pointer(Void)

thanks

@hugopl hugopl added the bug Something isn't working label Jul 3, 2022
@hugopl
Copy link
Owner

hugopl commented Jul 3, 2022

I just updated my system and got this 🎁 from harfbuzz.

hugopl added a commit that referenced this issue Jul 4, 2022
The proper fix require a refactor to deal with the bad GIR info provided
by HarfBuzz, since most people don't use HarfBuzz directly this "fix"
is acceptable for now.
hugopl added a commit to hugopl/gtk4.cr that referenced this issue Jul 4, 2022
@hugopl
Copy link
Owner

hugopl commented Jul 4, 2022

I did a lazy fix, i.e. I added an option to ignore functions in the lib declaration, the ignore field on binding.yml just ignore the generation of Crystal code, but now there's a lib_ignore that ignore everywhere.

The lazy fix was to unblock people, and also because most of the people don't use HarfBuzz directly. It's not the first time a new HarfBuzz cause problems to binding generation, so I think this option can be useful in the future as well.

@hugopl
Copy link
Owner

hugopl commented Jul 4, 2022

BTW, I'll let the bug open, since the bug wasn't really fixed yet, but at least the code compiles :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants