Oxidize service code
Geoclue is a gatekeeper to one of the most sensitive of user's data: geographical location. So it's vital that the code is safe. Also, we've seen many crash reports in the recent years. So it'd be good to have the service code at least, in a language designed for safety while not compromising on efficiency: Rust.
This task will require:
- Redesign of the code to drop the use of glib and its mainloop, in favor of tokio and more Rust-like code. The main difference would be to use futures and streams instead of GObject signals.
- Add async support to dbus-codegen. That shouldn't be a lot of work, since dbus-tokio already exists.
Since we'd want a code redesign, the service code is not a lot of LOC and it'd be nice not having to deal with FFI (and write any unsafe code as a result), I think the best way forward is to start the Rust implementation from scratch. We will start with a dummy implementation first and then port the functionality from C implementation, one class/source at a time. When the functionality is on per with the existing C implementation, we drop the C implementation. This way, the meson+cargo hack would be simpler/minimum as well.
Apart from safety, there will be some other side benefits to this exercise. E.g tests (especially unit tests) are much easier to write in Rust than in C and during this exercise, we should ensure that we add tests for each module at least, if not for every public function of each module.
I will be proposing this to the GSoC ideas for 2019 session, under GNOME org.