After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 643011 - More introspection fixes
More introspection fixes
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: API
git master
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
Dan Williams
Depends on:
Blocks:
 
 
Reported: 2011-02-22 22:37 UTC by Giovanni Campagna
Modified: 2011-03-17 12:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libnm-util: another introspection annotation (1.53 KB, patch)
2011-02-22 22:37 UTC, Giovanni Campagna
committed Details | Review
include: mark flags as such (1.51 KB, patch)
2011-03-15 19:41 UTC, Giovanni Campagna
none Details | Review
Add annotations for new API (7.62 KB, patch)
2011-03-16 14:47 UTC, Giovanni Campagna
none Details | Review

Description Giovanni Campagna 2011-02-22 22:37:17 UTC
I think it is better to wait for a released Javascript applet before saying "fixed", as I've found another place in need of annotations.
Comment 1 Giovanni Campagna 2011-02-22 22:37:42 UTC
Created attachment 181649 [details] [review]
libnm-util: another introspection annotation

nm_utils_ssid_to_utf8 has gchar* in the signature, but it accepts
an array of bytes, not a string. Fix with the appropriate
annotation.
Comment 2 Dan Williams 2011-02-23 17:09:10 UTC
How about we just change the prototype of that function to take a GByteArray?  I can't find anywhere in NM or nm-applet that it's used with just a char* and size_t.  It's always given the byte array components.
Comment 3 Giovanni Campagna 2011-02-23 17:18:54 UTC
If you have no problems with this new API break, fine for me to make it a GByteArray.
In that case, no annotations are needed for the parameter. You still need (transfer full) for the return value.
Comment 4 Dan Williams 2011-02-23 17:54:52 UTC
Just pushed this change actually; does the argument need an annotation at all?  I added transfer full to the return value.
Comment 5 Dan Williams 2011-02-23 17:55:15 UTC
Ok, fixed then; we'll keep this open for further introspection fixes.
Comment 6 Giovanni Campagna 2011-02-23 17:59:26 UTC
(In reply to comment #4)
> Just pushed this change actually; does the argument need an annotation at all? 
> I added transfer full to the return value.

Ok, perfect. Nothing else needed, for now. I'll tell you as soon as I find something.
Comment 7 Dan Williams 2011-02-23 18:00:50 UTC
Review of attachment 181649 [details] [review]:

Changed the API; patch no longer needed.  We'll just mark as committed anyway though.
Comment 8 Matthias Clasen 2011-02-25 21:29:30 UTC
Lets close this bug then ? (just so the ones blocked on this get updated...)
Comment 9 Giovanni Campagna 2011-03-15 19:37:20 UTC
Reopening because I need more fixes...
Comment 10 Giovanni Campagna 2011-03-15 19:41:27 UTC
Created attachment 183462 [details] [review]
include: mark flags as such

If the /*< flags >*/ annotation is missing, enums are picked as
enumerations, so bindings won't allow passing combinations of them.
Comment 11 Dan Williams 2011-03-16 06:38:00 UTC
Flags fixes pushed as 86e3d935a23e8c2f48fd0218265a96b36c5bdcb1
Comment 12 Giovanni Campagna 2011-03-16 14:46:49 UTC
New API, new fixes...
(Next time, please check all warnings from introspection compilation)
Comment 13 Giovanni Campagna 2011-03-16 14:47:39 UTC
Created attachment 183542 [details] [review]
Add annotations for new API

The new setting getters need (transfer none), or they're skipped.
The device paramter to nm_client_activate_connection can now be NULL.
Comment 14 Dan Williams 2011-03-16 20:18:17 UTC
Oddly, I don't get any errors that I haven't seen before.  This is all I get without having applied the patch:

g-ir-scanner: link: /bin/sh ../libtool --mode=link --tag=CC --silent gcc -o /home/dcbw/Development/fdo/NetworkManager/libnm-glib/tmp-introspectKkpHxr/NMClient-1.0 -export-dynamic -L. libnm-glib.la -pthread -L/lib64 -lgio-2.0 -lgmodule-2.0 -ldbus-glib-1 -ldbus-1 -lpthread -lgudev-1.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 /home/dcbw/Development/fdo/NetworkManager/libnm-glib/tmp-introspectKkpHxr/NMClient-1.0.o
nm-ip4-config.h:65: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_ip4_config_new' constructed='NMClient.IP4Config' return='GObject.Object'
nm-dhcp4-config.h:60: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_dhcp4_config_new' constructed='NMClient.DHCP4Config' return='GObject.Object'
nm-ip6-config.h:64: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_ip6_config_new' constructed='NMClient.IP6Config' return='GObject.Object'
nm-dhcp6-config.h:60: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_dhcp6_config_new' constructed='NMClient.DHCP6Config' return='GObject.Object'
nm-device.h:90: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_device_new' constructed='NMClient.Device' return='GObject.Object'
nm-active-connection.h:67: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_active_connection_new' constructed='NMClient.ActiveConnection' return='GObject.Object'
nm-device-ethernet.h:61: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_device_ethernet_new' constructed='NMClient.DeviceEthernet' return='GObject.Object'
nm-access-point.h:73: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_access_point_new' constructed='NMClient.AccessPoint' return='GObject.Object'
nm-device-wifi.h:68: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_device_wifi_new' constructed='NMClient.DeviceWifi' return='GObject.Object'
nm-device-bt.h:61: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_device_bt_new' constructed='NMClient.DeviceBt' return='GObject.Object'
nm-vpn-connection.h:68: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_vpn_connection_new' constructed='NMClient.VPNConnection' return='GObject.Object'
nm-wimax-nsp.h:70: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_wimax_nsp_new' constructed='NMClient.WimaxNsp' return='GObject.Object'
nm-device-wimax.h:61: Warning: NMClient: Return value is not superclass for constructor; symbol='nm_device_wimax_new' constructed='NMClient.DeviceWimax' return='GObject.Object'
nm-remote-settings.h:62: Warning: NMClient: nm_remote_settings_error_quark: Couldn't find corresponding enumeration
nm-secret-agent.h:31: Warning: NMClient: nm_secret_agent_error_quark: Couldn't find corresponding enumeration
/usr/bin/g-ir-compiler --includedir=../libnm-util --includedir=. NMClient-1.0.gir -o NMClient-1.0.typelib
make[2]: Leaving directory `/home/dcbw/Development/fdo/NetworkManager/libnm-glib'

Is there some warning flag we're missing in the Makefiles?  I'm using gobject-introspection 0.10.4.
Comment 15 Dan Williams 2011-03-16 20:24:57 UTC
Pushed as 4480365db704d033f28ec5fbd03507d34bf292d1
Comment 16 Giovanni Campagna 2011-03-17 12:51:00 UTC
(In reply to comment #14)
> Oddly, I don't get any errors that I haven't seen before.  This is all I get
> without having applied the patch:
> 
> g-ir-scanner: link: /bin/sh ../libtool --mode=link --tag=CC --silent gcc -o
> /home/dcbw/Development/fdo/NetworkManager/libnm-glib/tmp-introspectKkpHxr/NMClient-1.0
> -export-dynamic -L. libnm-glib.la -pthread -L/lib64 -lgio-2.0 -lgmodule-2.0
> -ldbus-glib-1 -ldbus-1 -lpthread -lgudev-1.0 -lgobject-2.0 -lgthread-2.0 -lrt
> -lglib-2.0
> /home/dcbw/Development/fdo/NetworkManager/libnm-glib/tmp-introspectKkpHxr/NMClient-1.0.o
> nm-ip4-config.h:65: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_ip4_config_new' constructed='NMClient.IP4Config'
> return='GObject.Object'
> nm-dhcp4-config.h:60: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_dhcp4_config_new' constructed='NMClient.DHCP4Config'
> return='GObject.Object'
> nm-ip6-config.h:64: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_ip6_config_new' constructed='NMClient.IP6Config'
> return='GObject.Object'
> nm-dhcp6-config.h:60: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_dhcp6_config_new' constructed='NMClient.DHCP6Config'
> return='GObject.Object'
> nm-device.h:90: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_device_new' constructed='NMClient.Device'
> return='GObject.Object'
> nm-active-connection.h:67: Warning: NMClient: Return value is not superclass
> for constructor; symbol='nm_active_connection_new'
> constructed='NMClient.ActiveConnection' return='GObject.Object'
> nm-device-ethernet.h:61: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_device_ethernet_new'
> constructed='NMClient.DeviceEthernet' return='GObject.Object'
> nm-access-point.h:73: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_access_point_new' constructed='NMClient.AccessPoint'
> return='GObject.Object'
> nm-device-wifi.h:68: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_device_wifi_new' constructed='NMClient.DeviceWifi'
> return='GObject.Object'
> nm-device-bt.h:61: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_device_bt_new' constructed='NMClient.DeviceBt'
> return='GObject.Object'
> nm-vpn-connection.h:68: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_vpn_connection_new'
> constructed='NMClient.VPNConnection' return='GObject.Object'
> nm-wimax-nsp.h:70: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_wimax_nsp_new' constructed='NMClient.WimaxNsp'
> return='GObject.Object'
> nm-device-wimax.h:61: Warning: NMClient: Return value is not superclass for
> constructor; symbol='nm_device_wimax_new' constructed='NMClient.DeviceWimax'
> return='GObject.Object'
> nm-remote-settings.h:62: Warning: NMClient: nm_remote_settings_error_quark:
> Couldn't find corresponding enumeration
> nm-secret-agent.h:31: Warning: NMClient: nm_secret_agent_error_quark: Couldn't
> find corresponding enumeration
> /usr/bin/g-ir-compiler --includedir=../libnm-util --includedir=.
> NMClient-1.0.gir -o NMClient-1.0.typelib
> make[2]: Leaving directory
> `/home/dcbw/Development/fdo/NetworkManager/libnm-glib'
> 
> Is there some warning flag we're missing in the Makefiles?  I'm using
> gobject-introspection 0.10.4.

Those are bugs in gobject-introspection (bug 637026 for the constructors, bug 637025 for the enums).