Bug 1246874 - Unify GRE_BUILDID and MOZ_APP_BUILDID at the build system level. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 09 Feb 2016 16:13:37 +0900
changeset 283663 d315d56d7d5b33c5a9ace514495c25364075bb5c
parent 283662 fd77a8831f4da7723d13130e08524158f17c03ba
child 283664 ec570b146713a586b97e8dba1be53c7ba8f2a3b7
push id29988
push usercbook@mozilla.com
push dateWed, 10 Feb 2016 10:47:59 +0000
treeherdermozilla-central@7042e8a19f94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1246874
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1246874 - Unify GRE_BUILDID and MOZ_APP_BUILDID at the build system level. r=mshal
build/Makefile.in
build/application.ini
config/faster/rules.mk
mobile/android/base/AppConstants.java.in
mobile/android/base/Makefile.in
testing/taskcluster/scripts/builder/build-simulator.sh
toolkit/xre/Makefile.in
toolkit/xre/nsAppRunner.cpp
webapprt/Makefile.in
webapprt/gtk/Makefile.in
webapprt/gtk/webapprt.cpp
webapprt/mac/Makefile.in
webapprt/mac/webapprt.mm
webapprt/webapprt.ini
webapprt/win/Makefile.in
webapprt/win/webapprt.cpp
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -4,20 +4,20 @@
 # 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_APP_BUILDID := $(shell cat $(DEPTH)/config/buildid)
+MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
 APP_INI_DEPS += $(DEPTH)/config/buildid
 
-DEFINES += -DMOZ_APP_BUILDID=$(MOZ_APP_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
 
--- a/build/application.ini
+++ b/build/application.ini
@@ -21,17 +21,17 @@ Name=@MOZ_APP_BASENAME@
 RemotingName=@MOZ_APP_REMOTINGNAME@
 #ifdef MOZ_APP_DISPLAYNAME
 CodeName=@MOZ_APP_DISPLAYNAME@
 #endif
 Version=@MOZ_APP_VERSION@
 #ifdef MOZ_APP_PROFILE
 Profile=@MOZ_APP_PROFILE@
 #endif
-BuildID=@MOZ_APP_BUILDID@
+BuildID=@MOZ_BUILDID@
 #ifdef MOZ_SOURCE_REPO
 SourceRepository=@MOZ_SOURCE_REPO@
 #endif
 #ifdef MOZ_SOURCE_STAMP
 SourceStamp=@MOZ_SOURCE_STAMP@
 #endif
 ID=@MOZ_APP_ID@
 
@@ -42,10 +42,10 @@ MaxVersion=@GRE_MILESTONE@
 [XRE]
 #ifdef MOZ_PROFILE_MIGRATOR
 EnableProfileMigrator=1
 #endif
 
 #if MOZ_CRASHREPORTER
 [Crash Reporter]
 Enabled=1
-ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSION@&buildid=@MOZ_APP_BUILDID@
+ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSION@&buildid=@MOZ_BUILDID@
 #endif
--- a/config/faster/rules.mk
+++ b/config/faster/rules.mk
@@ -98,17 +98,17 @@ ACDEFINES += -DBUILD_FASTER
 	@# 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_APP_BUILDID=$(shell cat $(TOPOBJDIR)/config/buildid) \
+		-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.
 
 # Files to build with the recursive backend and simply copy
--- a/mobile/android/base/AppConstants.java.in
+++ b/mobile/android/base/AppConstants.java.in
@@ -92,17 +92,17 @@ public class AppConstants {
     public static final String GRE_MILESTONE = "@GRE_MILESTONE@";
 
     public static final String MOZ_APP_ABI = "@MOZ_APP_ABI@";
     public static final String MOZ_APP_BASENAME = "@MOZ_APP_BASENAME@";
 
     // For the benefit of future archaeologists:
     // GRE_BUILDID is exactly the same as MOZ_APP_BUILDID unless you're running
     // on XULRunner, which is never the case on Android.
-    public static final String MOZ_APP_BUILDID = "@MOZ_APP_BUILDID@";
+    public static final String MOZ_APP_BUILDID = "@MOZ_BUILDID@";
     public static final String MOZ_APP_ID = "@MOZ_APP_ID@";
     public static final String MOZ_APP_NAME = "@MOZ_APP_NAME@";
     public static final String MOZ_APP_VENDOR = "@MOZ_APP_VENDOR@";
     public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@";
     public static final String MOZ_APP_DISPLAYNAME = "@MOZ_APP_DISPLAYNAME@";
     // MOZ_APP_UA_NAME is already quoted when it gets substituted, like MOZILLA_VERSION.
     public static final String MOZ_APP_UA_NAME = @MOZ_APP_UA_NAME@;
 
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -1,34 +1,34 @@
 # 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_APP_BUILDID=$(shell cat $(DEPTH)/config/buildid)
+MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
 
 # 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 \
         --verbose \
         --with-android-cpu-arch=$(ANDROID_CPU_ARCH) \
         $(if $(MOZ_ANDROID_MIN_SDK_VERSION),--with-android-min-sdk=$(MOZ_ANDROID_MIN_SDK_VERSION)) \
         $(if $(MOZ_ANDROID_MAX_SDK_VERSION),--with-android-max-sdk=$(MOZ_ANDROID_MAX_SDK_VERSION)) \
-        $(MOZ_APP_BUILDID))
+        $(MOZ_BUILDID))
 endif
 
 DEFINES += \
   -DANDROID_VERSION_CODE=$(ANDROID_VERSION_CODE) \
   -DMOZ_ANDROID_SHARED_ID="$(MOZ_ANDROID_SHARED_ID)" \
   -DMOZ_ANDROID_SHARED_ACCOUNT_TYPE="$(MOZ_ANDROID_SHARED_ACCOUNT_TYPE)" \
   -DMOZ_ANDROID_SHARED_FXACCOUNT_TYPE="$(MOZ_ANDROID_SHARED_FXACCOUNT_TYPE)" \
-  -DMOZ_APP_BUILDID=$(MOZ_APP_BUILDID) \
+  -DMOZ_BUILDID=$(MOZ_BUILDID) \
   $(NULL)
 
 GARBAGE += \
   classes.dex  \
   gecko.ap_  \
   res/values/strings.xml \
   res/raw/browsersearch.json \
   res/raw/suggestedsites.json \
--- a/testing/taskcluster/scripts/builder/build-simulator.sh
+++ b/testing/taskcluster/scripts/builder/build-simulator.sh
@@ -152,22 +152,22 @@ cat $SIM_DIR/custom-prefs.js >> $ADDON_D
 if [ -f $ADDON_DIR/firefox/application.ini ]; then
   APPLICATION_INI=$ADDON_DIR/firefox/application.ini
 elif [ -f $ADDON_DIR/firefox/FirefoxNightly.app/Contents/Resources/application.ini ]; then
   APPLICATION_INI=$ADDON_DIR/firefox/FirefoxNightly.app/Contents/Resources/application.ini
 else
   echo "Unable to find application.ini file"
   exit
 fi
-MOZ_APP_BUILDID=$(sed -n "s/BuildID=\([0-9]\{8\}\)/\1/p" $APPLICATION_INI)
-echo "BUILDID $MOZ_APP_BUILDID -- VERSION $VERSION"
+MOZ_BUILDID=$(sed -n "s/BuildID=\([0-9]\{8\}\)/\1/p" $APPLICATION_INI)
+echo "BUILDID $MOZ_BUILDID -- VERSION $VERSION"
 
-XPI_NAME=fxos-simulator-$VERSION.$MOZ_APP_BUILDID-$PLATFORM.xpi
+XPI_NAME=fxos-simulator-$VERSION.$MOZ_BUILDID-$PLATFORM.xpi
 ADDON_ID=fxos_$(echo $VERSION | sed "s/\./_/")_simulator@mozilla.org
-ADDON_VERSION=$VERSION.$MOZ_APP_BUILDID
+ADDON_VERSION=$VERSION.$MOZ_BUILDID
 ADDON_NAME="Firefox OS $VERSION Simulator"
 ADDON_DESCRIPTION="a Firefox OS $VERSION Simulator"
 
 echo "ADDON_ID: $ADDON_ID"
 echo "ADDON_VERSION: $ADDON_VERSION"
 
 FTP_ROOT_PATH=/pub/mozilla.org/labs/fxos-simulator
 UPDATE_PATH=$VERSION/$PLATFORM
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -23,23 +23,23 @@ ifdef MOZ_SOURCE_STAMP
     # extra sanity check for old versions of hg, no showconfig support
     ifneq (,$(filter http%,$(source_repo)))
       INIARGS += --sourcerepo=$(source_repo)
     endif
   endif
 
 endif # MOZ_SOURCE_STAMP
 
-GRE_BUILDID   := $(strip $(firstword $(shell cat $(DEPTH)/config/buildid 2>/dev/null)))
-$(call errorIfEmpty,GRE_MILESTONE GRE_BUILDID)
+MOZ_BUILDID   := $(strip $(firstword $(shell cat $(DEPTH)/config/buildid 2>/dev/null)))
+$(call errorIfEmpty,GRE_MILESTONE MOZ_BUILDID)
 
-DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)
+DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
 
 $(srcdir)/nsAppRunner.cpp: $(DEPTH)/config/buildid $(milestone_txt)
 
 platform.ini: FORCE
-	$(PYTHON) $(srcdir)/make-platformini.py --buildid=$(GRE_BUILDID) $(INIARGS) $(milestone_txt) > $@
+	$(PYTHON) $(srcdir)/make-platformini.py --buildid=$(MOZ_BUILDID) $(INIARGS) $(milestone_txt) > $@
 
 GARBAGE += platform.ini
 
 # Moving this out of libs breaks packaging.
 libs:: platform.ini
 	$(INSTALL) $^ $(DIST)/bin
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -219,17 +219,17 @@ extern void InstallSignalHandlers(const 
 
 #define FILE_COMPATIBILITY_INFO NS_LITERAL_CSTRING("compatibility.ini")
 #define FILE_INVALIDATE_CACHES NS_LITERAL_CSTRING(".purgecaches")
 
 int    gArgc;
 char **gArgv;
 
 static const char gToolkitVersion[] = NS_STRINGIFY(GRE_MILESTONE);
-static const char gToolkitBuildID[] = NS_STRINGIFY(GRE_BUILDID);
+static const char gToolkitBuildID[] = NS_STRINGIFY(MOZ_BUILDID);
 
 static nsIProfileLock* gProfileLock;
 
 int    gRestartArgc;
 char **gRestartArgv;
 
 bool gIsGtest = false;
 
--- a/webapprt/Makefile.in
+++ b/webapprt/Makefile.in
@@ -1,12 +1,12 @@
 # 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_APP_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-DEFINES += -DMOZ_APP_BUILDID=$(MOZ_APP_BUILDID)
+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
@@ -3,12 +3,12 @@
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 NSDISTMODE = copy
 
 PROGRAMS_DEST = $(DIST)/bin
 
 include $(topsrcdir)/config/rules.mk
 
-GRE_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)
+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
@@ -391,17 +391,17 @@ int main(int argc, char *argv[])
   // Get buildid of Firefox we're trying to load (MAXPATHLEN only for convenience)
   char buildid[MAXPATHLEN];
   if (NS_FAILED(parser.GetString("App", "BuildID", buildid, MAXPATHLEN))) {
     ErrorDialog("Couldn't read BuildID from Firefox application.ini");
     return 255;
   }
 
   // If WebAppRT version == Firefox version, load XUL and execute the application
-  if (!strcmp(buildid, NS_STRINGIFY(GRE_BUILDID))) {
+  if (!strcmp(buildid, NS_STRINGIFY(MOZ_BUILDID))) {
     if (GRELoadAndLaunch(firefoxDir, false))
       return 0;
   }
   // Else, copy WebAppRT from Firefox installation and re-execute the process
   else
     CopyAndRelaunch(firefoxDir, curExePath);
 
   return 255;
--- a/webapprt/mac/Makefile.in
+++ b/webapprt/mac/Makefile.in
@@ -5,12 +5,12 @@
 # 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
 
-GRE_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)
+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
@@ -93,17 +93,17 @@ main(int argc, char **argv)
 
   NSDictionary *args = [[NSUserDefaults standardUserDefaults]
                          volatileDomainForName:NSArgumentDomain];
 
   NSString *firefoxPath = nil;
   NSString *alternateBinaryID = nil;
 
   //this is our version, to be compared with the version of the binary we are asked to use
-  NSString* myVersion = [NSString stringWithFormat:@"%s", NS_STRINGIFY(GRE_BUILDID)];
+  NSString* myVersion = [NSString stringWithFormat:@"%s", NS_STRINGIFY(MOZ_BUILDID)];
 
   NSLog(@"MY WEBAPPRT BUILDID: %@", myVersion);
 
 
   //I need to look in our bundle first, before deciding what firefox binary to use
   NSBundle* myBundle = [NSBundle mainBundle];
   NSString* myBundlePath = [myBundle bundlePath];
   alternateBinaryID = [myBundle objectForInfoDictionaryKey:@"FirefoxBinary"];
--- a/webapprt/webapprt.ini
+++ b/webapprt/webapprt.ini
@@ -9,20 +9,20 @@
 [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
 Version=@GRE_MILESTONE@
-BuildID=@MOZ_APP_BUILDID@
+BuildID=@MOZ_BUILDID@
 UAName=@MOZ_APP_BASENAME@
 
 [Gecko]
 MinVersion=@GRE_MILESTONE@
 MaxVersion=@GRE_MILESTONE@
 
 [Crash Reporter]
 #if MOZILLA_OFFICIAL
 Enabled=1
 #endif
-ServerURL=https://crash-reports.mozilla.com/submit?id=webapprt@mozilla.org&version=@GRE_MILESTONE@&buildid=@MOZ_APP_BUILDID@
+ServerURL=https://crash-reports.mozilla.com/submit?id=webapprt@mozilla.org&version=@GRE_MILESTONE@&buildid=@MOZ_BUILDID@
--- a/webapprt/win/Makefile.in
+++ b/webapprt/win/Makefile.in
@@ -44,12 +44,12 @@ libs::
 
 GARBAGE_DIRS += instgen
 
 PROGRAMS_DEST = $(DIST)/bin
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk
 
-GRE_BUILDID := $(shell cat $(DEPTH)/config/buildid)
-DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)
+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
@@ -321,17 +321,17 @@ namespace {
                               // necessarily make sense, but it's a
                               // convenient number to use.
     rv = parser.GetString("App",
                           "BuildID",
                           buildid,
                           MAXPATHLEN);
     NS_ENSURE_SUCCESS(rv, false);
 
-    if (0 == strcmp(buildid, NS_STRINGIFY(GRE_BUILDID))) {
+    if (0 == strcmp(buildid, NS_STRINGIFY(MOZ_BUILDID))) {
       return AttemptGRELoadAndLaunch(firefoxDir);
     }
 
     char webAppRTExe[MAXPATHLEN];
     rv = joinPath(webAppRTExe, firefoxDir, kAPP_RT, MAXPATHLEN);
     NS_ENSURE_SUCCESS(rv, false);
 
     return AttemptCopyAndLaunch(webAppRTExe);