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 654502 - Allow building with libvala-0.14 (0.13 development tree)
Allow building with libvala-0.14 (0.13 development tree)
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: language-support-vala
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: Abderrahim Kitouni
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-12 19:46 UTC by Dominique Leuenberger
Modified: 2011-07-25 08:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Detect libvala-0.14 (792 bytes, patch)
2011-07-12 19:46 UTC, Dominique Leuenberger
none Details | Review
Reformatted patch (757 bytes, patch)
2011-07-12 19:50 UTC, Dominique Leuenberger
needs-work Details | Review
Updated patch (1.43 KB, patch)
2011-07-13 17:35 UTC, Dominique Leuenberger
none Details | Review
vala: bgo#654502 - Allow building with libvala-0.14 (0.13 development tree) (1.15 KB, patch)
2011-07-23 19:06 UTC, Abderrahim Kitouni
committed Details | Review

Description Dominique Leuenberger 2011-07-12 19:46:36 UTC
Created attachment 191844 [details] [review]
Detect libvala-0.14

Currently, anjuta checks for libanjuta-0.12 and does not have knowledge about the upcoming 0.14 tree (which, so far, is API compatible).

The attached patch extends configure.ac to be able to also detect libvala-0.14.

I introduced VALA12_REQUIRED and VALA14_REQUIRED in order to distinguish the required patch level of both trees).

When 0.14 is found, it is favored over 0.12 (which, imho, makes sense).

The patch has been tested for 'build' only.
Comment 1 Dominique Leuenberger 2011-07-12 19:50:06 UTC
Created attachment 191845 [details] [review]
Reformatted patch

Fixed some indent issues on the patch.
Comment 2 Johannes Schmid 2011-07-13 16:47:04 UTC
Review of attachment 191845 [details] [review]:

Thanks for the patch, however, it is missing the Makefile.am in language-support-vala, see http://git.gnome.org/browse/anjuta/tree/plugins/language-support-vala/Makefile.am.

The correct solution is probably to set a $(LIBVALA) variable in configure.ac pointing to libvala-0.14 or libvala-0.12 and using this in the Makefile.am
Comment 3 Dominique Leuenberger 2011-07-13 17:25:12 UTC
Johannes, Thanks for that pointer! I will add some more lines to the patch (It did not fail here as I do not have valac installed and as such libvala is being used, but the vala files are not recompiled... )
Comment 4 Dominique Leuenberger 2011-07-13 17:35:17 UTC
Created attachment 191901 [details] [review]
Updated patch

introducing a new variable LIBVALA which is replaced in Makefile.am throghout the tree is needed.

This should address the comments from earlier.
Comment 5 Johannes Schmid 2011-07-17 08:43:57 UTC
Thanks, this patch looks good!

http://git.gnome.org/browse/anjuta/commit/?id=e617e923a9280da3c02c6fbf195a2a5c9e6f450b

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 6 Abderrahim Kitouni 2011-07-19 08:24:46 UTC
I don't like this: if libvala is changing its API version, it is because it is broken regularly.
But the problem here is something else, even the bindings aren't very stable either, and it needs this change to build with vala 0.13 (no time to make a proper patch, I'd like to discuss how to fix things first):

diff --git a/plugins/language-support-vala/plugin.vala b/plugins/language-support-vala/plugin.vala
index b64bc81..235c49d 100644
--- a/plugins/language-support-vala/plugin.vala
+++ b/plugins/language-support-vala/plugin.vala
@@ -245,10 +245,10 @@ public class ValaPlugin : Plugin {
                        if (source_file.filename != file.get_path())
                                continue;
 
-                       string contents;
+                       uint8[] contents;
                        try {
-                               file.load_contents (null, out contents, null, null);
-                               source_file.content = contents;
+                               file.load_contents (null, out contents, null);
+                               source_file.content = (string) contents;
                                update_file (source_file);
                        } catch (Error e) {
                                // ignore
Comment 7 Johannes Schmid 2011-07-19 14:07:21 UTC
If there are API changes we should check if it's worth to support 0.12 in master because we are targetting GNOME 3.2 anyway.

Sorry for committing this change but I assume people check that their patches really work and that there were not API changes that affected us.
Comment 8 Abderrahim Kitouni 2011-07-23 19:06:46 UTC
Created attachment 192534 [details] [review]
vala: bgo#654502 - Allow building with libvala-0.14 (0.13 development tree)
Comment 9 Johannes Schmid 2011-07-25 08:51:17 UTC
Review of attachment 192534 [details] [review]:

Thanks!