elementary / switchboard-plug-about

Switchboard System Plug
GNU General Public License v3.0
25 stars 17 forks source link

fails to compile against fwupd 1.6.2 #224

Closed decathorpe closed 3 years ago

decathorpe commented 3 years ago

Since fwupd was updated from 1.6.1 to 1.6.2, I'm getting the following error when compiling switchboard-plug-about:

src/Interfaces/FirmwareClient.vala:31.17-31.33: error: 2 missing arguments for `unowned GLib.Object GLib.Object.connect (string, ...)'

These are all warnings and errors from the build log:

fwupd.vapi:1074.3-1074.33: warning: Instance methods are not supported in error domains yet
        public unowned string to_string ();
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../src/Views/OperatingSystemView.vala:48.9-48.32: warning: `Hdy.Avatar.set_image_load_func' has been deprecated since 1.2
../src/Views/HardwareView.vala:155.9-155.19: warning: `Gtk.Widget.margin_left' has been deprecated since 3.12
../src/Views/HardwareView.vala:156.9-156.20: warning: `Gtk.Widget.margin_right' has been deprecated since 3.12
../src/Interfaces/FirmwareClient.vala:31.17-31.33: error: 2 missing arguments for `unowned GLib.Object GLib.Object.connect (string, ...)'
                client.connect ();
                ^^^^^^^^^^^^^^^^^
../src/Views/FirmwareView.vala:260.49-260.63: warning: `Fwupd.Release.get_uri' has been deprecated since 1.5.6
Compilation failed: 1 error(s), 5 warning(s)
decathorpe commented 3 years ago

Looks like the Fwupd.Client.connet method was removed from the fwupd VAPI with version 1.6.2, as a diff between 1.6.1 and 1.6.2 shows:

        public bool clear_results (string device_id, GLib.Cancellable? cancellable = null) throws GLib.Error;
        [Version (since = "1.5.0")]
        public async bool clear_results_async (string device_id, GLib.Cancellable? cancellable) throws GLib.Error;
-       [Version (since = "0.7.1")]
-       public bool connect (GLib.Cancellable? cancellable = null) throws GLib.Error;
        [Version (since = "1.5.0")]
        public async bool connect_async (GLib.Cancellable? cancellable) throws GLib.Error;
        [Version (since = "1.4.5")]

I can't tell if this is intentional or not, but there were some changes to Fwupd.Client between fwupd 1.6.1 and 1.6.2, related to making an async version of connect, or something like that, and the API of Fwupd.Client.connect changed to include an error message or something like that (I do not know GObject C well) ...

decathorpe commented 3 years ago

I've asked with fwupd upstream if this was an unintentional change or not ... https://github.com/fwupd/fwupd/issues/3644

Though switchboard-plug-about could start using the new async APIs instead, if it's possible to depend on fwupd >= 1.6.2?

davidmhewitt commented 3 years ago

By reading the code and commit description, it looks like we probably don't need to call connect at all, as it looks like it's called internally in libfwupd anyway. So we can probably drop that and carry on as normal. Just needs someone to test that change 😅

decathorpe commented 3 years ago

Thanks for the fix! :)