Bug 1043390 - Don't use getSourceRepo on local builds; r=glandium
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 07 Aug 2014 21:29:39 -0400
changeset 198615 0f37cf9a01fde2619038d2af2c2b4bf80bb59390
parent 198614 587758056245e278b04e9062caf309a5250135a8
child 198616 05e4c47f1e98f7b46811d691581bd2d91d08f43d
push idunknown
push userunknown
push dateunknown
reviewersglandium
bugs1043390
milestone34.0a1
Bug 1043390 - Don't use getSourceRepo on local builds; r=glandium
b2g/app/Makefile.in
build/Makefile.in
python/mozbuild/mozbuild/mozinfo.py
toolkit/components/telemetry/Makefile.in
toolkit/components/telemetry/tests/unit/xpcshell.ini
toolkit/content/Makefile.in
toolkit/mozapps/installer/package-name.mk
toolkit/mozapps/installer/packager.mk
toolkit/xre/Makefile.in
--- a/b2g/app/Makefile.in
+++ b/b2g/app/Makefile.in
@@ -19,21 +19,16 @@ INSTALL_TARGETS += UA_UPDATE
 
 # Make sure the standalone glue doesn't try to get libxpcom.so from b2g/app.
 NSDISTMODE = copy
 
 include $(topsrcdir)/config/rules.mk
 
 APP_ICON = b2g
 
-source_repo ?= $(call getSourceRepo,$(srcdir)/..)
-ifneq (,$(filter http%,$(source_repo)))
-  DEFINES += -DMOZ_SOURCE_REPO='$(source_repo)'
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 REDIT_PATH = $(LIBXUL_DIST)/bin
 endif
 
 APP_BINARY = $(MOZ_APP_NAME)$(BIN_SUFFIX)
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -28,20 +28,22 @@ DEFINES += -DAPP_BUILDID=$(APP_BUILDID)
 
 APP_INI_DEPS += $(DEPTH)/config/autoconf.mk
 
 MOZ_SOURCE_STAMP := $(firstword $(shell cd $(topsrcdir)/$(MOZ_BUILD_APP)/.. && hg parent --template='{node|short}\n' 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP='$(MOZ_SOURCE_STAMP)'
 endif
 
+ifdef MOZILLA_OFFICIAL
 source_repo ?= $(call getSourceRepo,$(topsrcdir)/$(MOZ_BUILD_APP)/..)
 ifneq (,$(source_repo))
   DEFINES += -DMOZ_SOURCE_REPO='$(source_repo)'
 endif
+endif
 
 endif
 
 # Put a useful .gdbinit in the bin directory, to be picked up automatically
 # by GDB when we debug executables there.
 # NOTE: Keep .gdbinit in the topsrcdir for people who run gdb from the topsrcdir.
 GDBINIT_FILES := $(topsrcdir)/.gdbinit
 GDBINIT_OBJDIR_FILES = $(topsrcdir)/.gdbinit
--- a/python/mozbuild/mozbuild/mozinfo.py
+++ b/python/mozbuild/mozbuild/mozinfo.py
@@ -83,16 +83,18 @@ def build_dict(config, env=os.environ):
     d['healthreport'] = substs.get('MOZ_SERVICES_HEALTHREPORT') == '1'
     d['asan'] = substs.get('MOZ_ASAN') == '1'
     d['tests_enabled'] = substs.get('ENABLE_TESTS') == "1"
     d['bin_suffix'] = substs.get('BIN_SUFFIX', '')
 
     d['webm'] = bool(substs.get('MOZ_WEBM'))
     d['wave'] = bool(substs.get('MOZ_WAVE'))
 
+    d['official'] = bool(substs.get('MOZILLA_OFFICIAL'))
+
     return d
 
 
 def write_mozinfo(file, config, env=os.environ):
     """Write JSON data about the configuration specified in config and an
     environment variable dict to |file|, which may be a filename or file-like
     object.
     See build_dict for information about what  environment variables are used,
--- a/toolkit/components/telemetry/Makefile.in
+++ b/toolkit/components/telemetry/Makefile.in
@@ -3,20 +3,22 @@
 # 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/.
 
 USE_RCS_MK := 1
 include $(topsrcdir)/config/makefiles/rcs.mk
 
 DEFINES += -DMOZ_APP_VERSION='"$(MOZ_APP_VERSION)"'
 
+ifdef MOZILLA_OFFICIAL
 MOZ_HISTOGRAMS_VERSION ?= $(call getSourceRepo)/rev/$(firstword $(shell hg -R $(topsrcdir) parent --template='{node|short}\n' 2>/dev/null))
 ifdef MOZ_HISTOGRAMS_VERSION
 DEFINES += -DHISTOGRAMS_FILE_VERSION='$(MOZ_HISTOGRAMS_VERSION)'
 endif
+endif
 
 INSTALL_TARGETS += histoenums
 histoenums_FILES := TelemetryHistogramEnums.h
 histoenums_DEST = $(DIST)/include/mozilla
 histoenums_TARGET := export
 
 include $(topsrcdir)/config/rules.mk
 
--- a/toolkit/components/telemetry/tests/unit/xpcshell.ini
+++ b/toolkit/components/telemetry/tests/unit/xpcshell.ini
@@ -4,16 +4,17 @@ tail =
 
 [test_nsITelemetry.js]
 [test_TelemetryLateWrites.js]
 [test_TelemetryLockCount.js]
 [test_TelemetryLog.js]
 [test_TelemetryPing.js]
 # Bug 676989: test fails consistently on Android
 # fail-if = os == "android"
+fail-if = !official # This test fails in unofficial builds because the payload revision is unavailable
 [test_TelemetryPing_idle.js]
 [test_TelemetryStopwatch.js]
 [test_TelemetryPingBuildID.js]
 [test_ThirdPartyCookieProbe.js]
 [test_TelemetrySendOldPings.js]
 skip-if = debug == true || os == "android" # Disabled due to intermittent orange on Android
 [test_ThreadHangStats.js]
 # Bug 1032996: test fails consistently in Android x86 emulator
--- a/toolkit/content/Makefile.in
+++ b/toolkit/content/Makefile.in
@@ -11,19 +11,21 @@ DEFINES += \
   -DCPPFLAGS='$(CPPFLAGS)' \
   $(NULL)
 
 MOZ_SOURCE_STAMP ?= $(shell hg -R $(topsrcdir) parent --template='{node|short}\n' 2>/dev/null)
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DSOURCE_CHANGESET='$(MOZ_SOURCE_STAMP)'
 endif
 
+ifdef MOZILLA_OFFICIAL
 source_repo ?= $(call getSourceRepo)
 ifneq (,$(filter http%,$(source_repo)))
   DEFINES += -DSOURCE_REPO='$(source_repo)'
 else ifneq (,$(strip $(source_repo)))
   DEFINES += -DSOURCE_GIT_COMMIT='$(source_repo)'
 endif
+endif
 
 ifndef BUILD_HOSTNAME
   BUILD_HOSTNAME = $(shell hostname -s || hostname)
 endif
 DEFINES += -DBUILD_HOSTNAME='$(BUILD_HOSTNAME)'
--- a/toolkit/mozapps/installer/package-name.mk
+++ b/toolkit/mozapps/installer/package-name.mk
@@ -140,17 +140,19 @@ ifndef INCLUDED_RCS_MK
 endif
 
 MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(MOZILLA_DIR) parent --template="{node|short}\n" 2>/dev/null))
 
 ###########################################################################
 # bug: 746277 - preserve existing functionality.
 # MOZILLA_DIR="": cd $(SPACE); hg # succeeds if ~/.hg exists
 ###########################################################################
+ifdef MOZILLA_OFFICIAL
 MOZ_SOURCE_REPO = $(call getSourceRepo,$(MOZILLA_DIR)$(NULL) $(NULL))
+endif
 
 MOZ_SOURCESTAMP_FILE = $(DIST)/$(PKG_PATH)/$(MOZ_INFO_BASENAME).txt
 MOZ_BUILDINFO_FILE = $(DIST)/$(PKG_PATH)/$(MOZ_INFO_BASENAME).json
 
 # JavaScript Shell
 PKG_JSSHELL = $(DIST)/jsshell-$(MOZ_PKG_PLATFORM).zip
 
 endif # PACKAGE_NAME_MK_INCLUDED
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -212,17 +212,17 @@ RPM_CMD = \
   --target $(TARGET_CPU) \
   --buildroot $(RPMBUILD_TOPDIR)/BUILDROOT \
   --define 'moz_app_name $(MOZ_APP_NAME)' \
   --define 'moz_app_displayname $(MOZ_APP_DISPLAYNAME)' \
   --define 'moz_app_version $(MOZ_APP_VERSION)' \
   --define 'moz_numeric_app_version $(MOZ_NUMERIC_APP_VERSION)' \
   --define 'moz_rpm_release $(MOZ_RPM_RELEASE)' \
   --define 'buildid $(BUILDID)' \
-  --define 'moz_source_repo $(MOZ_SOURCE_REPO)' \
+  $(if $(MOZ_SOURCE_REPO),--define 'moz_source_repo $(MOZ_SOURCE_REPO)') \
   --define 'moz_source_stamp $(MOZ_SOURCE_STAMP)' \
   --define 'moz_branding_directory $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)' \
   --define '_topdir $(RPMBUILD_TOPDIR)' \
   --define '_rpmdir $(RPMBUILD_RPMDIR)' \
   --define '_sourcedir $(RPMBUILD_SOURCEDIR)' \
   --define '_specdir $(RPMBUILD_SPECDIR)' \
   --define '_srcrpmdir $(RPMBUILD_SRPMDIR)' \
   --define '_builddir $(RPMBUILD_BUILDDIR)' \
@@ -752,24 +752,26 @@ make-package: FORCE
 	$(MAKE) make-package-internal
 	$(TOUCH) $@
 
 GARBAGE += make-package
 
 make-sourcestamp-file::
 	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
 	@echo '$(BUILDID)' > $(MOZ_SOURCESTAMP_FILE)
+ifdef MOZ_SOURCE_REPO
 	@echo '$(MOZ_SOURCE_REPO)/rev/$(MOZ_SOURCE_STAMP)' >> $(MOZ_SOURCESTAMP_FILE)
+endif
 
 .PHONY: make-buildinfo-file
 make-buildinfo-file:
 	$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/informulate.py \
 		$(MOZ_BUILDINFO_FILE) \
 		BUILDID=$(BUILDID) \
-		MOZ_SOURCE_REPO=$(MOZ_SOURCE_REPO) \
+		$(addprefix MOZ_SOURCE_REPO=,MOZ_SOURCE_REPO=$(MOZ_SOURCE_REPO)) \
 		MOZ_SOURCE_STAMP=$(MOZ_SOURCE_STAMP) \
 		MOZ_PKG_PLATFORM=$(MOZ_PKG_PLATFORM)
 
 # The install target will install the application to prefix/lib/appname-version
 # In addition if INSTALL_SDK is set, it will install the development headers,
 # libraries, and IDL files as follows:
 # dist/include -> prefix/include/appname-version
 # dist/idl -> prefix/share/idl/appname-version
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -19,21 +19,23 @@ TOOLKIT_EM_VERSION=$(shell $(PERL) $(top
 # Valid if null: {warn,error}IfEmpty
 DEFINES += -DTOOLKIT_EM_VERSION='"$(TOOLKIT_EM_VERSION)"'
 
 MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template='{node|short}\n' 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 
   INIARGS = --sourcestamp=$(MOZ_SOURCE_STAMP)
 
-  source_repo := $(call getSourceRepo)
+  ifdef MOZILLA_OFFICIAL
+    source_repo := $(call getSourceRepo)
 
-  # extra sanity check for old versions of hg, no showconfig support
-  ifneq (,$(filter http%,$(source_repo)))
-    INIARGS += --sourcerepo=$(source_repo)
+    # 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)
 
 DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)