Failing to generate bindings for ECal-2.0.gir because of Camel-1.2.gir #341

Closed
opened 2026-03-19 13:37:06 +01:00 by jruillier · 4 comments

Hi,

I'm trying to build a desktop app, that need to acces calendar informations from Evolution Data Server.

So, I tried to generate bindings for ECal-2.0.gir with java-gi, but it failed.

I'm using Asahi/Fedora 43 and java-gi:0.14.1.

With this command line (wich includes dependencies for ECal) :
java-gi -d org.gnome /usr/share/gir-1.0/Camel-1.2.gir /usr/share/gir-1.0/Json-1.0.gir /usr/share/gir-1.0/EDataServer-1.2.gir /usr/share/gir-1.0/ICalGLib-3.0.gir /usr/share/gir-1.0/ECal-2.0.gri

I get the following error :
not a valid name: Camel,camelError

Any idea about what's going wrong ?

Hi, I'm trying to build a desktop app, that need to acces calendar informations from Evolution Data Server. So, I tried to generate bindings for ECal-2.0.gir with java-gi, but it failed. I'm using Asahi/Fedora 43 and java-gi:0.14.1. With this command line (wich includes dependencies for ECal) : java-gi -d org.gnome /usr/share/gir-1.0/Camel-1.2.gir /usr/share/gir-1.0/Json-1.0.gir /usr/share/gir-1.0/EDataServer-1.2.gir /usr/share/gir-1.0/ICalGLib-3.0.gir /usr/share/gir-1.0/ECal-2.0.gri I get the following error : not a valid name: Camel,camelError Any idea about what's going wrong ?
Owner

Hi, thanks for trying out java-gi!

You can fix the error if you make a local copy of Camel-1.2.gir and update line 19. Change c:identifier-prefixes="Camel,camel" to c:identifier-prefixes="Camel". Java-GI doesn't expect multiple values here. I'll fix that in the next java-gi release, but at least this is a workaround.

To generate the bindings, you also need to include libxml2.gir.

I tried to compile the resulting bindings, but I'm afraid that there are multiple issues in the generated code. It should not be very hard to fix those manually. In most cases you can just delete the offending method.

Hi, thanks for trying out java-gi! You can fix the error if you make a local copy of `Camel-1.2.gir` and update line 19. Change `c:identifier-prefixes="Camel,camel"` to `c:identifier-prefixes="Camel"`. Java-GI doesn't expect multiple values here. I'll fix that in the next java-gi release, but at least this is a workaround. To generate the bindings, you also need to include `libxml2.gir`. I tried to compile the resulting bindings, but I'm afraid that there are multiple issues in the generated code. It should not be very hard to fix those manually. In most cases you can just delete the offending method.
Author

Thanks :-)

I copied and updated Camel-1.2.gir.

However, I get another error when running this command line :
java-gi -S -d org.gnome /usr/share/gir-1.0/libxml2-2.0.gir ./Camel-1.2.gir /usr/share/gir-1.0/Json-1.0.gir /usr/share/gir-1.0/EDataServer-1.2.gir /usr/share/gir-1.0/ICalGLib-3.0.gir /usr/share/gir-1.0/ECal-2.0.gri

java.lang.IllegalArgumentException: gir file ECal-2.0.gri is invalid
at org.javagi.generator/org.javagi.JavaGI.call(JavaGI.java:181)
at org.javagi.generator/org.javagi.JavaGI.call(JavaGI.java:59)
at info.picocli@4.7.7/picocli.CommandLine.executeUserObject(CommandLine.java:2031)
at info.picocli@4.7.7/picocli.CommandLine.access$1500(CommandLine.java:148)
at info.picocli@4.7.7/picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2469)
at info.picocli@4.7.7/picocli.CommandLine$RunLast.handle(CommandLine.java:2461)
at info.picocli@4.7.7/picocli.CommandLine$RunLast.handle(CommandLine.java:2423)
at info.picocli@4.7.7/picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at info.picocli@4.7.7/picocli.CommandLine$RunLast.execute(CommandLine.java:2425)
at info.picocli@4.7.7/picocli.CommandLine.execute(CommandLine.java:2174)
at org.javagi.generator/org.javagi.JavaGI.main(JavaGI.java:130)

Any idea ?

Thanks :-) I copied and updated Camel-1.2.gir. However, I get another error when running this command line : java-gi -S -d org.gnome /usr/share/gir-1.0/libxml2-2.0.gir ./Camel-1.2.gir /usr/share/gir-1.0/Json-1.0.gir /usr/share/gir-1.0/EDataServer-1.2.gir /usr/share/gir-1.0/ICalGLib-3.0.gir /usr/share/gir-1.0/ECal-2.0.gri java.lang.IllegalArgumentException: gir file ECal-2.0.gri is invalid at org.javagi.generator/org.javagi.JavaGI.call(JavaGI.java:181) at org.javagi.generator/org.javagi.JavaGI.call(JavaGI.java:59) at info.picocli@4.7.7/picocli.CommandLine.executeUserObject(CommandLine.java:2031) at info.picocli@4.7.7/picocli.CommandLine.access$1500(CommandLine.java:148) at info.picocli@4.7.7/picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2469) at info.picocli@4.7.7/picocli.CommandLine$RunLast.handle(CommandLine.java:2461) at info.picocli@4.7.7/picocli.CommandLine$RunLast.handle(CommandLine.java:2423) at info.picocli@4.7.7/picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277) at info.picocli@4.7.7/picocli.CommandLine$RunLast.execute(CommandLine.java:2425) at info.picocli@4.7.7/picocli.CommandLine.execute(CommandLine.java:2174) at org.javagi.generator/org.javagi.JavaGI.main(JavaGI.java:130) Any idea ?
Owner

Yes, typo, "gri" should be "gir".

Yes, typo, "gri" should be "gir".
Author

With your help, bindings generation works without error, thanks.

With your help, bindings generation works without error, thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
java-gi/java-gi#341
No description provided.