Flash taskbar icon when build finishes

RESOLVED FIXED in mozilla35

Status

Firefox Build System
General
--
enhancement
RESOLVED FIXED
7 years ago
4 months ago

People

(Reporter: briansmith, Assigned: Mathias De Maré, Mentored)

Tracking

Trunk
mozilla35
All
Windows 7

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

Created attachment 554011 [details]
A C program that flashes the console taskbar icon when executed.

When a build completes in a console window, the taskbar icon for the window should flash to notify me that it is done. Also, it should give me a high-five if the build completed successfully.

I have attached the trivial C program that flashes the console's taskbar icon when executed. I do not know how to properly hook this into the build system.
Attachment #554011 - Attachment mime type: text/x-csrc → text/plain
Feels related: bug 648681
khuey suggests that we could build this into pymake. I am going to try to do this right now.
Created attachment 554205 [details] [diff] [review]
Flash taskbar icon when pymake finishes in a console that isn't focused

This works for me.
Assignee: nobody → bsmith
Attachment #554205 - Flags: review?(khuey)
I often do builds like "pymake -C security/manager/ssl && pymake -C toolkit/library". In this case, the flashing of the console taskbar icon would occur too early (after the first pymake). Maybe it is better to have this as a standalone script that we can execute like ""pymake -C security/manager/ssl && pymake -C toolkit/library ; flashconsole" for these situations.
Comment on attachment 554205 [details] [diff] [review]
Flash taskbar icon when pymake finishes in a console that isn't focused

Review of attachment 554205 [details] [diff] [review]:
-----------------------------------------------------------------

a couple questions

::: build/pymake/make.py
@@ +32,5 @@
> +    FlashWindowEx(params)
> +
> +def notifyAndExit(x):
> +  notify()
> +  sys.exit(x)

this method is unused, right?

@@ +41,5 @@
>  
> +    pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=notifyAndExit)
> +    pymake.process.ParallelContext.spin()
> +    assert False, "Not reached"
> +    notify()

do we actually hit this notify call?
Comment on attachment 554205 [details] [diff] [review]
Flash taskbar icon when pymake finishes in a console that isn't focused

Clearing review until comment 6 is addressed.
Attachment #554205 - Flags: review?(khuey)
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #6)
> > +def notifyAndExit(x):
> 
> this method is unused, right?
> >  
> > +    pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=notifyAndExit)

It is used here.


> > +    pymake.process.ParallelContext.spin()
> > +    assert False, "Not reached"
> > +    notify()
> 
> do we actually hit this notify call?

I agree the notify should be before the assert.

I have been running with this as part of my pymake. I noticed that we still have some recursive invocations of pymake in a separate process in the build. This causes the taskbar to flash too early when doing a full build.

Also, I have found several use cases where pymake flashing before terminating isn't the behavior I want:
    pymake -C security/manager/ssl && pymake -C toolkit/library
    pymake ... && dist/bin/firefox


Accordingly, I think it makes more sense to make the flasher into a separate program that can be executed manually:

    pymake -C security/manager/ssl && pymake -C toolkit/library ; flash
    pymake ... && dist/bin/firefox ; flash

If we go that route, we can build the C program I originally attached into MozillaBuild.
Assignee: bsmith → nobody
pymake is dead, so that option's out at this point. I'm wondering if we could add this into mach somehow instead?
Flags: needinfo?(gps)
Yes, we can do this in mach. We already show a notification on OS X and possibly Linux (can't remember if that code landed).

We don't need a binary to do this. Python can use ctypes to call Win32 APIs.

The existing code in mach for notifying is https://hg.mozilla.org/mozilla-central/file/b0701d069bf9/python/mozbuild/mozbuild/mach_commands.py#l388.

It should be pretty easy to hook up a Windows version.

Putting this bug up for mentorship.
Mentor: gps
Component: MozillaBuild → Build Config
Flags: needinfo?(gps)
Product: mozilla.org → Core
Version: other → Trunk
(Assignee)

Comment 11

4 years ago
I'm having a look at this bug now. I'm almost done setting up the build environment on Windows. I'll build upon the suggested patch by Brian and implement something similar for mach.
(Assignee)

Comment 12

4 years ago
Created attachment 8481770 [details] [diff] [review]
bug680009_flash_taskbar.patch

This is pretty much the same as Brian posted for pymake, just changed to work with mach.
It works fine on Windows, and I tested on Linux to make sure everything still works there.

Remarks welcome :-)
Attachment #8481770 - Flags: review?(gps)
Comment on attachment 8481770 [details] [diff] [review]
bug680009_flash_taskbar.patch

Review of attachment 8481770 [details] [diff] [review]:
-----------------------------------------------------------------

NICE!
Attachment #8481770 - Flags: review?(gps) → review+

Updated

4 years ago
Keywords: checkin-needed
Attachment #554205 - Attachment is obsolete: true
Attachment #554011 - Attachment is obsolete: true
https://hg.mozilla.org/integration/mozilla-inbound/rev/9c926e0e24ae

Win!
Assignee: nobody → mathias.demare
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/9c926e0e24ae
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Flags: qe-verify-

Updated

4 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.