Bug 853071: add some build-time defines for channel-specific features, r=gps, f=bhearsum
authorGavin Sharp <gavin@gavinsharp.com>
Thu, 25 Apr 2013 12:23:21 -0700
changeset 142015 23bb737193ed8d934dd77a1dcc23752f13b67e13
parent 142014 4f95c172c51de3e125db8df4ac8c7b24381862d4
child 142016 d775de2d818f31e3d9c23f4b33aca2c1bd7ad971
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs853071
milestone23.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 853071: add some build-time defines for channel-specific features, r=gps, f=bhearsum
browser/config/mozconfigs/linux32/beta
browser/config/mozconfigs/linux32/release
browser/config/mozconfigs/linux64/beta
browser/config/mozconfigs/linux64/release
browser/config/mozconfigs/macosx-universal/beta
browser/config/mozconfigs/macosx-universal/release
browser/config/mozconfigs/win32/beta
browser/config/mozconfigs/win32/release
build/defines.sh
config/rules.mk
configure.in
js/src/config/rules.mk
services/healthreport/Makefile.in
services/healthreport/healthreporter.jsm
copy from browser/config/mozconfigs/linux32/release
copy to browser/config/mozconfigs/linux32/beta
--- a/browser/config/mozconfigs/linux32/release
+++ b/browser/config/mozconfigs/linux32/release
@@ -1,25 +1,7 @@
-ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
-ac_add_options --enable-update-packaging
-ac_add_options --enable-official-branding
-
-. $topsrcdir/build/unix/mozconfig.linux32
-
-# Avoid dependency on libstdc++ 4.5
-ac_add_options --enable-stdcxx-compat
-
-# PGO
-mk_add_options MOZ_PGO=1
-mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
+# This make file should be identical to the beta mozconfig, apart from the
+# safeguard below
+. "$topsrcdir/browser/config/mozconfigs/linux32/beta"
 
-# Needed to enable breakpad in application.ini
-export MOZILLA_OFFICIAL=1
-
-export MOZ_TELEMETRY_REPORTING=1
-
-# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
-ac_add_options --enable-warnings-as-errors
-
-# Package js shell.
-export MOZ_PACKAGE_JSSHELL=1
-
-. "$topsrcdir/build/mozconfig.common.override"
+# safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
+# defines.sh during the beta cycle
+export BUILDING_RELEASE=1
copy from browser/config/mozconfigs/linux64/release
copy to browser/config/mozconfigs/linux64/beta
--- a/browser/config/mozconfigs/linux64/release
+++ b/browser/config/mozconfigs/linux64/release
@@ -1,25 +1,7 @@
-ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
-ac_add_options --enable-update-packaging
-ac_add_options --enable-official-branding
-
-. $topsrcdir/build/unix/mozconfig.linux
-
-# Avoid dependency on libstdc++ 4.5
-ac_add_options --enable-stdcxx-compat
-
-# PGO
-mk_add_options MOZ_PGO=1
-mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
+# This make file should be identical to the beta mozconfig, apart from the
+# safeguard below
+. "$topsrcdir/browser/config/mozconfigs/linux64/beta"
 
-# Needed to enable breakpad in application.ini
-export MOZILLA_OFFICIAL=1
-
-export MOZ_TELEMETRY_REPORTING=1
-
-# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
-ac_add_options --enable-warnings-as-errors
-
-# Package js shell.
-export MOZ_PACKAGE_JSSHELL=1
-
-. "$topsrcdir/build/mozconfig.common.override"
+# safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
+# defines.sh during the beta cycle
+export BUILDING_RELEASE=1
copy from browser/config/mozconfigs/macosx-universal/release
copy to browser/config/mozconfigs/macosx-universal/beta
--- a/browser/config/mozconfigs/macosx-universal/release
+++ b/browser/config/mozconfigs/macosx-universal/release
@@ -1,21 +1,7 @@
-. $topsrcdir/build/macosx/universal/mozconfig
-
-# Universal builds override the default of browser (bug 575283 comment 29)
-ac_add_options --enable-application=browser
-
-ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
-ac_add_options --enable-update-packaging
-ac_add_options --enable-official-branding
+# This make file should be identical to the beta mozconfig, apart from the
+# safeguard below
+. "$topsrcdir/browser/config/mozconfigs/macosx-universal/beta"
 
-# Needed to enable breakpad in application.ini
-export MOZILLA_OFFICIAL=1
-
-export MOZ_TELEMETRY_REPORTING=1
-
-# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
-ac_add_options --enable-warnings-as-errors
-
-# Package js shell.
-export MOZ_PACKAGE_JSSHELL=1
-
-. "$topsrcdir/build/mozconfig.common.override"
+# safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
+# defines.sh during the beta cycle
+export BUILDING_RELEASE=1
copy from browser/config/mozconfigs/win32/release
copy to browser/config/mozconfigs/win32/beta
--- a/browser/config/mozconfigs/win32/release
+++ b/browser/config/mozconfigs/win32/release
@@ -1,33 +1,7 @@
-. "$topsrcdir/browser/config/mozconfigs/common"
-
-# for pgo
-mk_add_options MOZ_PGO=1
-mk_add_options PROFILE_GEN_SCRIPT='$(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
-
-ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
-ac_add_options --enable-update-packaging
-ac_add_options --enable-jemalloc
-ac_add_options --enable-official-branding
-
-# Needed to enable breakpad in application.ini
-export MOZILLA_OFFICIAL=1
-
-export MOZ_TELEMETRY_REPORTING=1
+# This make file should be identical to the beta mozconfig, apart from the
+# safeguard below
+. "$topsrcdir/browser/config/mozconfigs/win32/beta"
 
-if test -z "${_PYMAKE}"; then
-  mk_add_options MOZ_MAKE_FLAGS=-j1
-fi
-
-if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
-  . $topsrcdir/build/win32/mozconfig.vs2010-win64
-else
-  . $topsrcdir/build/win32/mozconfig.vs2010
-fi
-
-# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
-ac_add_options --enable-warnings-as-errors
-
-# Package js shell.
-export MOZ_PACKAGE_JSSHELL=1
-
-. "$topsrcdir/build/mozconfig.common.override"
+# safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
+# defines.sh during the beta cycle
+export BUILDING_RELEASE=1
new file mode 100644
--- /dev/null
+++ b/build/defines.sh
@@ -0,0 +1,3 @@
+# Define indicating that this build is prior to one of the early betas. To be
+# unset mid-way through the beta cycle.
+EARLY_BETA_OR_EARLIER=1
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1281,22 +1281,16 @@ ifneq (,$(DIST_SUBDIR)$(XPI_NAME)$(LIBXU
 PREF_DIR = defaults/preferences
 endif
 
 # on win32, pref files need CRLF line endings... see bug 206029
 ifeq (WINNT,$(OS_ARCH))
 PREF_PPFLAGS += --line-endings=crlf
 endif
 
-# Set a flag that can be used in pref files to disable features if
-# we are not building for Aurora or Nightly.
-ifeq (,$(findstring a,$(GRE_MILESTONE)))
-PREF_PPFLAGS += -DRELEASE_BUILD
-endif
-
 ifneq ($(PREF_JS_EXPORTS),)
 ifndef NO_DIST_INSTALL
 PREF_JS_EXPORTS_PATH := $(FINAL_TARGET)/$(PREF_DIR)
 PREF_JS_EXPORTS_FLAGS := $(PREF_PPFLAGS)
 PP_TARGETS += PREF_JS_EXPORTS
 endif
 endif
 
--- a/configure.in
+++ b/configure.in
@@ -3898,16 +3898,36 @@ dnl set GRE_MILESTONE
 dnl ========================================================
 if test -n "$LIBXUL_SDK"; then
     GRE_MILESTONE=`$PYTHON "$_topsrcdir"/config/printconfigsetting.py "$LIBXUL_DIST"/bin/platform.ini Build Milestone`
 else
     GRE_MILESTONE=`tail -n 1 "$_topsrcdir"/config/milestone.txt 2>/dev/null || tail -1 "$_topsrcdir"/config/milestone.txt`
 fi
 AC_SUBST(GRE_MILESTONE)
 
+# set RELEASE_BUILD and NIGHTLY_BUILD variables depending on the cycle we're in
+# The logic works like this:
+# - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
+# - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora
+# - otherwise, we're building Release/Beta (define RELEASE_BUILD)
+case "$GRE_MILESTONE" in
+  *a1*)
+      NIGHTLY_BUILD=1
+      AC_DEFINE(NIGHTLY_BUILD)
+      ;;
+  *a*)
+      ;;
+  *)
+      RELEASE_BUILD=1
+      AC_DEFINE(RELEASE_BUILD)
+      ;;
+esac
+AC_SUBST(NIGHTLY_BUILD)
+AC_SUBST(RELEASE_BUILD)
+
 dnl system libevent Support
 dnl ========================================================
 MOZ_ARG_WITH_STRING(system-libevent,
 [  --with-system-libevent[=PFX]
                           Use system libevent [installed at prefix PFX]],
     LIBEVENT_DIR=$withval)
 
 _SAVE_CFLAGS=$CFLAGS
@@ -4343,25 +4363,37 @@ MOZ_ARG_ENABLE_STRING([update-channel],
 
 if test -z "$MOZ_UPDATE_CHANNEL"; then
     MOZ_UPDATE_CHANNEL=default
 fi
 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
 AC_SUBST(MOZ_UPDATE_CHANNEL)
 
 # Allow the application to influence configure with a confvars.sh script.
-
 AC_MSG_CHECKING([if app-specific confvars.sh exists])
 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
   AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
   . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
 else
   AC_MSG_RESULT([no])
 fi
 
+# Allow influencing configure with a defines.sh script.
+. "${srcdir}/build/defines.sh"
+
+# If we're not building a release build, define EARLY_BETA_OR_EARLIER if it is
+# set in defines.sh
+if test "$BUILDING_RELEASE"; then
+  # Override value in defines.sh, if any
+  EARLY_BETA_OR_EARLIER=
+elif test "$EARLY_BETA_OR_EARLIER"; then
+  AC_DEFINE(EARLY_BETA_OR_EARLIER)
+fi
+AC_SUBST(EARLY_BETA_OR_EARLIER)
+
 # Allow the application to provide a subconfigure script
 if test -f "${srcdir}/${MOZ_BUILD_APP}/configure.in" ; then
   do_output_subdirs() {
     if test -n "$_subconfigure_subdirs"; then
       AC_MSG_ERROR([Cannot specify more than one sub-sub-configure])
      fi
     _subconfigure_subdir="$1"
     _subconfigure_config_args="$ac_configure_args"
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -1281,22 +1281,16 @@ ifneq (,$(DIST_SUBDIR)$(XPI_NAME)$(LIBXU
 PREF_DIR = defaults/preferences
 endif
 
 # on win32, pref files need CRLF line endings... see bug 206029
 ifeq (WINNT,$(OS_ARCH))
 PREF_PPFLAGS += --line-endings=crlf
 endif
 
-# Set a flag that can be used in pref files to disable features if
-# we are not building for Aurora or Nightly.
-ifeq (,$(findstring a,$(GRE_MILESTONE)))
-PREF_PPFLAGS += -DRELEASE_BUILD
-endif
-
 ifneq ($(PREF_JS_EXPORTS),)
 ifndef NO_DIST_INSTALL
 PREF_JS_EXPORTS_PATH := $(FINAL_TARGET)/$(PREF_DIR)
 PREF_JS_EXPORTS_FLAGS := $(PREF_PPFLAGS)
 PP_TARGETS += PREF_JS_EXPORTS
 endif
 endif
 
--- a/services/healthreport/Makefile.in
+++ b/services/healthreport/Makefile.in
@@ -28,20 +28,16 @@ healthreport_depends = \
   ../metrics/dataprovider.jsm \
   ../metrics/storage.jsm \
   healthreporter.jsm \
   profile.jsm \
   providers.jsm \
   $(NULL)
 
 
-ifneq (,$(findstring a,$(GRE_MILESTONE)))
-extra_pp_flags := -DPRERELEASE_BUILD
-endif
-
 MAIN_JS_MODULE := HealthReport.jsm
 MAIN_JS_MODULE_PATH = $(FINAL_TARGET)/modules
 MAIN_JS_MODULE_FLAGS := $(extra_pp_flags)
 PP_TARGETS += MAIN_JS_MODULE
 
 MODULES := $(modules)
 MODULES_PATH = $(FINAL_TARGET)/modules/services/healthreport
 MODULES_FLAGS := $(extra_pp_flags)
--- a/services/healthreport/healthreporter.jsm
+++ b/services/healthreport/healthreporter.jsm
@@ -1141,17 +1141,17 @@ HealthReporter.prototype = Object.freeze
       this.lastSubmitID = null;
     } else {
       this.lastSubmitID = result.id;
       this.lastPingDate = date;
     }
 
     request.onSubmissionSuccess(this._now());
 
-#ifdef PRERELEASE_BUILD
+#ifndef RELEASE_BUILD
     // Intended to be temporary until we a) assess the impact b) bug 846133
     // deploys more robust storage for state.
     try {
       Services.prefs.savePrefFile(null);
     } catch (ex) {
       this._log.warn("Error forcing prefs save: " + CommonUtils.exceptionStr(ex));
     }
 #endif