Thanks!
X
Paypal
Github sponsorship
Patreon

articles

Rust+GNOME Hackfest in Madrid

Last week was the third edition of the Rust+GNOME hackfest. What about talking a bit about what we achieved?

What have we achieved?

The goals of this edition were:

And I'm happy to say that we were able to achieve all of these goals! Let's go more into the details now.

Gnome-class?

This is a very important project for both gtk-rs and GNOME. One of its final purpose will be to add object inheritance for GNOME libraries directly into gtk-rs. I'm pretty excited about it and we're getting very close!

At some point, they might need gir in order to generate some bindings. However, it only provided an executable, not a library. Quite difficult to be used from another crate then. In order to make it easier, I splitted the binary and library. You can see the pull request here.

In short: you can now import gir into your crate and use it (if you ever need to, you can!).

Continuous integration process?

I suppose that everyone knows what continuous integration is, and how important it is for any project. I added this goal as a personal one and was finally able to improve it.

To sum up a bit how it works to test gtk-rs crates: we basically build all crates on GTK 3.4 and 3.18 versions (including examples). Seems pretty complete as is, right? So what did I add?

We have a feature (called dox) which allows us to generate documentation for all items in a crate with rustdoc. So for example, if you're on linux, if you run cargo doc, you'll only get linux items. Such a function would not get its documentation generated for example:

Run/// Some documentation.
#[cfg(windows)]
pub fn a_windows_only_function() {}

This is where the dox feature comes in:

Run/// Some documentation.
#[cfg(any(windows, feature = "dox"))]
pub fn a_windows_only_function() {}

Now, as long as you run cargo doc with the dox feature enabled:

cargo doc --features dox

This function will get its documentation generated as well, whatever platform you're on. But of course, the same issue occurs with item which aren't supposed to available to your current GNOME library version. If you have a GTK 3.12 installed on your system, it seems obvious that items which require the 3.22 version won't be documented either. dox fixes this issue as well.

So now, I assume that you got how important the dox feature was and why it strongly requires to be tested as well. After a few days of troubles, I was finally able to enable it to be tested on glib. Now I "just" need to add it for all other crates as well. Lot of fun incoming! :)

The second point which needed to be improved was the tested platforms. Before this hackfest, we tested on Linux and Windows. However, nothing for OSX whereas it is a supported platform as well. After facing a certain amount of issues, I was finally able to make it work as well.

Those two things might seem not really important for you, but if you have full confidence in your continuous integration process, it makes new features and improvements way easier to be integrated into the codebase.

Another thing that will be added (in a more or less closer future) is a crate to test GUI. @antoyo is working on it and was able to make it work. A few things are needed but we're getting there!

Improving crates binding?

It seems like a never ending work but we're working really hard on making gtk-rs API as easy to use and complete as possible. This time, I focused on Pango by adding a few more items. Not much is remaining!

Most of our work is now focused on gir in order to reduce how much manual bindings is required. Automatic generation is way safer than manual one and makes really easy to spread an API change or any kind of improvement. I'm quite happy and impressed of what we achieved to do in this crate and hope we'll be able at some point to just not have any manual bindings at all. Who knows? Maybe we will at some point!

Madrid

It was my first time in Madrid. A nice weather and a great city! And as usual, we ate well:


Madrid restaurant

At this point, I'm just wondering if there isn't a competition to know who's going to feed the others the most. For the moment, I think Alberto is the winner. Good luck for beating him next time Federico!

For this edition, I'd like to thank Alberto Ruiz a lot for taking care of so much things and OpenShine for hosting us!

And finally (last but not least):

Thanks to the GNOME Foundation...

... for sponsoring my travel and accomodation during the hackfest!


Berlin restaurant
Posted on the 21/04/2018 at 21:00 by @GuillaumeGomez

Previous article

GNOME+Rust Hackfest in Thessaloniki

Next article

New sysinfo version (huge performance improvements!)
Back to articles list
RSS feedRSS feed