I have noticed for months that when building Firefox, sometimes
configure will run when it shouldn’t, e.g. when I haven’t changed any makefiles or other build system files. This is annoying, because it increases the time taken for a complete no-change build on my Linux box from ~50 seconds to ~70 seconds. And it happens reasonable frequently, but I haven’t been able to reproduce it reliably.
Until yesterday, that is! I realized it happened reliably if I alternated building two different objdirs (e.g. debug and opt). Once I could reproduce it reliably, it wasn’t hard to use make’s
-d option to find out what was causing
configure to re-run. The answer was a file called
$(topsrcdir)/.mozconfig.mk. Because it is put in
$(topsrcdir) instead of
$(objdir), the building of one objdir can affect the building of another objdir.
The fix was pretty easy — it’s hard to move
.mozconfig.mk out of
$(topsrcdir), but there’s no good reason to re-run
configure every time it changes, because it doesn’t contain anything that affects
configure. So it was a one-line change in
Kyle Huey tells me this bug has been present since 2000!