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

Update to focal #52

Closed
wants to merge 1 commit into from
Closed

Update to focal #52

wants to merge 1 commit into from

Conversation

bilelmoussaoui
Copy link
Member

This updates the release to focal and runs dl.sh afterwards.

@GuillaumeGomez
Copy link
Member

I can't wait to see how many things will break haha.

@sdroege sdroege mentioned this pull request Apr 6, 2020
40 tasks
@sdroege
Copy link
Member

sdroege commented Apr 25, 2020

A way to work around this kind of broken gir file would be to convert unknown types that are only used as pointers to generic pointers (void * / *mut c_void) (and warn about it). This would allow to generate -sys correctly and the non-sys would ignore the affected functions.

Doing that in the parser seems a bit tricky though, maybe @EPashkin can see an easy way to do this?

@EPashkin
Copy link
Member

@sdroege If you talk about Pango pointers, then I think that it need be fixed in this repo replacing it with "name=gpointer c:type=gpointer".
I don't want to add pointer generalization in both normal and sys mode.

@sdroege
Copy link
Member

sdroege commented Apr 26, 2020

I don't want to add pointer generalization in both normal and sys mode.

The reason why I think this should be in gir (instead of fixing the XML) is because the gir files are valid like this and we should probably handle valid gir files. Not having the type happens for "external" or unknown types in gir files. In this case to solve it properly we would have to also add harfbuzz bindings (in addition to fixing the gir file), in other cases there is no proper fix (for example for various system types, say a Windows HANDLE, etc.) when there is no corresponding gir file for the types. In those cases there are two things:

  • the gir file already contains introspectable="0" so we would in theory be supposed to ignore that like all other bindings (but we don't because we can generate lots of these functions just fine)
  • if it's a pointer type then we can still generate it like this by making it a generic pointer instead

I was suggesting to implement that, maybe only for introspectable="0" things though.

@sdroege
Copy link
Member

sdroege commented Apr 26, 2020

As fast workaround to get the focal gir files in, fixing the harfbuzz types in pango by putting these cases into fix.sh seems like a good approach though. @bilelmoussaoui you do that?

@EPashkin
Copy link
Member

Hm, My comment about #54 lost (or just not added).
@bilelmoussaoui Please don't do anything until my PR merged, it only add more problem on rebase

@EPashkin
Copy link
Member

Change to fix Pango and undo gtk Pango.ShowFlags's fix

diff --git a/fix.sh b/fix.sh
index 61fb675..828f02a 100755
--- a/fix.sh
+++ b/fix.sh
@@ -98,7 +98,14 @@ xmlstarlet ed -P -L \
 	-a '//_:callback[@name="ParseErrorFunc"]/_:parameters/_:parameter[@name="section"]/_:type[not(@name) and @c:type="gconstpointer"]' -type attr -n "name" -v "gconstpointer" \
 	Gsk-4.0.gir
 
-# fix unpublished Pango.ShowFlags  gtk 4.0
+# fix harfbuzz types in pango
 xmlstarlet ed -P -L \
-	-u '//_:type[@name="Pango.ShowFlags"]'/@name -v "guint" \
-	Gtk-4.0.gir
+	-i '///_:type[not(@name) and @c:type="hb_font_t*"]' -t 'attr' -n 'name' -v "gconstpointer" \
+	-u '//_:type[@c:type="hb_font_t*"]/@c:type' -v "gconstpointer" \
+	-i '///_:array[not(@name) and @c:type="hb_feature_t*"]' -t 'attr' -n 'name' -v "gconstpointer" \
+	-r '///_:array[@c:type="hb_feature_t*"]' -v "type" \
+	-d '//_:type[@c:type="hb_feature_t*"]/*' \
+	-d '//_:type[@c:type="hb_feature_t*"]/@length' \
+	-d '//_:type[@c:type="hb_feature_t*"]/@zero-terminated' \
+	-u '//_:type[@c:type="hb_feature_t*"]/@c:type' -v "gconstpointer" \
+	Pango-1.0.gir

@EPashkin EPashkin mentioned this pull request Apr 26, 2020
@bilelmoussaoui
Copy link
Member Author

bilelmoussaoui commented Apr 26, 2020

Right, thanks! @sdroege I'm planning to work on it before/during the hackfest

This was referenced Apr 26, 2020
@sdroege
Copy link
Member

sdroege commented May 27, 2020

@bilelmoussaoui Any updates here?

@bilelmoussaoui
Copy link
Member Author

@bilelmoussaoui Any updates here?

I have been busy doing something else lately. Will get back to this next week :)

@bilelmoussaoui
Copy link
Member Author

I somehow messed my fork, I'm going to reopen a new merge request with the required changes

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.

None yet

4 participants