Bug 1246881 - Generate a header defining MOZ_BUILDID. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 09 Feb 2016 14:36:07 +0900
changeset 284054 02840dfc6310ad181aa7c3b49ef51c3dd1d71e95
parent 284053 e39c9c48355d02dc5e25561477d7f97b6761a154
child 284055 9f791573855763afbb8455d9ddf150e4503166f3
push id17581
push usercbook@mozilla.com
push dateFri, 12 Feb 2016 14:21:29 +0000
treeherderfx-team@1b8a0036c771 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1246881
milestone47.0a1
Bug 1246881 - Generate a header defining MOZ_BUILDID. r=mshal
Makefile.in
build/Makefile.in
build/application.ini
build/moz.build
build/variables.py
client.mk
config/faster/rules.mk
mobile/android/base/Makefile.in
mobile/android/base/moz.build
moz.build
python/mozbuild/mozbuild/android_version_code.py
toolkit/xre/Makefile.in
toolkit/xre/make-platformini.py
toolkit/xre/moz.build
toolkit/xre/nsAppRunner.cpp
toolkit/xre/platform.ini
webapprt/Makefile.in
webapprt/gtk/Makefile.in
webapprt/gtk/webapprt.cpp
webapprt/mac/Makefile.in
webapprt/mac/webapprt.mm
webapprt/moz.build
webapprt/webapprt.ini
webapprt/win/Makefile.in
webapprt/win/webapprt.cpp
--- a/Makefile.in
+++ b/Makefile.in
@@ -10,29 +10,35 @@ make_min_ver := 3.81
 ifneq ($(make_min_ver),$(firstword $(sort $(make_min_ver) $(MAKE_VERSION))))
 $(error GNU Make $(make_min_ver) or higher is required)
 endif
 
 export TOPLEVEL_BUILD := 1
 
 default::
 
+ifndef TEST_MOZBUILD
 ifdef MOZ_BUILD_APP
 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
 endif
+endif
 
 include $(topsrcdir)/config/config.mk
 
 GARBAGE_DIRS += _javagen _profile staticlib
 DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
    config/autoconf.mk \
    mozilla-config.h \
    netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
    .mozconfig.mk
 
+ifndef MOZ_PROFILE_USE
+buildid.h: FORCE
+endif
+
 ifdef JS_STANDALONE
 configure_dir = $(topsrcdir)/js/src
 else
 configure_dir = $(topsrcdir)
 endif
 
 BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
 
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -4,21 +4,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 USE_RCS_MK := 1
 include $(topsrcdir)/config/makefiles/makeutils.mk
 
 ifdef MOZ_APP_BASENAME
 APP_INI_DEPS = $(topsrcdir)/config/milestone.txt
 
-MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-APP_INI_DEPS += $(DEPTH)/config/buildid
-
-DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
-
 APP_INI_DEPS += $(DEPTH)/config/autoconf.mk
 
 MOZ_SOURCE_STAMP := $(firstword $(shell cd $(topsrcdir)/$(MOZ_BUILD_APP)/.. && hg parent --template='{node}\n' 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP='$(MOZ_SOURCE_STAMP)'
 endif
 
 ifdef MOZ_INCLUDE_SOURCE_INFO
--- a/build/application.ini
+++ b/build/application.ini
@@ -10,16 +10,17 @@
 #endif
 #endif
 #if 0
 ; This Source Code Form is subject to the terms of the Mozilla Public
 ; License, v. 2.0. If a copy of the MPL was not distributed with this
 ; file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #endif
 #filter substitution
+#include @TOPOBJDIR@/buildid.h
 [App]
 Vendor=@MOZ_APP_VENDOR@
 Name=@MOZ_APP_BASENAME@
 RemotingName=@MOZ_APP_REMOTINGNAME@
 #ifdef MOZ_APP_DISPLAYNAME
 CodeName=@MOZ_APP_DISPLAYNAME@
 #endif
 Version=@MOZ_APP_VERSION@
--- a/build/moz.build
+++ b/build/moz.build
@@ -70,8 +70,10 @@ FINAL_TARGET_FILES += ['/.gdbinit']
 # Install the clang-cl runtime library for ASAN next to the binaries we produce.
 if CONFIG['MOZ_ASAN'] and CONFIG['CLANG_CL']:
     FINAL_TARGET_FILES += ['%' + CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']]
 
 if CONFIG['MOZ_APP_BASENAME']:
     FINAL_TARGET_PP_FILES += ['application.ini']
     if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']:
         FINAL_TARGET_PP_FILES += ['update-settings.ini']
+
+DEFINES['TOPOBJDIR'] = TOPOBJDIR
new file mode 100644
--- /dev/null
+++ b/build/variables.py
@@ -0,0 +1,30 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from __future__ import print_function, unicode_literals
+
+import os
+import sys
+from datetime import datetime
+
+
+def buildid_header(output):
+    buildid = os.environ.get('MOZ_BUILD_DATE')
+    if buildid and len(buildid) != 14:
+        print('Ignoring invalid MOZ_BUILD_DATE: %s' % buildid, file=sys.stderr)
+        buildid = None
+    if not buildid:
+        buildid = datetime.now().strftime('%Y%m%d%H%M%S')
+    output.write("#define MOZ_BUILDID %s\n" % buildid)
+
+
+def main(args):
+    if (len(args)):
+        func = globals().get(args[0])
+        if func:
+            return func(sys.stdout, *args[1:])
+
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv[1:]))
--- a/client.mk
+++ b/client.mk
@@ -233,17 +233,17 @@ profiledbuild::
 	$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_USE=1 CREATE_MOZCONFIG_JSON=
 
 #####################################################
 # Build date unification
 
 ifdef MOZ_UNIFY_BDATE
 ifndef MOZ_BUILD_DATE
 ifdef MOZ_BUILD_PROJECTS
-MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
+MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/build/variables.py buildid_header | awk '{print $$3}')
 export MOZ_BUILD_DATE
 endif
 endif
 endif
 
 #####################################################
 # Preflight, before building any project
 
--- a/config/faster/rules.mk
+++ b/config/faster/rules.mk
@@ -75,28 +75,27 @@ ACDEFINES += -DBUILD_FASTER
 	$(MAKE) -C $(dir $@) $(notdir $@)
 
 # Install files using install manifests
 #
 # The list of base directories is given in INSTALL_MANIFESTS. The
 # corresponding install manifests are named correspondingly, with forward
 # slashes replaced with underscores, and prefixed with `install_`. That is,
 # the install manifest for `dist/bin` would be `install_dist_bin`.
-$(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/config/buildid
+$(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/buildid.h
 	@# For now, force preprocessed files to be reprocessed every time.
 	@# The overhead is not that big, and this avoids waiting for proper
 	@# support for defines tracking in process_install_manifest.
 	@touch install_$(subst /,_,$*)
 	@# BOOKMARKS_INCLUDE_DIR is for bookmarks.html only.
 	$(PYTHON) -m mozbuild.action.process_install_manifest \
 		--track install_$(subst /,_,$*).track \
 		$(TOPOBJDIR)/$* \
 		-DAB_CD=en-US \
 		-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/browser/locales/en-US/profile \
-		-DMOZ_BUILDID=$(shell cat $(TOPOBJDIR)/config/buildid) \
 		$(ACDEFINES) \
 		install_$(subst /,_,$*)
 
 # ============================================================================
 # Below is a set of additional dependencies and variables used to build things
 # that are not supported by data in moz.build.
 
 # The xpidl target in config/makefiles/xpidl requires the install manifest for
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
+MOZ_BUILDID := $(shell awk '{print $$3}' $(DEPTH)/buildid.h)
 
 # Set the appropriate version code, based on the existance of the
 # MOZ_APP_ANDROID_VERSION_CODE variable.
 ifdef MOZ_APP_ANDROID_VERSION_CODE
     ANDROID_VERSION_CODE:=$(MOZ_APP_ANDROID_VERSION_CODE)
 else
     ANDROID_VERSION_CODE:=$(shell $(PYTHON) \
       $(topsrcdir)/python/mozbuild/mozbuild/android_version_code.py \
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -979,8 +979,10 @@ if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']
         'gecko-R.jar',
         'gecko-browser.jar',
         'gecko-mozglue.jar',
         'gecko-thirdparty.jar',
         'gecko-util.jar'
     ]
 
 FINAL_TARGET_PP_FILES += ['package-name.txt.in']
+
+DEFINES['TOPOBJDIR'] = TOPOBJDIR
--- a/moz.build
+++ b/moz.build
@@ -26,19 +26,26 @@ DIRS += [
 if not CONFIG['JS_STANDALONE']:
     CONFIGURE_SUBST_FILES += [
         'tools/update-packaging/Makefile',
     ]
     CONFIGURE_DEFINE_FILES += [
         'mozilla-config.h',
     ]
     EXPORTS += [
+        '!buildid.h',
         '!mozilla-config.h',
     ]
 
+    GENERATED_FILES += [
+        'buildid.h',
+    ]
+
+    GENERATED_FILES['buildid.h'].script = 'build/variables.py:buildid_header'
+
     DIRS += [
         'build',
         'probes',
     ]
 
 DIRS += [
     'config/external/zlib',
     'memory',
--- a/python/mozbuild/mozbuild/android_version_code.py
+++ b/python/mozbuild/mozbuild/android_version_code.py
@@ -70,20 +70,20 @@ def android_version_code_v1(buildid, cpu
     N.B.: the reserved 0 bit to the left of the highest order 't' bit can,
     sometimes, be used to bump the version scheme.  In addition, by reducing the
     granularity of the build identifiers (for example, moving to identifying
     builds every 2 or 4 hours), the version scheme may be adjusted further still
     without losing a (valuable) high order bit.
     '''
     def hours_since_cutoff(buildid):
         # The ID is formatted like YYYYMMDDHHMMSS (using
-        # datetime.now().strftime('%Y%m%d%H%M%S'); see
-        # toolkit/xre/make-platformini.py).  The inverse function is
-        # time.strptime.  N.B.: the time module expresses time as decimal
-        # seconds since the epoch.
+        # datetime.now().strftime('%Y%m%d%H%M%S'); see build/variables.py).
+        # The inverse function is time.strptime.
+        # N.B.: the time module expresses time as decimal seconds since the
+        # epoch.
         fmt = '%Y%m%d%H%M%S'
         build = time.strptime(str(buildid), fmt)
         cutoff = time.strptime(str(V1_CUTOFF), fmt)
         return int(math.floor((time.mktime(build) - time.mktime(cutoff)) / (60.0 * 60.0)))
 
     # Of the 21 low order bits, we take 17 bits for builds.
     base = hours_since_cutoff(buildid)
     if base < 0:
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -23,14 +23,18 @@ ifneq (,$(strip $(MOZ_SOURCE_STAMP)))
     # extra sanity check for old versions of hg, no showconfig support
     ifneq (,$(filter http%,$(source_repo)))
       DEFINES += -DMOZ_SOURCE_REPO=$(source_repo)
     endif
   endif
 
 endif # MOZ_SOURCE_STAMP
 
-MOZ_BUILDID   := $(strip $(firstword $(shell cat $(DEPTH)/config/buildid 2>/dev/null)))
+MOZ_BUILDID   := $(shell awk '{print $$3}' $(DEPTH)/buildid.h)
 $(call errorIfEmpty,GRE_MILESTONE MOZ_BUILDID)
 
 DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
 
-$(srcdir)/nsAppRunner.cpp: $(DEPTH)/config/buildid $(milestone_txt)
+# Note these dependencies are broken because the target is *not* the cpp file.
+# BUT, actually fixing it would make libxul rebuilt on every single incremental
+# build because of the automatic buildid change. This is why we can't actually
+# include buildid.h there, because it would add the dependency.
+$(srcdir)/nsAppRunner.cpp: $(DEPTH)/buildid.h $(milestone_txt)
deleted file mode 100644
--- a/toolkit/xre/make-platformini.py
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/python
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-from optparse import OptionParser
-from datetime import datetime
-import time
-import sys
-import os
-
-o = OptionParser()
-o.add_option("--buildid", dest="buildid")
-o.add_option("--print-buildid", action="store_true", dest="print_buildid")
-o.add_option("--print-timestamp", action="store_true", dest="print_timestamp")
-o.add_option("--sourcestamp", dest="sourcestamp")
-o.add_option("--sourcerepo", dest="sourcerepo")
-
-(options, args) = o.parse_args()
-
-if options.print_timestamp:
-    print int(time.time())
-    sys.exit(0)
-
-if options.print_buildid:
-    print datetime.now().strftime('%Y%m%d%H%M%S')
-    sys.exit(0)
-
-if not options.buildid:
-    print >>sys.stderr, "--buildid is required"
-    sys.exit(1)
-
-(milestoneFile,) = args
-for line in open(milestoneFile, 'r'):
-    if line[0] == '#':
-        continue
-
-    line = line.strip()
-    if line == '':
-        continue
-
-    milestone = line
-
-print """[Build]
-BuildID=%s
-Milestone=%s""" % (options.buildid, milestone)
-if options.sourcestamp:
-    print "SourceStamp=%s" % options.sourcestamp
-if options.sourcerepo:
-    print "SourceRepository=%s" % options.sourcerepo
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -175,11 +175,12 @@ if CONFIG['MOZ_B2G_LOADER']:
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 
 if CONFIG['MOZ_WIDGET_GTK']:
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
+DEFINES['TOPOBJDIR'] = TOPOBJDIR
 FINAL_TARGET_PP_FILES += [
     'platform.ini'
 ]
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -248,16 +248,22 @@ static char **gQtOnlyArgv;
 #include <gtk/gtk.h>
 #ifdef MOZ_X11
 #include <gdk/gdkx.h>
 #endif /* MOZ_X11 */
 #include "nsGTKToolkit.h"
 #include <fontconfig/fontconfig.h>
 #endif
 #include "BinaryPath.h"
+#ifndef MOZ_BUILDID
+// See comment in Makefile.in why we want to avoid including buildid.h.
+// Still include it when MOZ_BUILDID is not set, which can happen with some
+// build backends.
+#include "buildid.h"
+#endif
 
 #ifdef MOZ_LINKER
 extern "C" MFBT_API bool IsSignalHandlingBroken();
 #endif
 
 namespace mozilla {
 int (*RunGTest)() = 0;
 } // namespace mozilla
--- a/toolkit/xre/platform.ini
+++ b/toolkit/xre/platform.ini
@@ -1,14 +1,15 @@
 #if 0
 ; This Source Code Form is subject to the terms of the Mozilla Public
 ; License, v. 2.0. If a copy of the MPL was not distributed with this
 ; file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #endif
 #filter substitution
+#include @TOPOBJDIR@/buildid.h
 [Build]
 BuildID=@MOZ_BUILDID@
 Milestone=@GRE_MILESTONE@
 #ifdef MOZ_SOURCE_REPO
 SourceRepository=@MOZ_SOURCE_REPO@
 #endif
 #ifdef MOZ_SOURCE_STAMP
 SourceStamp=@MOZ_SOURCE_STAMP@
deleted file mode 100644
--- a/webapprt/Makefile.in
+++ /dev/null
@@ -1,12 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# Include rules.mk explicitly so we can use FINAL_TARGET. Also, the dependencies
-# for webapprt.ini need to be set after PP_TARGETS are expanded in rules.mk.
-include $(topsrcdir)/config/rules.mk
-
-MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
-
-$(FINAL_TARGET)/webapprt.ini: $(DEPTH)/config/buildid $(topsrcdir)/config/milestone.txt
--- a/webapprt/gtk/Makefile.in
+++ b/webapprt/gtk/Makefile.in
@@ -1,14 +1,7 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 NSDISTMODE = copy
 
 PROGRAMS_DEST = $(DIST)/bin
-
-include $(topsrcdir)/config/rules.mk
-
-MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
-
-webapprt.$(OBJ_SUFFIX): $(DEPTH)/config/buildid
--- a/webapprt/gtk/webapprt.cpp
+++ b/webapprt/gtk/webapprt.cpp
@@ -14,16 +14,17 @@
 
 // Mozilla headers
 #include "nsIFile.h"
 #include "nsINIParser.h"
 #include "nsXPCOMGlue.h"
 #include "nsXPCOMPrivate.h"              // for MAXPATHLEN and XPCOM_DLL
 #include "nsXULAppAPI.h"
 #include "BinaryPath.h"
+#include "buildid.h"
 
 const char kAPP_INI[] = "application.ini";
 const char kWEBAPP_INI[] = "webapp.ini";
 const char kWEBAPP_JSON[] = "webapp.json";
 const char kWEBAPP_PACKAGE[] = "application.zip";
 const char kWEBAPPRT_INI[] = "webapprt.ini";
 const char kWEBAPPRT_PATH[] = "webapprt";
 const char kAPP_ENV_VAR[] = "XUL_APP_FILE";
--- a/webapprt/mac/Makefile.in
+++ b/webapprt/mac/Makefile.in
@@ -2,15 +2,8 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
 # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
 NSDISTMODE = copy
 
 PROGRAMS_DEST = $(DIST)/bin
-
-include $(topsrcdir)/config/rules.mk
-
-MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
-
-webapprt.$(OBJ_SUFFIX): $(DEPTH)/config/buildid
--- a/webapprt/mac/webapprt.mm
+++ b/webapprt/mac/webapprt.mm
@@ -24,16 +24,17 @@
 #include "nsINIParser.h"
 #include "nsXPCOMPrivate.h"              // for MAXPATHLEN and XPCOM_DLL
 #include "nsXULAppAPI.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsIFile.h"
 #include "nsStringGlue.h"
 #include "mozilla/AppData.h"
+#include "buildid.h"
 
 using namespace mozilla;
 
 const char WEBAPPRT_EXECUTABLE[] = "webapprt-stub";
 const char FXAPPINI_NAME[] = "application.ini";
 const char WEBAPPINI_NAME[] = "webapp.ini";
 const char WEBRTINI_NAME[] = "webapprt.ini";
 
--- a/webapprt/moz.build
+++ b/webapprt/moz.build
@@ -52,8 +52,10 @@ JAR_MANIFESTS += ['jar.mn']
 
 JS_PREFERENCE_PP_FILES += [
     'prefs.js',
 ]
 
 FINAL_TARGET_PP_FILES += [
     'webapprt.ini',
 ]
+
+DEFINES['TOPOBJDIR'] = TOPOBJDIR
--- a/webapprt/webapprt.ini
+++ b/webapprt/webapprt.ini
@@ -1,15 +1,16 @@
 #if 0
 ; This Source Code Form is subject to the terms of the Mozilla Public
 ; License, v. 2.0. If a copy of the MPL was not distributed with this file,
 ; You can obtain one at http://mozilla.org/MPL/2.0/.
 #endif
 
 #filter substitution
+#include @TOPOBJDIR@/buildid.h
 
 [App]
 ID=webapprt@mozilla.org
 Vendor=Mozilla
 ; Note: the Windows stub executable sets nsXREAppData::name to the webapp
 ; origin, overriding the value below, to make the app runner treat webapps
 ; as distinct products, per bug 747409.
 Name=Webapp Runtime
--- a/webapprt/win/Makefile.in
+++ b/webapprt/win/Makefile.in
@@ -43,13 +43,8 @@ libs::
 	$(MAKE) webapp_uninstaller
 
 GARBAGE_DIRS += instgen
 
 PROGRAMS_DEST = $(DIST)/bin
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk
-
-MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
-
-webapprt.$(OBJ_SUFFIX): $(DEPTH)/config/buildid
--- a/webapprt/win/webapprt.cpp
+++ b/webapprt/win/webapprt.cpp
@@ -14,16 +14,17 @@
 // Mozilla headers (alphabetical)
 #include "nsIFile.h"
 #include "nsINIParser.h"
 #include "nsWindowsWMain.cpp"   // we want a wmain entry point
 #include "nsXPCOMGlue.h"
 #include "nsXPCOMPrivate.h"     // for MAXPATHLEN and XPCOM_DLL
 #include "nsXULAppAPI.h"
 #include "mozilla/AppData.h"
+#include "buildid.h"
 
 using namespace mozilla;
 
 XRE_GetFileFromPathType XRE_GetFileFromPath;
 XRE_CreateAppDataType XRE_CreateAppData;
 XRE_FreeAppDataType XRE_FreeAppData;
 XRE_mainType XRE_main;