gobject-introspection data is incorrect

Bug #736308 reported by Pavol Klačanský
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
couchdb-glib
Won't Fix
Medium
Unassigned

Bug Description

Hello, when I have used vapi files from launchpad, it works, but if I use gir, it fails

source code
http://pastebin.ubuntu.com/581156/

error compiling with command "valac ./database_example.vala --pkg Couchdb-1.0 --pkg Desktopcouch-1.0"
http://pastebin.ubuntu.com/581250/

Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

This is because (big) parts of the library are missing annotations, so couchdb_database_get_document has introspectable set to 0, which hides it from languages that are using introspection files. With the entire API of both couchdb-glib and desktopcouch-glib being still in flux [1] I'm not sure how good idea would it be to fix current introspection files.

[1] We went over 2 or 3 different APIs over last few months and they all leave much to be desired. It's apparently a hard task to wrap a completely dynamic interface in C in a way that makes library both easy to use from C code, and from higher-level languages.

Changed in couchdb-glib:
status: New → Confirmed
Revision history for this message
Pavol Klačanský (pavolzetor-deactivatedaccount) wrote :

so, when it will be fixed (I code RSS reader and I stuck with this :/, I have written sqlite database, but I would like to use couchdb)

Revision history for this message
dobey (dobey) wrote :

This is because the gobject-introspection data is incorrect. I've updated the bug title to reflect that.

@Krzysztof The introspection files are generated automatically, so they should never "break" when the API changes, or new API is added.

summary: - cannot compile simple Database file
+ gobject-introspection data is incorrect
Changed in couchdb-glib:
assignee: nobody → Rodney Dawes (dobey)
importance: Undecided → Medium
Revision history for this message
dobey (dobey) wrote :
Download full text (7.3 KiB)

Some warnings from g-ir-scanner:

couchdb-query.c:337: Warning: Couchdb: invalid annotation option: allow
couchdb-database-info.c:104: Warning: Couchdb: couchdb_database_info_ref: unknown parameter 'doc_info' in documentation comment, should be 'dbinfo'
couchdb-database-info.c:123: Warning: Couchdb: couchdb_database_info_unref: unknown parameter 'doc_info' in documentation comment, should be 'dbinfo'
couchdb-database-info.c:63: Warning: Couchdb: couchdb_database_info_new: unknown parameter 'purge_seq' in documentation comment, should be one of 'dbname', 'doc_count', 'doc_del_count', 'update_seq', 'purse_seq', 'compact_running', 'disk_size', 'disk_format_version', 'instance_start_time'
couchdb-struct-field.c:234: Warning: Couchdb: couchdb_struct_field_set_array_field: unknown parameter 'calue' in documentation comment, should be one of 'sf', 'field', 'value'
couchdb-struct-field.c:270: Warning: Couchdb: couchdb_struct_field_set_boolean_field: unknown parameter 'calue' in documentation comment, should be one of 'sf', 'field', 'value'
couchdb-struct-field.c:305: Warning: Couchdb: couchdb_struct_field_set_double_field: unknown parameter 'calue' in documentation comment, should be one of 'sf', 'field', 'value'
couchdb-struct-field.c:340: Warning: Couchdb: couchdb_struct_field_set_int_field: unknown parameter 'calue' in documentation comment, should be one of 'sf', 'field', 'value'
couchdb-struct-field.c:375: Warning: Couchdb: couchdb_struct_field_set_string_field: unknown parameter 'calue' in documentation comment, should be one of 'sf', 'field', 'value'
couchdb-struct-field.c:419: Warning: Couchdb: couchdb_struct_field_set_struct_field: unknown parameter 'calue' in documentation comment, should be one of 'sf', 'field', 'value'
couchdb-database.c:725: Warning: Couchdb: couchdb_database_listen_for_changes: unknown parameter 'dbname' in documentation comment, should be 'database'
couchdb-document-info.c:76: Warning: Couchdb: couchdb_document_info_ref: unknown parameter 'doc_info' in documentation comment, should be 'dbinfo'
couchdb-document-info.c:95: Warning: Couchdb: couchdb_document_info_unref: unknown parameter 'doc_info' in documentation comment, should be 'dbinfo'
couchdb-query.c:189: Warning: Couchdb: couchdb_query_new_for_path: unknown parameter 'design_doc' in documentation comment, should be 'path'
couchdb-query.c:190: Warning: Couchdb: couchdb_query_new_for_path: unknown parameter 'view_name' in documentation comment, should be 'path'
couchdb-query.c:370: Warning: Couchdb: couchdb_query_set_path: unknown parameter 'method' in documentation comment, should be one of 'self', 'path'
couchdb-document-contact.h:111: Warning: Couchdb: Return value is not superclass for constructor; symbol='couchdb_document_contact_email_new' constructed='Couchdb.DocumentContact' return='Couchdb.StructField'
couchdb-document-contact.h:126: Warning: Couchdb: Return value is not superclass for constructor; symbol='couchdb_document_contact_phone_new' constructed='Couchdb.DocumentContact' return='Couchdb.StructField'
couchdb-document-contact.h:154: Warning: Couchdb: Return value is not superclass for constructor; symbol='couchdb_document_contact_address_new' constru...

Read more...

Revision history for this message
Moses Palmér (mosespalmer) wrote :

This bug affects me too.

I have cloned your bazaar repo using git-bzr-ng and fixed a few things---I think ;-)

The attached patch is two commits that I have made to my local git repo. The first one turns on warnings when generating gir and the second one fixes many of them. The ones that remain I think cannot be fixed, since they are caused by functions whose names are like constructors, but that return data of the wrong type:

couchdb-document-contact.h:111: Warning: Couchdb: Return value is not superclass for constructor; symbol='couchdb_document_contact_email_new'

Revision history for this message
Moses Palmér (mosespalmer) wrote :

I looked through the patch that I submitted before and found a few missing annotations.

This patch includes the previous changes and also adds introspection annotations for list content, and hides *_free functions for various lists since that information is already present in the introspection data and those functions are not necessary.

Still missing is data for Couchdb::Query::query_options.

dobey (dobey)
Changed in couchdb-glib:
status: Confirmed → Won't Fix
assignee: Rodney Dawes (dobey) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.