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 an async runtime (e.g tokio or async-std) 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. This led me to go on a multi-year project and the result was the zbus project. Starting from 2.0, it will have async API as it's main API and we can make full use of that in geoclue.
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.