New mach build feature: build-complete notifications on Linux

Tags: , , , , , — Jeff @ 15:19

Spurred on by gps‘s recent mach blogging (and a blogging dry spell to rectify), I thought it’d be worth noting a new mach feature I landed in mozilla-inbound yesterday: build-complete notifications on Linux.

On OS X, mach build spawns a desktop notification when a build completes. It’s handy when the terminal where the build’s running is out of view — often the case given how long builds take. I learned about this feature when stuck on a loaner Mac for a few months due to laptop issues, and I found the notification quite handy. When I returned to Linux, I wanted the same thing there. evilpie had already filed bug 981146 with a patch using DBus notifications, but he didn’t have time to finish it. So I picked it up and did the last 5% to land it. Woo notifications!

(Minor caveat: you won’t get a notification if your build completes in under five minutes. Five minutes is probably too long; some systems build fast enough that you’d never get a notification. gps thinks this should be shorter and ideally configurable. I’m not aware of an existing bug for this.)


  1. I saw the discussion on the bug about more standard ways to send a notification instead of the python dbus module. You might consider ‘notify-send’, provided by the library ‘libnotify’. It seems this library is required by a whole lot of programs, so it probably is installed on most linux systems. And you can add an icon!

    Comment by Matthijs Tijink — 26.07.14 @ 06:15

  2. With the existing patch in hand/tree, it seems unlikely I’d go to the extra effort of notifying some other, or different, way. Couldn’t hurt to file a bug in any event.

    I truly don’t understand the notification system on Linux at all. Is it just more of the same community fractiousness and refusal to all coalesce around a single means of issuing notifications, that causes there to be both the system used here, and libnotify? Blah. It’s things like this that’ll make Linux on desktop never reach mainstream success.

    Comment by Jeff — 26.07.14 @ 13:29

  3. Aha! I got one of these notifications yesterday and was wondering how long they had been implemented. Nice.

    Comment by njn — 28.07.14 @ 00:48

  4. @Jeff
    Actually they all use the same system under the hood (the DBus call), but there are different implementations on both the client and display side (so KDE and Gnome can both implement it).

    Comment by Matthijs Tijink — 30.07.14 @ 13:40

  5. Same system under the hood doesn’t mean much, if there exist multiple wrappers around it, providing additional features in different ways, such that to get those features application authors have to pick among the wrappers and “can’t” use the one underlying standardized thing. Or so it would seem to me.

    Comment by Jeff — 31.07.14 @ 10:34

  6. I have a ~/bin/make in my $PATH that I’ve long used for this. It uses notify-send after invoking the real make (skipping useless ones, like those kicked off via configure). Seems to work ok, and works across projects. The B2G build ends up notifying multiple times, though.

    http://people.mozilla.org/~sfink/data/make fwiw

    Comment by Steve — 13.08.14 @ 13:05

RSS feed for comments on this post. TrackBack URI

Leave a comment

HTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>