From 34b33a520ae832d444e5713991fb7b869b9d41cc Mon Sep 17 00:00:00 2001 From: Brindusan Cristian Date: Tue, 17 Apr 2018 19:08:21 +0300 Subject: [PATCH] Backed out 2 changesets (bug 1436662) for build bustages on /installer/windows. CLOSED TREE Backed out changeset fcb756834abb (bug 1436662) Backed out changeset d6bf22099e21 (bug 1436662) --- browser/build.mk | 3 + browser/config/mozconfigs/linux64/tup | 1 + browser/installer/Makefile.in | 5 ++ browser/installer/windows/Makefile.in | 18 ++++++ browser/locales/Makefile.in | 23 ++++++- build/moz-automation.mk | 9 +++ build/mozconfig.automation | 1 + build/mozconfig.win-common | 4 ++ config/config.mk | 2 + .../android-api-16-frontend/nightly | 1 + .../nightly | 1 + toolkit/locales/l10n.mk | 2 - toolkit/mozapps/installer/packager.mk | 19 ++++-- .../installer/windows/nsis/makensis.mk | 62 +++++++++---------- 14 files changed, 108 insertions(+), 43 deletions(-) diff --git a/browser/build.mk b/browser/build.mk index 38f8650d9756..4dbd523832f4 100644 --- a/browser/build.mk +++ b/browser/build.mk @@ -2,6 +2,9 @@ # 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/. +installer: + @$(MAKE) -C browser/installer installer + package: @$(MAKE) -C browser/installer diff --git a/browser/config/mozconfigs/linux64/tup b/browser/config/mozconfigs/linux64/tup index 38ae57b67c49..0ebac5fc89af 100644 --- a/browser/config/mozconfigs/linux64/tup +++ b/browser/config/mozconfigs/linux64/tup @@ -1,4 +1,5 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0 +MOZ_AUTOMATION_INSTALLER=0 MOZ_AUTOMATION_L10N_CHECK=0 MOZ_AUTOMATION_PACKAGE=0 MOZ_AUTOMATION_PACKAGE_TESTS=0 diff --git a/browser/installer/Makefile.in b/browser/installer/Makefile.in index 065abb8e2b30..2cdac26b351d 100644 --- a/browser/installer/Makefile.in +++ b/browser/installer/Makefile.in @@ -173,6 +173,11 @@ package-compare:: -diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt +installer:: +ifdef INSTALLER_DIR + $(MAKE) -C $(INSTALLER_DIR) +endif + ifdef ENABLE_MARIONETTE DEFINES += -DENABLE_MARIONETTE=1 endif diff --git a/browser/installer/windows/Makefile.in b/browser/installer/windows/Makefile.in index e405e9caca3d..3b17b55e8670 100644 --- a/browser/installer/windows/Makefile.in +++ b/browser/installer/windows/Makefile.in @@ -44,6 +44,24 @@ else PPL_LOCALE_ARGS=$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer endif +OVERRIDE_DEFAULT_GOAL := installer +installer:: + $(MAKE) -C .. installer-stage + $(MAKE) $(CONFIG_DIR)/setup.exe + +# For building the uninstaller during the application build so it can be +# included for mar file generation. +uninstaller:: + $(RM) -r $(CONFIG_DIR) + $(MKDIR) $(CONFIG_DIR) + $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR) + $(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR) + $(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \ + $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi) + $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \ + --preprocess-locale $(topsrcdir) \ + $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR) + # For building the maintenanceservice installer ifdef MOZ_MAINTENANCE_SERVICE maintenanceservice_installer:: diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in index d53788cb7c01..c2be35de469d 100644 --- a/browser/locales/Makefile.in +++ b/browser/locales/Makefile.in @@ -34,6 +34,7 @@ MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ ' endif MOZ_SFX_PACKAGE=$(topsrcdir)/other-licenses/7zstub/firefox/7zSD.sfx +MOZ_INSTALLER_PATH=$(topsrcdir)/browser/installer/windows SEARCHPLUGINS_FILENAMES := $(or $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD))), $(error Missing search plugins)) SEARCHPLUGINS_PATH := .deps/generated_$(AB_CD) @@ -106,8 +107,26 @@ endif @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$* @$(MAKE) -C ../extensions/webcompat-reporter/locales chrome AB_CD=$* +package-win32-installer: WIN32_INSTALLER_OUT=$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe package-win32-installer: $(SUBMAKEFILES) - $(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer + @echo 'Packaging $(WIN32_INSTALLER_OUT).' + $(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx + $(RM) -r $(STAGEDIST)/uninstall + $(NSINSTALL) -D $(STAGEDIST)/uninstall + cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall + $(RM) $(ABS_DIST)/l10n-stage/setup.exe + cp ../installer/windows/l10ngen/setup.exe $(ABS_DIST)/l10n-stage + $(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)' + (cd $(DIST)/l10n-stage; \ + $(MAKE_PACKAGE)) + mv -f '$(DIST)/l10n-stage/$(PACKAGE)' '$(WIN32_INSTALLER_OUT)' + if test -f '$(DIST)/l10n-stage/$(PACKAGE).asc'; then mv -f '$(DIST)/l10n-stage/$(PACKAGE).asc' '$(WIN32_INSTALLER_OUT).asc'; fi +ifdef MOZ_STUB_INSTALLER + $(RM) '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe' + cp ../installer/windows/l10ngen/stub.exe '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe' + chmod 0755 '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe' +endif + langpack: langpack-$(AB_CD) @@ -122,7 +141,7 @@ installers-%: @$(MAKE) package-langpack-$* @$(MAKE) repackage-zip-$* ifeq (WINNT,$(OS_ARCH)) - @$(MAKE) package-win32-installer AB_CD=$* + @$(MAKE) package-win32-installer AB_CD=$* MOZ_PKG_FORMAT=SFX7Z endif @echo 'repackaging done' diff --git a/build/moz-automation.mk b/build/moz-automation.mk index 91cd97c310ab..555147785121 100644 --- a/build/moz-automation.mk +++ b/build/moz-automation.mk @@ -28,6 +28,7 @@ endif # corresponding the make target tier_MOZ_AUTOMATION_BUILD_SYMBOLS = buildsymbols tier_MOZ_AUTOMATION_L10N_CHECK = l10n-check +tier_MOZ_AUTOMATION_INSTALLER = installer tier_MOZ_AUTOMATION_PACKAGE = package tier_MOZ_AUTOMATION_PACKAGE_TESTS = package-tests tier_MOZ_AUTOMATION_UPDATE_PACKAGING = update-packaging @@ -44,6 +45,7 @@ moz_automation_symbols = \ MOZ_AUTOMATION_BUILD_SYMBOLS \ MOZ_AUTOMATION_UPLOAD_SYMBOLS \ MOZ_AUTOMATION_PACKAGE \ + MOZ_AUTOMATION_INSTALLER \ MOZ_AUTOMATION_UPDATE_PACKAGING \ MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES \ MOZ_AUTOMATION_L10N_CHECK \ @@ -55,15 +57,22 @@ MOZ_AUTOMATION_TIERS := $(foreach sym,$(moz_automation_symbols),$(if $(filter 1, automation/uploadsymbols: automation/buildsymbols automation/update-packaging: automation/package +automation/update-packaging: automation/installer automation/l10n-check: automation/package +automation/l10n-check: automation/installer +automation/upload: automation/installer automation/upload: automation/package automation/upload: automation/package-tests automation/upload: automation/buildsymbols automation/upload: automation/update-packaging automation/upload: automation/package-generated-sources +# The installer and packager all run stage-package, and may conflict +# with each other. +automation/installer: automation/package + automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS)) @echo Automation steps completed. diff --git a/build/mozconfig.automation b/build/mozconfig.automation index 8c101a2f4043..363d40a90aab 100644 --- a/build/mozconfig.automation +++ b/build/mozconfig.automation @@ -13,6 +13,7 @@ mk_add_options "export MOZ_AUTOMATION_BUILD_SYMBOLS=${MOZ_AUTOMATION_BUILD_SYMBO mk_add_options "export MOZ_AUTOMATION_L10N_CHECK=${MOZ_AUTOMATION_L10N_CHECK-1}" mk_add_options "export MOZ_AUTOMATION_PACKAGE=${MOZ_AUTOMATION_PACKAGE-1}" mk_add_options "export MOZ_AUTOMATION_PACKAGE_TESTS=${MOZ_AUTOMATION_PACKAGE_TESTS-1}" +mk_add_options "export MOZ_AUTOMATION_INSTALLER=${MOZ_AUTOMATION_INSTALLER-0}" mk_add_options "export MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-0}" mk_add_options "export MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES=${MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES-1}" mk_add_options "export MOZ_AUTOMATION_UPLOAD=${MOZ_AUTOMATION_UPLOAD-1}" diff --git a/build/mozconfig.win-common b/build/mozconfig.win-common index 75f381a3268d..d9f56a4ae8b6 100644 --- a/build/mozconfig.win-common +++ b/build/mozconfig.win-common @@ -7,5 +7,9 @@ if [ "x$IS_NIGHTLY" = "xyes" ]; then MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1} fi +# Some builds (eg: Mulet) don't want the installer, so only set this if it +# hasn't already been set. +MOZ_AUTOMATION_INSTALLER=${MOZ_AUTOMATION_INSTALLER-1} + TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir} export MAKECAB=$TOOLTOOL_DIR/makecab.exe diff --git a/config/config.mk b/config/config.mk index ae8c8789ecee..1ba0c6255700 100644 --- a/config/config.mk +++ b/config/config.mk @@ -413,6 +413,8 @@ ifdef MOZ_DEBUG JAVAC_FLAGS += -g endif +CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(MOZILLA_DIR)/config/createprecomplete.py) + # MDDEPDIR is the subdirectory where dependency files are stored MDDEPDIR := .deps diff --git a/mobile/android/config/mozconfigs/android-api-16-frontend/nightly b/mobile/android/config/mozconfigs/android-api-16-frontend/nightly index 78e11de64d34..2a7f7927f27f 100644 --- a/mobile/android/config/mozconfigs/android-api-16-frontend/nightly +++ b/mobile/android/config/mozconfigs/android-api-16-frontend/nightly @@ -1,5 +1,6 @@ # Many things aren't appropriate for a frontend-only build. MOZ_AUTOMATION_BUILD_SYMBOLS=0 +MOZ_AUTOMATION_INSTALLER=0 MOZ_AUTOMATION_L10N_CHECK=0 MOZ_AUTOMATION_PACKAGE=0 MOZ_AUTOMATION_PACKAGE_TESTS=0 diff --git a/mobile/android/config/mozconfigs/android-api-16-gradle-dependencies/nightly b/mobile/android/config/mozconfigs/android-api-16-gradle-dependencies/nightly index dcbf1473281e..f1e0429ebfef 100644 --- a/mobile/android/config/mozconfigs/android-api-16-gradle-dependencies/nightly +++ b/mobile/android/config/mozconfigs/android-api-16-gradle-dependencies/nightly @@ -1,5 +1,6 @@ # Many things aren't appropriate for a frontend-only build. MOZ_AUTOMATION_BUILD_SYMBOLS=0 +MOZ_AUTOMATION_INSTALLER=0 MOZ_AUTOMATION_L10N_CHECK=0 MOZ_AUTOMATION_PACKAGE=0 MOZ_AUTOMATION_PACKAGE_TESTS=0 diff --git a/toolkit/locales/l10n.mk b/toolkit/locales/l10n.mk index 053bee8317dd..64bf90761132 100644 --- a/toolkit/locales/l10n.mk +++ b/toolkit/locales/l10n.mk @@ -130,8 +130,6 @@ ifdef MOZ_CRASHREPORTER $(RM) -rf '$(STAGEDIST)'/crashreporter.app endif endif - $(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/helper.exe - cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall $(NSINSTALL) -D $(DIST)/l10n-stage/$(PKG_PATH) (cd $(DIST)/l10n-stage; \ diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk index 84a373690100..ddceb15cbb35 100644 --- a/toolkit/mozapps/installer/packager.mk +++ b/toolkit/mozapps/installer/packager.mk @@ -13,6 +13,20 @@ ifndef PACKAGER_NO_LIBS libs:: make-package 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)/$(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 + export USE_ELF_HACK ELF_HACK_FLAGS # Override the value of OMNIJAR_NAME from config.status with the value @@ -91,11 +105,6 @@ make-package-internal: prepare-package make-sourcestamp-file make-buildinfo-file make-package: FORCE $(MAKE) make-package-internal -ifeq (WINNT,$(OS_ARCH)) -ifeq ($(MOZ_PKG_FORMAT),ZIP) - $(MAKE) -C windows ZIP_IN='$(ABS_DIST)/$(PACKAGE)' installer -endif -endif $(TOUCH) $@ GARBAGE += make-package diff --git a/toolkit/mozapps/installer/windows/nsis/makensis.mk b/toolkit/mozapps/installer/windows/nsis/makensis.mk index 98eb538eff3a..f88547e36bbc 100755 --- a/toolkit/mozapps/installer/windows/nsis/makensis.mk +++ b/toolkit/mozapps/installer/windows/nsis/makensis.mk @@ -48,54 +48,48 @@ $(CONFIG_DIR)/setup.exe:: cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) installer.nsi ifdef MOZ_STUB_INSTALLER cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) stub.nsi +ifdef MOZ_EXTERNAL_SIGNING_FORMAT + $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) $(CONFIG_DIR)/setup-stub.exe +endif + $(MAKE) $(CONFIG_DIR)/7zSD.sfx + cd $(CONFIG_DIR) && $(CYGWIN_WRAPPER) $(7Z) a -t7z $(ABS_CONFIG_DIR)/stub.7z setup-stub.exe -mx -m0=BCJ2 -m1=LZMA:d21 -m2=LZMA:d17 -m3=LZMA:d17 -mb0:1 -mb0s1:2 -mb0s2:3 + cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/stub.tag $(CONFIG_DIR)/stub.7z > "$(CONFIG_DIR)/stub.exe" +ifdef MOZ_EXTERNAL_SIGNING_FORMAT_STUB + $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT_STUB),-f $(f)) $(CONFIG_DIR)/stub.exe +endif +endif +# Support for building the uninstaller when repackaging locales +ifeq ($(CONFIG_DIR),l10ngen) + cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) uninstaller.nsi endif ifdef MOZ_EXTERNAL_SIGNING_FORMAT $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$@" endif -ifdef ZIP_IN -installer:: $(CONFIG_DIR)/setup.exe $(ZIP_IN) - @echo 'Packaging $(WIN32_INSTALLER_OUT).' - $(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)' - $(MOZILLA_DIR)/mach repackage installer \ - -o '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe' \ - --package-name firefox \ - --package '$(ZIP_IN)' \ - --tag $(topsrcdir)/browser/installer/windows/app.tag \ - --setupexe $(CONFIG_DIR)/setup.exe \ - --sfx-stub $(SFX_MODULE) +$(CONFIG_DIR)/7zSD.sfx: + $(CYGWIN_WRAPPER) upx --best -o $(CONFIG_DIR)/7zSD.sfx $(SFX_MODULE) + +installer:: + $(INSTALL) $(CONFIG_DIR)/setup.exe $(DEPTH)/installer-stage + cd $(DEPTH)/installer-stage && $(CYGWIN_WRAPPER) $(7Z) a -r -t7z $(ABS_CONFIG_DIR)/app.7z -mx -m0=BCJ2 -m1=LZMA:d25 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3 + $(MAKE) $(CONFIG_DIR)/7zSD.sfx + $(NSINSTALL) -D $(DIST)/$(PKG_INST_PATH) + cat $(CONFIG_DIR)/7zSD.sfx $(CONFIG_DIR)/app.tag $(CONFIG_DIR)/app.7z > "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" + chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" +ifdef MOZ_STUB_INSTALLER + cp $(CONFIG_DIR)/stub.exe "$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe" + chmod 0755 "$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe" +endif ifdef MOZ_EXTERNAL_SIGNING_FORMAT $(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" endif -ifdef MOZ_STUB_INSTALLER - $(MOZILLA_DIR)/mach repackage installer \ - -o '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe' \ - --tag $(topsrcdir)/browser/installer/windows/stub.tag \ - --setupexe $(CONFIG_DIR)/setup-stub.exe \ - --sfx-stub $(SFX_MODULE) -endif -else -installer:: - $(error ZIP_IN must be set when building installer) -endif # For building the uninstaller during the application build so it can be # included for mar file generation. -$(CONFIG_DIR)/helper.exe: - $(RM) -r $(CONFIG_DIR) - $(MKDIR) $(CONFIG_DIR) - $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR) - $(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR) - $(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \ - $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi) - $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \ - --preprocess-locale $(topsrcdir) \ - $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR) +uninstaller:: $(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR) $(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR) cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) uninstaller.nsi - -uninstaller:: $(CONFIG_DIR)/helper.exe $(NSINSTALL) -D $(DIST)/bin/uninstall cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall