libfprint, the fingerprint reader driver library, is nearing a 1.0 release.
Since the last time I reported on the status of the library, we've made some headway modernising the library, using a variety of different tools. Let's go through them and how they were used.
Callcatcher
When libfprint was in its infancy, Daniel Drake found the NBIS fingerprint processing library matched what was required to provide fingerprint matching algorithms, and imported it in libfprint. Since then, the code in this copy-paste library in libfprint stayed the same. When updating it to the latest available version (from 2015 rather than 2007), as well as splitting off a patch to make it easier to update the library again in the future, I used Callcatcher to cull the unused functions.
Callcatcher is not a "production-level" tool (too many false positives, lack of support for many common architectures, etc.), but coupled with manual checking, it allowed us to greatly reduce the number of functions in our copy, so they weren't reported when using other source code quality checking tools.
LLVM's scan-build
This is a particularly easy one to use as its use is integrated into meson, and available through ninja scan-build. The output of the tool, whether on stderr, or on the HTML pages, is pretty similar to Coverity's, but the tool is free, and easily integrated into a CI (once you've fixed all the bugs, obviously). We found plenty of possible memory leaks and unintialised variables using this, with more flexibility than using Coverity's web interface, and avoiding going through hoops when using its "source code check as a service" model.
cflow and callgraph
LLVM has another tool, called callgraph. It's not yet integrated into meson, which was a bit of a problem to get some output out of it. But combined with cflow, we used it to find where certain functions were called, trying to find the origin of some variables (whether they were internal or device-provided for example), which helped with implementing additional guards and assertions in some parts of the library, in particular inside the NBIS sub-directory.
0.99.0 is out
We're not yet completely done with the first pass at modernising libfprint and its ecosystem, but we released an early Yule present with version 0.99.0. It will be integrated into Fedora after the holidays if the early testing goes according to plan.
We also expect a great deal from our internal driver API reference. If you have a fingerprint reader that's unsupported, contact your laptop manufacturer about them providing a Linux driver for it and point them at this documentation.
A number of laptop vendors are already asking their OEM manufacturers to provide drivers to be merged upstream, but a little nudge probably won't hurt.
Happy holidays to you all, and see you for some more interesting features in the new year.
Showing posts with label development. Show all posts
Showing posts with label development. Show all posts
Friday, 14 December 2018
Thursday, 19 December 2013
On the beauty of libarchive
In your applications, you might have to deal with compressed files: ISO images of installers, e-book or e-comic types based on ZIP files, video DVD images.
libarchive makes things easier by allowing you not to have to deal with external commands to extract those few files you care about.
The API feels a bit antiquated, compared to using GLib/GIO for files handling, but it's generally easier than dealing with potential security issues launching external tools, or even dealing with shell argv quoting.
Examples
totem-pl-parser uses libarchive to determine what type of video disc image are hidden inside an ISO image.
gnome-epub-thumbnailer (as well as its siblings, the Krita and OpenRaster thumbnailers I talked about more recently) uses the ZIP handling to extract particular files, and figure out which file is the cover image.
Other uses and limitations
Boxes could use libarchive to extract files from ISO images for its auto-installer, evince could use it to handle CBZ e-comics.
There's a couple of limitations though. ISO support doesn't handle UDF images (which just means weird filenames, not inaccessible files), and RAR support is still quite young.
I hope that this post can spur on bug fixes for the RAR support, new UDF support, or even a GIO-style wrapper around the library.
The upstream authors have been particularly good at fixing bugs that only showed themselves with broken files, and I'd like to thank them for their very useful work.
libarchive makes things easier by allowing you not to have to deal with external commands to extract those few files you care about.
The API feels a bit antiquated, compared to using GLib/GIO for files handling, but it's generally easier than dealing with potential security issues launching external tools, or even dealing with shell argv quoting.
Examples
totem-pl-parser uses libarchive to determine what type of video disc image are hidden inside an ISO image.
gnome-epub-thumbnailer (as well as its siblings, the Krita and OpenRaster thumbnailers I talked about more recently) uses the ZIP handling to extract particular files, and figure out which file is the cover image.
Other uses and limitations
Boxes could use libarchive to extract files from ISO images for its auto-installer, evince could use it to handle CBZ e-comics.
There's a couple of limitations though. ISO support doesn't handle UDF images (which just means weird filenames, not inaccessible files), and RAR support is still quite young.
I hope that this post can spur on bug fixes for the RAR support, new UDF support, or even a GIO-style wrapper around the library.
The upstream authors have been particularly good at fixing bugs that only showed themselves with broken files, and I'd like to thank them for their very useful work.
Labels:
comics,
development,
iso,
libarchive,
rar,
zip
Subscribe to:
Posts (Atom)