Can't compile Scratch with vala 0.16

Bug #952316 reported by Andrea Basso
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Scratch
Fix Released
High
Mario Guerriero

Bug Description

I can't compile Scratch, even the old branches I compiled fine. Sinche I just switched, I think it's because of valac 0.16.
Here are the errors:

/home/andrea/bzr/scratch/scratchcore/TemplateManager.vala:76.26-76.110: warning: unhandled error `GLib.Error'
        var enumerator = origin.enumerate_children ("standard::type,standard::name,standard::content-type", 0);
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/TemplateManager.vala:78.25-78.47: warning: unhandled error `GLib.Error'
        var file_info = enumerator.next_file ();
                        ^^^^^^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/TemplateManager.vala:86.25-86.47: warning: unhandled error `GLib.Error'
            file_info = enumerator.next_file ();
                        ^^^^^^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/TemplateManager.vala:44.9-44.37: warning: unhandled error `GLib.Error'
        destination.make_directory ();
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/TemplateManager.vala:52.17-52.112: warning: unhandled error `GLib.FileError'
                FileUtils.get_contents (Path.build_filename (origin.get_path (), file.get_name ()), out content);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/TemplateManager.vala:58.17-58.113: warning: unhandled error `GLib.FileError'
                FileUtils.set_contents (Path.build_filename (destination.get_path (), file.get_name ()), content);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/TemplateManager.vala:63.17-63.35: warning: unhandled error `GLib.Error'
                orig.copy (dest, 0);
                ^^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/PluginManager.vala:226.42-226.59: error: Argument 2: Cannot convert from `Scratch.Plugins.Manager.on_extension_added' to `Peas.ExtensionSetForeachFunc'
        peas_extension_set_foreach(exts, on_extension_added, null);
                                         ^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/PluginManager.vala:247.51-247.68: error: Argument 2: Cannot convert from `Scratch.Plugins.Manager.on_extension_added' to `Peas.ExtensionSetForeachFunc'
            peas_extension_set_foreach(exts_core, on_extension_added, null);
                                                  ^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/SearchManager.vala:470.9-470.72: warning: unhandled error `GLib.Error'
        css.load_from_data("* { padding-left:0; padding-right:0; }", -1);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/andrea/bzr/scratch/scratchcore/SearchManager.vala:480.5-480.25: warning: Granite.Widgets.ToolArrow.set_state hides inherited method `Gtk.Widget.set_state'. Use the `new' keyword if hiding was intentional
    public void set_state(bool v)
    ^^^^^^^^^^^^^^^^^^^^^
Compilation failed: 2 error(s), 9 warning(s)
make[2]: *** [scratchcore/main.c] Error 1
make[1]: *** [scratchcore/CMakeFiles/scratchcore.dir/all] Error 2
make: *** [all] Error 2

summary: - Can't compile Scratch
+ Can't compile Scratch with vala 0.16
description: updated
Changed in scratch:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Pim Vullers (pimvullers) wrote :

According to http://www.valadoc.org/#!api=libpeas-1.0/Peas.ExtensionSetForeachFunc the on_extension_added function should have three parameters, so one more then currently defined.

Revision history for this message
Pim Vullers (pimvullers) wrote :

This only turns up with vala-0.16 since that checks more carefully than previous versions... so this is really a bug and not just compiler incompatibility.

Revision history for this message
xapantu (xapantu) wrote : Re: [Bug 952316] Re: Can't compile Scratch with vala 0.16

  status triaged
  importance high

If I recall correctly the broke the vapi between vala-0.14 and
vala-0.16. The easier way would be to use the -0.16 and to make a cast
in order to support the -0.14 version, I think it should work (well, we
have to check that it doesn't crash, I'm not 100% sure we don't need
these parameters). Or there is also some # if VALA_0_16 things.

Le 28/03/2012 21:06, Pim Vullers a écrit :
> This only turns up with vala-0.16 since that checks more carefully than
> previous versions... so this is really a bug and not just compiler
> incompatibility.
>

Changed in scratch:
importance: Medium → High
status: Confirmed → Triaged
Changed in scratch:
milestone: none → luna-beta1
Revision history for this message
Mario Guerriero (mefrio-g) wrote :

I managed to port scratch to 0.16 but I am not sure if it works since I have some granite problems...please test it

Changed in scratch:
assignee: nobody → Mario Guerriero (mefrio-g)
status: Triaged → In Progress
Revision history for this message
Pim Vullers (pimvullers) wrote :
Download full text (3.5 KiB)

Same here, when I try to compile scratch I get the following:

[ 2%] Scanning dependencies of target i18n
Generating main.c, SearchManager.c, SourceView.c, Settings.c, PluginManager.c, TemplateManager.c, scratchcore.vapi, scratchcore.h, scratchcore_internal.h
[ 5%] messages.”
[ 5%] Built target i18n
granite.vapi:229.4-229.31: error: overriding method `Granite.Widgets.TimePicker.input' is incompatible with base method `Gtk.SpinButton.input': incompatible type of parameter 1.
   protected override int input (out double new_value);
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
granite.vapi:229.4-229.31: error: Granite.Widgets.TimePicker.input: no suitable method found to override
   protected override int input (out double new_value);
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/TemplateManager.vala:76.26-76.110: warning: unhandled error `GLib.Error'
        var enumerator = origin.enumerate_children ("standard::type,standard::name,standard::content-type", 0);
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/TemplateManager.vala:78.25-78.47: warning: unhandled error `GLib.Error'
        var file_info = enumerator.next_file ();
                        ^^^^^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/TemplateManager.vala:86.25-86.47: warning: unhandled error `GLib.Error'
            file_info = enumerator.next_file ();
                        ^^^^^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/TemplateManager.vala:44.9-44.37: warning: unhandled error `GLib.Error'
        destination.make_directory ();
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/TemplateManager.vala:52.17-52.112: warning: unhandled error `GLib.FileError'
                FileUtils.get_contents (Path.build_filename (origin.get_path (), file.get_name ()), out content);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/TemplateManager.vala:58.17-58.113: warning: unhandled error `GLib.FileError'
                FileUtils.set_contents (Path.build_filename (destination.get_path (), file.get_name ()), content);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/TemplateManager.vala:63.17-63.35: warning: unhandled error `GLib.Error'
                orig.copy (dest, 0);
                ^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/SearchManager.vala:448.9-448.72: warning: unhandled error `GLib.Error'
        css.load_from_data("* { padding-left:0; padding-right:0; }", -1);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/tmp/portage/app-editors/scratch-9999/work/scratch-9999/scratchcore/SearchManager.vala:458.5-458.25: w...

Read more...

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

I fixed the bug but I suggest to compile with valac-0.14 because with 0.16 scratch can't load the plugin at launch...I am already investigating on this

Changed in scratch:
status: In Progress → Fix Committed
Revision history for this message
Mario Guerriero (mefrio-g) wrote :

Now everything works with 0.16 which is the required valac version

Revision history for this message
Victor Martinez (victored) wrote :

Thank you Mario!

Changed in scratch:
milestone: luna-beta1 → 1.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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