GNOME Bugzilla – Bug 721429
Non-working attempt to fix gkr build
Last modified: 2014-01-08 10:36:17 UTC
Looks like https://git.gnome.org/browse/libsecret/commit/?id=dd6fcf87bb1fd605e4350749dacfed52938e8bb0 may have broken the build here. I'm not sure how (if it's possible) to convince Vala to invoke the right API.
Created attachment 265250 [details] [review] Non-working attempt to fix gkr build
The problem here is that the Secret.Service type moved from SecretUnstable-0 to Secret-1, but some of the instance methods (did not). In Vala (and G-I) there is no concept of extension methods, so they are converted from methods to static methods (functions in G-I terminology). Since they are no longer instance methods from the Vala/G-I point of view Vala doesn't expect the finish function to take an instance, but secret_service_read_alias_dbus_path_finish does because it really is an instance method, G-I and Vala just have no way to represent that. All the solutions I see are pretty obvious, but enumerated here for completeness: * Switch to the synchronous method in Seahorse and just avoid the problem. * Make sure the methods are in the same place as the type, either by reverting the change or moving the relevant functions into Secret-1. * Add support for extension methods in Vala, and probably G-I. It's tempting to just think we could change how Vala works to allow you to do something like service_read_alias_dbus_path.end(service, res), but that would break the yield keyword (string foo = yield service_read_alias_dbus_path (service, alias, null)), and it would also require us to start exposing the finish function signatures in Vala, which doesn't seem worth it for a corner case like this.
Sigh. I guess I'll just remove the unstable vapi, and leave people to their own devices. I was trying to be too helpful and organized :)
(In reply to comment #3) > Sigh. I guess I'll just remove the unstable vapi, and leave people to their own > devices. I was trying to be too helpful and organized :) It is a good idea...just one not well supported by tooling =/
See followup patch https://git.gnome.org/browse/seahorse/commit/?id=37d07c29e0ce2df744054207d767972d7d82a4e8
Instead of removing it altogether, you could just use a metadata file to hide the asynchronous versions. AFAICT these types of functions are the only thing left in SecretUnstable, so I believe something like this would do the trick: * skip *_sync skip=false
Well I want to use the asynchronous versions in seahorse in vala code... Anyway, it's possible to endlessly play with this ... but I think the current solution is acceptable.