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 693455 - Allow to specify the order of methods in class
Allow to specify the order of methods in class
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator: GObject
unspecified
Other Linux
: Normal blocker
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 678912
Blocks: 549149 623694 685175 696979
 
 
Reported: 2013-02-09 01:17 UTC by Maciej (Matthew) Piechotka
Modified: 2013-07-25 07:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Add-Since-attribute-for-interfaces.patch (11.87 KB, patch)
2013-04-20 15:02 UTC, Maciej (Matthew) Piechotka
none Details | Review
0001-Add-CCode-ordering-attribute-for-interfaces.patch (9.26 KB, patch)
2013-05-11 20:47 UTC, Maciej (Matthew) Piechotka
committed Details | Review

Description Maciej (Matthew) Piechotka 2013-02-09 01:17:15 UTC
Vala while generating interfaces (and classes?) puts the properties calls at the end. This causes problem as it prevents from adding virtual, non-abstract method to interfaces without breaking ABI.
Comment 1 Maciej (Matthew) Piechotka 2013-04-20 15:02:46 UTC
Created attachment 242005 [details] [review]
0001-Add-Since-attribute-for-interfaces.patch

Add Since attribute and code to sort the elements in interface accordingly.
Comment 2 Evan Nemerson 2013-04-26 20:26:21 UTC
I like the idea, but I'd rather see it implemented with a [Version] attribute (see bug #678912).
Comment 3 Maciej (Matthew) Piechotka 2013-04-26 20:35:35 UTC
After discussion with Evan on IRC - bumping the importance as it is blocker for libgee development with explanation:

The interfaces have properties and signals virtuals after the methods so adding any method breaks the ABI.

Of course the patch can be trivially modified to name the property Version.
Comment 4 Luca Bruno 2013-04-27 18:15:52 UTC
What happens if you reorder the methods that have the same Since version?
Comment 5 Maciej (Matthew) Piechotka 2013-04-27 21:28:12 UTC
In the patch - they are reordered in order they are declared. For default version it is needed as otherwise the methods would be reordered after applying the patch thus globally breaking the ABI. I didn't thought changing it for methods with attribute is warranted.
Comment 6 Maciej (Matthew) Piechotka 2013-05-11 20:47:16 UTC
Created attachment 243865 [details] [review]
0001-Add-CCode-ordering-attribute-for-interfaces.patch

I've decided to go for stricter approach then one discussed with Luca:

 - No gaps are allowed
 - If ordering is specified all virtuals need to have it specified.
Comment 7 Maciej (Matthew) Piechotka 2013-07-23 16:19:55 UTC
(In reply to comment #6)
> Created an attachment (id=243865) [details] [review]
> 0001-Add-CCode-ordering-attribute-for-interfaces.patch
> 

Ping. May I ask for review (should go in/needs work)?
Comment 8 Luca Bruno 2013-07-23 18:20:21 UTC
Review of attachment 243865 [details] [review]:

Looks fine, let's do it.
Comment 9 Maciej (Matthew) Piechotka 2013-07-25 07:14:36 UTC
Comment on attachment 243865 [details] [review]
0001-Add-CCode-ordering-attribute-for-interfaces.patch

commit 2886366e6b5499b46e04029b9a257ae9dc880766
Author: Maciej Piechotka <uzytkownik2@gmail.com>
Date:   Sat May 11 21:43:30 2013 +0100

    Add CCode ordering attribute for interfaces