Bug 1123990 - installer needs voucher.bin; r=glandium, r=cpearce, a=lmandel
authorMike Shal <mshal@mozilla.com>
Thu, 19 Feb 2015 10:04:16 -0500
changeset 250285 b377c6a7858e
parent 250284 a50e75019bd3
child 250286 67df6f1dbe4f
push id4535
push usercpearce@mozilla.com
push date2015-03-06 20:57 +0000
treeherdermozilla-beta@68707623b5a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, cpearce, lmandel
bugs1123990
milestone37.0
Bug 1123990 - installer needs voucher.bin; r=glandium, r=cpearce, a=lmandel
build/moz-automation.mk
toolkit/mozapps/installer/make-eme.mk
toolkit/mozapps/installer/packager.mk
toolkit/mozapps/installer/packager.py
toolkit/mozapps/installer/upload-files.mk
--- a/build/moz-automation.mk
+++ b/build/moz-automation.mk
@@ -57,16 +57,17 @@ moz_automation_symbols = \
   UPLOAD \
   $(NULL)
 MOZ_AUTOMATION_TIERS := $(foreach sym,$(moz_automation_symbols),$(if $(filter 1,$(MOZ_AUTOMATION_$(sym))),$(tier_$(sym))))
 
 # Dependencies between automation build steps
 automation/uploadsymbols: automation/buildsymbols
 
 automation/update-packaging: automation/package
+automation/update-packaging: automation/installer
 automation/pretty-update-packaging: automation/pretty-package
 automation/pretty-update-packaging: automation/pretty-installer
 
 automation/l10n-check: automation/package
 automation/l10n-check: automation/installer
 automation/pretty-l10n-check: automation/pretty-package
 automation/pretty-l10n-check: automation/pretty-installer
 
@@ -76,16 +77,20 @@ automation/upload: automation/package-te
 automation/upload: automation/buildsymbols
 automation/upload: automation/update-packaging
 
 # automation/{pretty-}package should depend on build (which is implicit due to
 # the way client.mk invokes automation/build), but buildsymbols changes the
 # binaries/libs, and that's what we package/test.
 automation/pretty-package: automation/buildsymbols
 
+# The installer and packager both run stage-package, and may conflict
+# with each other.
+automation/installer: automation/package
+
 # The 'pretty' versions of targets run before the regular ones to avoid
 # conflicts in writing to the same files.
 automation/installer: automation/pretty-installer
 automation/package: automation/pretty-package
 automation/package-tests: automation/pretty-package-tests
 automation/l10n-check: automation/pretty-l10n-check
 automation/update-packaging: automation/pretty-update-packaging
 
--- a/toolkit/mozapps/installer/make-eme.mk
+++ b/toolkit/mozapps/installer/make-eme.mk
@@ -1,13 +1,14 @@
 # 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 $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
 
 ifdef MOZ_SIGN_CMD
   ifeq ($(OS_ARCH),WINNT)
-    # Note: CWD is DIST
-    MAKE_SIGN_EME_VOUCHER := $(PYTHON) $(MOZILLA_DIR)/python/eme/gen-eme-voucher.py -input $(STAGEPATH)$(MOZ_PKG_DIR)/plugin-container.exe -output $(STAGEPATH)$(MOZ_PKG_DIR)/voucher.bin && \
-      $(MOZ_SIGN_CMD) -f emevoucher "$(STAGEPATH)$(MOZ_PKG_DIR)/voucher.bin"
+    # The argument to this macro is the directory where plugin-container.exe
+    # exists, and where voucher.bin will be generated.
+    MAKE_SIGN_EME_VOUCHER = $(PYTHON) $(MOZILLA_DIR)/python/eme/gen-eme-voucher.py -input $(1)/plugin-container.exe -output $(1)/voucher.bin && \
+      $(MOZ_SIGN_CMD) -f emevoucher "$(1)/voucher.bin"
   endif
 endif
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -17,21 +17,22 @@ endif
 installer-stage: prepare-package
 ifndef MOZ_PKG_MANIFEST
 	$(error MOZ_PKG_MANIFEST unspecified!)
 endif
 	@rm -rf $(DEPTH)/installer-stage $(DIST)/xpt
 	@echo 'Staging installer files...'
 	@$(NSINSTALL) -D $(DEPTH)/installer-stage/core
 	@cp -av $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/. $(DEPTH)/installer-stage/core
-	@(cd $(DEPTH)/installer-stage/core && $(CREATE_PRECOMPLETE_CMD))
 ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD
 # The && true is necessary to make sure Pymake spins a shell
 	$(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(DEPTH)/installer-stage && true
 endif
+	$(call MAKE_SIGN_EME_VOUCHER,$(DEPTH)/installer-stage/core)
+	@(cd $(DEPTH)/installer-stage/core && $(CREATE_PRECOMPLETE_CMD))
 
 # Override the value of OMNIJAR_NAME from config.status with the value
 # set earlier in this file.
 
 stage-package: $(MOZ_PKG_MANIFEST)
 	@rm -rf $(DIST)/$(PKG_PATH)$(PKG_BASENAME).tar $(DIST)/$(PKG_PATH)$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST)
 	OMNIJAR_NAME=$(OMNIJAR_NAME) \
 	$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.py $(DEFINES) \
--- a/toolkit/mozapps/installer/packager.py
+++ b/toolkit/mozapps/installer/packager.py
@@ -22,17 +22,16 @@ from mozpack.copier import (
     FileCopier,
     Jarrer,
 )
 from mozpack.errors import errors
 from mozpack.unify import UnifiedBuildFinder
 import mozpack.path
 import buildconfig
 from argparse import ArgumentParser
-from createprecomplete import generate_precomplete
 import os
 from StringIO import StringIO
 import subprocess
 import platform
 import mozinfo
 
 # List of libraries to shlibsign.
 SIGN_LIBS = [
@@ -389,14 +388,12 @@ def main():
             if not gre_path:
                 gre_path = base
             base_path = sink.normalize_path(base)
             if base_path in formatter.omnijars:
                 precompile_cache(formatter.omnijars[base_path],
                                  args.source, gre_path, base)
 
     copier.copy(args.destination)
-    generate_precomplete(os.path.normpath(os.path.join(args.destination,
-                                                       respath)))
 
 
 if __name__ == '__main__':
     main()
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -32,16 +32,18 @@ endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 ifndef _APPNAME
 _APPNAME = $(MOZ_MACBUNDLE_NAME)
 endif
 ifndef _BINPATH
 _BINPATH = /$(_APPNAME)/Contents/MacOS
 endif # _BINPATH
+# Resource path for the precomplete file
+_RESPATH = /$(_APPNAME)/Contents/Resources
 ifdef UNIVERSAL_BINARY
 STAGEPATH = universal/
 endif
 endif
 
 PACKAGE_BASE_DIR = $(_ABS_DIST)
 PACKAGE       = $(PKG_PATH)$(PKG_BASENAME)$(PKG_SUFFIX)
 
@@ -519,25 +521,27 @@ endif
 ifdef MOZ_EXTERNAL_SIGNING_FORMAT
 MOZ_SIGN_PACKAGE_CMD=$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f))
 endif
 
 ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD
 ifeq (Darwin, $(OS_ARCH))
 MAKE_PACKAGE    = cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME) \
                   && cd $(PACKAGE_BASE_DIR) \
+                  && (cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_RESPATH) && $(CREATE_PRECOMPLETE_CMD)) \
                   && $(INNER_MAKE_PACKAGE)
 else
 MAKE_PACKAGE    = $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_PKG_DIR) \
-                  && $(or $(MAKE_SIGN_EME_VOUCHER),true) \
+                  && $(or $(call MAKE_SIGN_EME_VOUCHER,$(STAGEPATH)$(MOZ_PKG_DIR)),true) \
+                  && (cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_RESPATH) && $(CREATE_PRECOMPLETE_CMD)) \
                   && $(INNER_MAKE_PACKAGE)
 endif #Darwin
 
 else
-MAKE_PACKAGE    = $(INNER_MAKE_PACKAGE)
+MAKE_PACKAGE    = (cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_RESPATH) && $(CREATE_PRECOMPLETE_CMD)) && $(INNER_MAKE_PACKAGE)
 endif
 
 ifdef MOZ_SIGN_PACKAGE_CMD
 MAKE_PACKAGE    += && $(MOZ_SIGN_PACKAGE_CMD) '$(PACKAGE)'
 endif
 
 ifdef MOZ_SIGN_CMD
 MAKE_SDK           += && $(MOZ_SIGN_CMD) -f gpg $(SDK)