Since a few weeks ago, librsvg is now in oss-fuzz — Google's constantly-running fuzz-testing for OSS projects — and the crashes have started coming in. I'll have a lot more to say soon about crashes in Cairo, which is where the majority of the bugs are so far, but for now I …
It has been, what, like four years since librsvg got fully rustified, and now it is time to move another piece of critical infrastructure to a memory-safe language. I'm talking about libipuz, the GObject-based C library that GNOME Crosswords uses underneath. This is a library that parses the ipuz file …
Starting with version 2.58.0, librsvg will no longer use gdk-pixbuf to decode raster images that are referenced from SVG documents. For example, an element like this: href="foo.jpg" width="100" height="100"/> I have just pushed a merge request to make librsvg use the image-rs …
Skip to main content Federico Vilanova / Barcelona 2006: Memories of GUADECs past Open navigation Federico's Blog ...
Skip to main content Federico Stuttgart 2005: Memories of GUADECs past Open navigation Federico's Blog ...
Since last Friday, librsvg is available from crates.io. You can add this line to your dependencies in Cargo.toml: librsvg = "2.57.0-beta.2" I am nailing down the release process for this, but my intention is that starting with GNOME 45 / librsvg-2.57.0, the Rust crate will …
Someone mentioned cargo-bloat the other day and it reminded me that I have been wanting to measure the code size for generic functions in librsvg, and see if there are improvements to be made. Cargo-bloat can give you a rough estimate of the code size for each Rust crate in …
Disculpen la pausa tan larga en escribir este blog. Comencé a poner mis hilos de carpintería en Mastodon y dejé olvidado este lugar. Pero bien, prosigamos. Dos mesitas de noche: Parte 1: Preparar las piezas Parte 2: Marcar las patas Parte 3: Los cajones En la parte 2 hicimos las …
I have been updating the text layout roadmap for librsvg, and part of this involves describing how some of the current code works — for example, how a element gets broken up into a tree of Chunk and Span structures. Notice how those links go to the generated documentation for …
When I started helping out with Crosswords, JRB taught me a valuable lesson: before implementing a non-trivial feature, or doing a non-trivial change, one should first write a document with the design of the feature. It doesn't have to be anything formal; just an explanation of where you are coming …
At GUADEC 2022 in Guadalajara I gave a talk, Paying technical debt in our accessibility infrastructure. This is a transcript for that talk. The video for the talk starts at 2:25:06 and ends at 3:07:18; you can click on the image above and it will take …
I have just renamed librsvg's master branch to main, as other modules already have. This is what I did: Rename the local branch, and push it: git branch -m master main git push origin main Change the default branch in gitlab; for librsvg this is in the repository settings / Default …
Over the past weeks I have been fixing the test coverage report for at-spi2-core. It has been a bit of an adventure where I had to do these: Replace a code coverage tool for another one... ... which was easier to modify to produce more accessible HTML reports. Figuring out why …
Over the past week I worked on merging the atk and at-spi2-atk repositories into at-spi2-core. A quick reminder of what they do: at-spi2-core: Has the XML definitions of the DBus interfaces for accessibility — what lets a random widget identify itself as having a Button role, or what lets a random …
This is somewhat of an extended abstract for the talk I want to give at GUADEC. Curently, very few people work on GNOME's accessibility infrastructure, which is basically what the free desktop ecosystem uses regardless of GUI toolkit. After Oracle acquired Sun Microsystems in 2010, paid work on accessibility virtually …
I'm a lousy sysadmin. For years, my strategy for managing my machines in my home network has been one of maximum neglect: Avoid distribution upgrades or reinstalls as much as possible, because stuff breaks or loses its configuration. Keep my $HOME intact across upgrades, to preserve my personal configuration files …
Librsvg's documentation tooling is pretty ancient. The man page for rsvg-convert is written by hand in troff, and the C library's reference documentation still uses the venerable gtk-doc. As part of the modernization effort, I have turned the man page into a reStructuredText document, and the C API documentation into …
Up to now, text support in librsvg has been fairly limited. The text chapter in the SVG spec is pretty big and it contains features that are very much outside of my experience (right-to-left languages, vertical text). But now I think I have a plan for how to improve the …
"Themes in GNOME" is a complicated topic in technical and social terms. Technically there are a lot of incomplete moving parts; socially there is a lot of missing documentation to be written, a lot of miscommunication and mismatched expectations. The following is a brief and incomplete, but hopefully encouraging, summary …
Bzip2's stable repository is maintained at Sourceware by Mark Wielaard. In 2019 I started maintaining an experimental repository in GitLab, with the intention of updating the build system and starting a Rust port of bzip2. Unfortunately I have left this project slip by. The new maintainer of the experimental repository …
Almost five years ago librsvg introduced Rust into its source code. Around the same time, Linux distributions started shipping the first versions of Firefox that also required Rust. I unashamedly wanted to ride that wave: distros would have to integrate a new language in their build infrastructure, or they would …
Please do not use librsvg 2.40.x; it cannot render recent Adwaita icon themes correctly. The librsvg 2.40.x series is the last "C only" version of the library; it was deprecated in 2017. During the port to Rust, I rewrote the path parser to be spec-compliant, and …
Some important changes are afoot in librsvg. Changes to continuous integration Some days ago, Dunja Lalic rewrote the continuous integration scripts to be much faster. A complete pipeline used to take about 90 minutes to run, now it takes about 15 minutes on average. The description of changes is interesting …
There are two projects in librsvg available for Outreachy applicants in the December 2020 / March 2021 round: Revamp the text engine - Do you know about international text layout? Can you read a right-to-left language, or do you write in a language that requires complex shaping? Would you like to implement …
I've seen GNOME people (often, people who have been working for a long time on C libraries) express concerns along the following lines: Compiled Rust code doesn't have a stable ABI (application binary interface). So, we can't have shared libraries in the traditional fashion of Linux distributions. Also Rust bundles …
I forgot to write this a few days ago; I hope it is not too late. The GNOME Foundation's elections for the Board are coming up, and we are looking for candidates. Of the 7 directors, we are replacing 4, and the 3 remaining positions remain for another year. You …
I started using Emacs in 1995, and since then I have been carrying a .emacs that by now has a lot of accumulated crap. It is such an old configuration that it didn't even use the modern convention of ~/.emacs.d/init.el (and it looks like a newer Emacs …
Let's continue with the enormous SVG from the last time, a map extracted from OpenStreetMap. According to Massif, peak memory consumption for that file occurs at the following point during the execution of rsvg-convert. I pasted only the part that refers to Bézier paths: ...
We got a bug with a gigantic SVG of a map extracted from OpenStreetMap, and it has about 600,000 elements. Most of them are , that is, specifications for Bézier paths. A can look like this: d="m 2239.05,1890.28 5.3,-1.81"/> The …
To continue with last time's topic, let's see how to make librsvg's DOM nodes smaller in memory. Since that time, there have been some changes to the code; that is why in this post some of the type names are different from last time's. Every SVG element is represented with …
Are you a student qualified to run for Summer of Code 2020? I'm willing to mentor the following project for librsvg. Project: Revamp the text engine in librsvg Librsvg supports only a few features of the SVG Text specification. It requires extra features to be really useful: Proper bidirectional support …
Librsvg's memory consumption has not been a problem so far for GNOME's use cases, which is basically rendering icons. But for SVG files with thousands of elements, it could do a lot better. Memory consumption in the DOM Librsvg shares some common problems with web browsers: it must construct a …
Librsvg exports two public APIs: the C API that is in turn available to other languages through GObject Introspection, and the Rust API. You could call this a use of the facade pattern on top of the rsvg_internals crate. That crate is the actual implementation of librsvg, and exports an …
Gnome-shell uses CSS processing code that dates from HippoCanvas, a CSS-aware canvas from around 2006. It uses libcroco to parse CSS, and implements selector matching by hand in C. This code is getting rather dated, and libcroco is unmaintained. I've been reading the code for StTheme and StThemeNode, and it …
CSS length values have a number and a unit, e.g. 5cm or 6px. Sometimes the unit is a percentage, like 50%, and SVG says that lengths with percentage units should be resolved with respect to a certain rectangle. For example, consider this circle element: cx="50%" cy="75 …
Summary: after an epic amount of refactoring, librsvg now does all CSS parsing and matching in Rust, without using libcroco. In addition, the CSS engine comes from Mozilla Servo, so it should be able to handle much more complex CSS than librsvg ever could before. This is the story of …
I've been doing a little refactoring of gdk-pixbuf's crufty code, to see if the gripes from my braindump can be solved. For things where it is not obvious how to proceed, I've started taking more detailed notes in a gdk-pixbuf survey. Today I was looking at which gdk-pixbuf modules are …
Recently KDE had an unfortunate event. Someone found a vulnerability in the code that processes .desktop and .directory files, through which an attacker could create a malicious file that causes shell command execution (analysis). They went for immediate, full disclosure, where KDE didn't even get a chance of fixing the …
Have you ever had these annoyances with GObject-style constructors? From a constructor, calling a method on a partially-constructed object is dangerous. A constructor needs to set up "not quite initialized" values in the instance struct until a construct-time property is set. You actually need to override GObjectClass::constructed (or was …
Leonora Tindall has written a very nice tutorial on Speedy Desktop Apps With GTK and Rust. It covers prototyping a dice roller app with Glade, writing the code with Rust and the gtk-rs bindings, and integrating the app into the desktop with a .desktop file.
I am preparing the 2.46.0 librsvg release. This will no longer have the rsvg-view-3 program. History of rsvg-view Rsvg-view started out as a 71-line C program to aid development of librsvg. It would just render an SVG file to a pixbuf, stick that pixbuf in a GtkImage widget …
Bzip2 1.0.7 has been released by Mark Wielaard. We have a slight change of plans since my last post: The 1.0.x series is in strict maintenance mode and will not change build systems. This is targeted towards embedded use, as in projects which already embed the …
ATTENTION ALL DISTRIBUTIONS: this is for you. THE SONAME MAY CHANGE! I am preparing a bzip2-1.0.7 release. You can see the release notes, which should be of interest: Many historical patches from various distributions are integrated now. We have a new fix for the just-published CVE-2019-12900, courtesy of …
Here is a straightforward port of some easy code. randtable.c has a lookup table with seemingly-random numbers. This table is used by the following macros in bzlib_private.h: extern Int32 BZ2_rNums[512]; #define BZ_RAND_DECLS \ Int32 rNToGo; \ Int32...
There is a lot of activity in the bzip2 repository! Perhaps the most exciting thing is that Dylan Baker made a merge request to add Meson as a build system for bzip2; this is merged now into the master branch. The current status is this: Both Meson and Autotools are …
I have just done a git push --force-with-lease to bzip2's master branch, which means that if you had a previous clone of this repository, you'll have to re-fetch it and rebase any changes you may have on top. I apologize for the inconvenience! But I have a good excuse: Julian …
Today I had a very pleasant conversation with Julian Seward, of bzip2 and Valgrind fame. Julian has kindly agreed to cede the maintainership of bzip2 to me. Bzip2 has not had a release since 2010. In the meantime, Linux distros have accumulated a number of bug/security fixes for it …
I have started a little experiment in porting bits of the widely-used bzip2/bzlib to Rust. I hope this can serve to refresh bzip2, which had its last release in 2010 and has been nominally unmaintained for years. I hope to make several posts detailing how this port is done …
Traditionally, GObject implementations in C are mutable: you instantiate a GObject and then change its state via method calls. Sometimes this is expected and desired; a GtkCheckButton widget certainly can change its internal state from pressed to not pressed, for example. Other times, objects are mutable while they are being …
After the librsvg team finished the rustification of librsvg's main library, I wanted to start porting the high-level test suite to Rust. This is mainly to be able to run tests in parallel, which cargo test does automatically in order to reduce test times. However, this meant that librsvg needed …
One of the pain points in trying to make the Meson build system work with Rust and Cargo is Cargo's use of build scripts, i.e. the build.rs that many Rust programs use for doing things before the main build. This post is about my exploration of what build …
Authors by lines of code, each year: Authors by percentage of lines of code, each year: Which lines of code remain each year? The shitty thing about a gradual rewrite is that a few people end up "owning" all the lines of source code. Hopefully this post is a little …
The other day I wrote about how most of librsvg's library code is in Rust now. Today I finished porting the GObject boilerplate for the main RsvgHandle object into Rust. This means that the C code no longer calls things like g_type_register_static(), nor implements rsvg_handle_class_init() and such; all those are …
Since a few days ago, librsvg's library implementation is almost 100% Rust code. Paolo Borelli's and Carlos Martín Nieto's latest commits made it possible. What does "almost 100% Rust code" mean here? The C code no longer has struct fields that refer to the library's real work. The only field …
Dos mesitas de noche: Parte 1: Preparar las piezas Parte 2: Marcar las patas Parte 3: Los cajones En la parte 1 preparé la madera para todas las piezas principales de las mesitas de noche / burós. Esto es lo que voy a construir: Siempre me da nervios que las patas …
Dos mesitas de noche: Parte 1: Preparar las piezas Parte 2: Marcar las patas Parte 3: Los cajones Hace unos años hice una mesita de noche para mi esposa. Siempre tuve la intención de hacer una para mí y otra para mi hija... y bueno, ocho años después empiezo a …
Al igual que hice con mi blog principal hace un par de años, acabo de mover La Viruta Rebelde al motor de Pelican. Todos los articulos viejos se encuentran aquí.
Last night, the linux.org DNS was hijacked and redirected to a page that doxed her. Coraline is doing extremely valuable work with the Contributor Covenant code of conduct, which many free software projects have adopted already. Coraline has been working for years in making free software, and computer technology …
I just realized that I forgot to publish my presentation from this year's GUADEC. Sorry, here it is! You can also get the ODP file for the presentation. This is released under a CC-BY-SA license. This is the video of the presentation. Update Dec/06: Keen readers spotted an incorrect …
While in the middle of converting librsvg's code that processes XML from C to Rust, I went into a digression that has to do with the way librsvg decides which files are allowed to be referenced from within an SVG. Resource references in SVG SVG files can reference other files …
A couple of weeks ago we had the fourth GNOME+Rust hackfest, this time in Thessaloniki, Greece. This is the beautiful city that will host next year's GUADEC, but fortunately GUADEC will be in summertime! We held the hackfest at the CoHo coworking space, a small, cozy office between the …
Lately, I have been converting the code in librsvg that handles XML from C to Rust. For many technical reasons, the library still uses libxml2, GNOME's historic XML parsing library, but some of the callbacks to handle XML events like start_element, end_element, characters, are now implemented in Rust. This has …
I want to write a braindump on the stuff that I remember from gdk-pixbuf's history. There is some talk about replacing it with something newer; hopefully this history will show some things that worked, some that didn't, and why. The beginnings Gdk-pixbuf started as a replacement for Imlib, the image …
The bug that caused two brown-paper-bag released in librsvg — because it was leaking all the SVG nodes — has been interesting. Memory leaks in Rust? Isn't it supposed to prevent that? Well, yeah, but the leaks were caused by the C side of things, and by unsafe code in Rust, which …
Over in this issue we are discussing how to add debug logging for librsvg. A popular way to add logging to Rust code is to use the log crate. This lets you sprinkle simple messages in your code: error!("something bad happened: {}", foo); debug!("a debug message"); However, the log …
I am incredibly happy because of three big things that are going on in librsvg right now: Paolo Borelli finished porting all the CSS properties to Rust. What was once a gigantic RsvgState struct in C is totally gone, along with all the janky C code to parse individual properties …
Our graphics stack that deals with images has evolved a lot over the years. In ye olden days In the context of GIMP/GNOME, the only thing that knew how to draw RGB images to X11 windows (doing palette mapping for 256-color graphics cards and dithering if necessary) was the …
The last code I wrote during the hackfest was the start of code generation for GObject interfaces. This is so that you can do gobject_gen! { interface Foo { virtual fn frob(&self); } } and it will generate the appropriate FooIface like one would expect with the C versions of interfaces. It turns …
Hacking on gnome-class continues apace! Philippe updated our dependencies. Alberto made the syntax for per-instance private structs more ergonomic, and then made that code nice and compact. Martin improved our conversion from CamelCase to snake_case for code generation. Daniel added initial support for GObject properties. This is not finished yet …
I'm in Madrid since Monday, at the third GNOME+Rust hackfest! The OpenShine folks are kindly letting us use their offices, on the seventh floor of a building by the Cuatro Caminos roundabout. I am very, very thankful that this time everyone seems to be working on developing gnome-class. It's …
I have started porting the code in librsvg that parses SVG's CSS properties from C to Rust. Many properties have symbolic values: stroke-linejoin: miter | round | bevel | inherit stroke-linecap: butt | round | square | inherit fill-rule: nonzero | evenodd | inherit StrokeLinejoin is the first property that I ported. First I had to write a …
Gitlab has a fairly conventional Continuous Integration system: you push some commits, the CI pipelines build the code and presumably run the test suite, and later you can know if this succeeded of failed. But by the time something fails, the broken code is already in the public repository. The …
I would like to mentor people for librsvg and gnome-class this Summer, both for Outreachy and Summer of Code. Librsvg projects Project: port filter effects from C to Rust Currently librsvg implements SVG filter effects in C. These are basic image processing filters like Gaussian blur, matrix convolution, Porter-Duff alpha …
Cairo needs help. It is the main 2D rendering library we use in GNOME, and in particular, it's what librsvg uses to render all SVGs. My immediate problem with Cairo is that it explodes when called with floating-point coordinates that fall outside the range that its internal fixed-point numbers can …
Today I ported gnome-class from version 0.11 of the syn crate to version 0.12. syn is a somewhat esoteric crate that you use to parse Rust code... from a stream of tokens... from within the implementation of a procedural macro. Gnome-class implements a mini-language inside your own Rust …
Librsvg feels like it is reaching a tipping point, where suddenly it seems like it would be easier to just port some major parts from C to Rust than to just add accessors for them. Also, more and more of the meat of the library is in Rust now. I'm …
Jordan Petridis has been kicking ass by overhauling librsvg's continous integration (CI) pipeline. Take a look at this beauty: On every push, we run the Test stage. This is a quick compilation on a Fedora container that runs "make check" and ensures that the test suite passes. We have a …
I have started an RFC to integrate rsvg-rs into librsvg. rsvg-rs is the Rust binding to librsvg. Like the gtk-rs bindings, it gets generated from a pre-built GIR file. It would be nice for librsvg to provide the Rust binding by itself, so that librsvg's own internal tools can be …
As a library writer, it feels a bit strange, but refreshing, to write a program that actually has a main() function. My experience with Rust so far has been threefold: Porting chunks of C to Rust for librsvg - this is all work on librsvg's internals and no users are exposed …
Librsvg 2.42.0 came out with a rather major performance regression compared to 2.40.20: SVGs with many transform attributes would slow it down. It was fixed in 2.42.1. We changed from using a parser that would recompile regexes each time it was called, to one …
Would you like to help fix a couple of bugs in librsvg, in preparation for the 2.42.1 release? I have prepared a list of bugs which I'd like to be fixed in the 2.42.1 milestone. Two of them are assigned to myself, as I'm already working …
One nice thing about gitlab.gnome.org is that we can now have Continuous Integration (CI) enabled for projects there. After every commit, the CI machinery can build the project, run the tests, and tell you if something goes wrong. Carlos Soriano posted a "tips of the week" mail to …
I'm loving gitlab.gnome.org. It has been only a couple of weeks since librsvg moved to gitlab, and I've already received and merged two merge requests. (Isn't it a bit weird that Github uses "pull request" and Everyone(tm) knows the PR acronym, but Gitlab uses "merge request"?) Notifications …
Today I released librsvg 2.40.20. This will be the last release in the 2.40.x series, which is deprecated effectively immediately. People and distros are strongly encouraged to switch to librsvg 2.41.x as soon as possible. This is the version that is implemented in a …
Librsvg now lives in GNOME's Gitlab instance. You can access it here. Gitlab allows workflows similar to Github: you can create an account there, fork the librsvg repository, file bug reports, create merge requests... Hopefully this will make it nicer for contributors. In the meantime, feel free to take a …
Porting of librsvg to Rust goes on. Yesterday I started porting the C code that implements SVG's family of elements. I have also been replacing the little parsers in librsvg with Rust code. And these days, the lack of string slices in C is bothering me a lot. What …
Recently on the Greater than Code podcast there was an episode called "Code Hospitality", by Nadia Odunayo. Nadia talks about thinking of how to make people comfortable in your code and in your team/organization/etc., and does it in terms of thinking about host/guest relationships. Have you ever …
Last weekend I was in Berlin for the second Rust+GNOME Hackfest, kindly hosted at the Kinvolk office. This is in a great location, half a block away from the Kottbusser Tor station, right at the entrance of the trendy Kreuzberg neighborhood — full of interesting people, incredible graffitti, and good …
Today I released librsvg 2.41.1, and it's a big release! Apart from all the Rust goodness, and the large number of bug fixes, I am very happy with the way the build system works these days. I've found it invaluable to have good examples of Autotools incantations to …
Here is a little Emacs Lisp snippet that I've started using. It makes Emacs pop up a desktop-wide notification when a compilation finishes, i.e. after "M-x compile" is done. Let's see if that keeps me from wasting time in the web when I launch a compilation. (setq compilation-finish-functions (append …
(First part of the series, with index to all the articles) Now let's get on and see how glib-rs handles boxed types. Boxed types? Let's say you are given a sealed cardboard box with something, but you can't know what's inside. You can just pass it on to someone else …
The initial articles about librsvg's conversion to Rust are in my old blog, so they may be a bit hard to find from this new blog. Here is a list of those posts, just so they are easier to find: Librsvg gets Rusty Porting a few C functions to Rust …
Before continuing with the glib-rs architecture, let's take a detour and look at GObject Introspection. Although it can seem like an obscure part of the GNOME platform, it is an absolutely vital part of it: it is what lets people write GNOME applications in any language. Let's start with a …
(First part of the series, with index to all the articles) In the first part, we saw how glib-rs provides the FromGlib and ToGlib traits to let Rust code convert from/to Glib's simple types, like to convert from a Glib gboolean to a Rust bool and vice-versa. We also …
How Glib-rs works, part 1: Type conversions How Glib-rs works, part 2: Transferring lists and arrays How Glib-rs works, part 3: Boxed types During the GNOME+Rust hackfest in Mexico City, Niko Matsakis started the implementation of gnome-class, a procedural macro that will let people implement new GObject classes in …
Rust tries to follow the "make illegal states unrepresentable" mantra in several ways. In this post I'll show several things related to the process of building strings, from bytes in memory, or from a file, or from char * things passed from C. Strings in Rust The easiest way to build …
During GUADEC this year I gave a presentation called Replacing C library code with Rust: what I learned with librsvg. This is the PDF file; be sure to scroll past the full-page presentation pages until you reach the speaker's notes, especially for the code sections! You can also get the …
Yesterday I looked into updating librsvg's Rust dependencies. There have been some API breaks (!!!) in the unstable libraries that it uses since the last time I locked them. This post is about an interesting case of API breakage. rust-cssparser is the crate that Servo uses for parsing CSS. Well, more …
I just realized that I only tweeted about this a couple of months ago, but never blogged about it. Shame on me! I wrote an article, Legacy Systems as Old Cities, for The Recompiler magazine. Is GNOME, now at 20 years old, legacy software? Is it different from mainframe software …
After updating my distro a few months ago, I somehow lost my tweaks to the Alt-Tab behavior in gnome-shell. The default is to have Alt-Tab switch you between applications in the current workspace. One can use Alt-backtick (or whatever key you have above Tab) to switch between windows in the …