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 660361 - [PATCH] Invalid libpeas-1.0 bindings for ExtensionSet and Activatable
[PATCH] Invalid libpeas-1.0 bindings for ExtensionSet and Activatable
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.14.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 658006
Blocks:
 
 
Reported: 2011-09-28 13:48 UTC by Oliver Sauder
Modified: 2012-06-28 06:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixing libpeas binding (1.97 KB, patch)
2011-09-28 13:50 UTC, Oliver Sauder
none Details | Review
Activatable sample (623 bytes, text/x-vala)
2011-09-28 14:54 UTC, Oliver Sauder
  Details

Description Oliver Sauder 2011-09-28 13:48:00 UTC
In the current libpeas-1.0 bindings there is no constructor available for ExtensionSet. Furthermore should the interface Activatable not expose an object.

See attached patch to fix those issues.
Comment 1 Oliver Sauder 2011-09-28 13:50:02 UTC
Created attachment 197667 [details] [review]
Fixing libpeas binding
Comment 2 Luca Bruno 2011-09-28 13:59:50 UTC
Thanks for the patch. Why hide .newv? And why "object" shouldn't be exposed (I see it in the docs)?
Comment 3 Oliver Sauder 2011-09-28 14:17:15 UTC
Wow what quick answer ;). Thanks.

Well, both methods create invalid c code when used.

newv should actually be a constructor I suppose.

When implementing the interface Activatable following error occur during compilation:
error: ‘PeasActivatableInterface’ has no member named ‘get_object’
error: ‘PeasActivatableInterface’ has no member named ‘set_object’

But well removing it might not be the solution that might be true ;).
Comment 4 Luca Bruno 2011-09-28 14:21:19 UTC
(In reply to comment #3)
> Well, both methods create invalid c code when used.
> 
> newv should actually be a constructor I suppose.

In what way it generates invalid C code? The fact that it should be a constructor it's a GIR problem, and it's fully possible to use a constructor as static method.

> 
> When implementing the interface Activatable following error occur during
> compilation:
> error: ‘PeasActivatableInterface’ has no member named ‘get_object’
> error: ‘PeasActivatableInterface’ has no member named ‘set_object’
> 

That's something that shouldn't happen given there's [NoAccessorMethod].

Can you please provide a test case for both issues?
Comment 5 Oliver Sauder 2011-09-28 14:54:10 UTC
Created attachment 197678 [details]
Activatable sample

The first issue with newv has disappeared ;). It seems that a debian package added a libpeas-1.0.vapi to /usr/share/vala/vapi which had a invalid marked constructor newv.
However when using the static method of the libpeas vapi file provided by vala, it works as expected.

To reproduce the issue with the Activatable interface see attached sample.
Comment 6 Luca Bruno 2011-09-28 16:25:10 UTC
The compiler must inherit NoAccessorMethod when implementing such an interface.
See bug 658006.
Comment 7 Luca Bruno 2011-09-28 16:36:00 UTC
commit 6b40d182a7775b23f11ed9cfd91eb01eb693f4b7
Author: Oliver Sauder <os@esite.ch>
Date:   Wed Sep 28 18:28:13 2011 +0200

    libpeas-1.0: Add missing ExtensionSet constructor
    
    Partially fixes bug 660361.

About the debian package shipping libpeas, packages except the library and vala shouldn't ship foreign vapis. They should be kept internal to the application. That is, if libpeas decides to ship a vapi is ok, but not others. So that has to be noticed to the debian package (or upstream).
Comment 8 Oliver Sauder 2011-09-28 17:49:24 UTC
> About the debian package shipping libpeas, packages except the library and vala
> shouldn't ship foreign vapis. They should be kept internal to the application.
> That is, if libpeas decides to ship a vapi is ok, but not others. So that has
> to be noticed to the debian package (or upstream).

I will send a notice to the debian maintainer of the libpeas package.
Comment 9 Evan Nemerson 2012-06-28 06:48:26 UTC
AFAICT fixing bug #658006 finished resolving this issue.  Please re-open if I'm missing something.