Bug 1184446 - Remove manual package manifest preprocessing. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 15 Jul 2015 16:31:53 +0900
changeset 253405 cdedf354856914186013058cab574a5f2db7f15d
parent 253404 5a04fa687d3854c266d98cba3ce86d69f9707371
child 253406 fb262fae5d1387503747e60759469acfe10915ec
push id29065
push userryanvm@gmail.com
push dateFri, 17 Jul 2015 14:26:32 +0000
treeherdermozilla-central@911935404233 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1184446
milestone42.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 1184446 - Remove manual package manifest preprocessing. r=mshal packager.py itself has been able to do preprocessing since the beginning. For some reason, Makefile.in-driven preprocessing was kept back then, and never was removed, and even worse, concatenation was added on top of it. There is however a downside to the current way of doing things: error reporting is given relative to the given manifest, which in the current case is the preprocessed/concatenated file, so line numbers don't match what is in the file in the source tree. However, when packager.py does preprocessing itself, line numbers are reported properly. Thus, switch all package manifests to packager.py-driven preprocessing.
b2g/installer/Makefile.in
b2g/installer/package-manifest.in
browser/installer/Makefile.in
browser/installer/package-manifest.in
mobile/android/installer/Makefile.in
mobile/android/installer/package-manifest.in
toolkit/mozapps/installer/packager.mk
--- a/b2g/installer/Makefile.in
+++ b/b2g/installer/Makefile.in
@@ -3,17 +3,23 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 STANDALONE_MAKEFILE := 1
 
 include $(topsrcdir)/config/rules.mk
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
-MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
+MOZ_PKG_MANIFEST = $(srcdir)/package-manifest.in
+
+ifdef MOZ_CHROME_MULTILOCALE
+MOZ_PKG_MANIFEST_DEPS = locale-manifest.in
+
+DEFINES += -DPKG_LOCALE_MANIFEST=$(CURDIR)/locale-manifest.in
+endif
 
 DEFINES += \
 	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
 	-DPREF_DIR=$(PREF_DIR) \
 	$(NULL)
 
 DEFINES += -DJAREXT=
 
@@ -37,20 +43,16 @@ endif
 ifdef MOZ_DEBUG
 DEFINES += -DMOZ_DEBUG=1
 endif
 
 ifdef ENABLE_MARIONETTE
 DEFINES += -DENABLE_MARIONETTE=1
 endif
 
-ifdef MOZ_PKG_MANIFEST_P
-MOZ_PKG_MANIFEST = package-manifest
-endif
-
 MOZ_PACKAGER_MINIFY=1
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 ifndef _APPNAME
 _APPNAME = $(MOZ_MACBUNDLE_NAME)
 endif
 ifndef _BINPATH
 _BINPATH = /$(_APPNAME)/Contents/MacOS
@@ -102,29 +104,26 @@ endif
 
 ifdef MOZ_WIDGET_GTK
 DEFINES += -DMOZ_GTK=1
 ifdef MOZ_ENABLE_GTK3
 DEFINES += -DMOZ_GTK3=1
 endif
 endif
 
-ifdef MOZ_PKG_MANIFEST_P
-$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) FORCE
-	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@)
 ifdef MOZ_CHROME_MULTILOCALE
-	printf '\n[multilocale]\n' >> $@
+locale-manifest.in: $(GLOBAL_DEPS) FORCE
+	printf '\n[multilocale]\n' > $@
 	for LOCALE in $(MOZ_CHROME_MULTILOCALE) ;\
 	do \
 	  printf '$(BINPATH)/chrome/'"$$LOCALE"'$(JAREXT)\n' >> $@; \
 	  printf '$(BINPATH)/chrome/'"$$LOCALE"'.manifest\n' >> $@; \
 	done
-endif
 
-GARBAGE += $(MOZ_PKG_MANIFEST)
+GARBAGE += locale-manifest.in
 endif
 
 ifdef FXOS_SIMULATOR
 export MAKE
 
 .PHONY: simulator
 simulator: make-package
 	@echo 'Building simulator addon...'
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -975,8 +975,12 @@ bin/libfreebl_32int64_3.so
 @RESPATH@/fonts/*
 #endif
 
 ; media
 #ifdef MOZ_EME
 @RESPATH@/gmp-clearkey/0.1/@DLL_PREFIX@clearkey@DLL_SUFFIX@
 @RESPATH@/gmp-clearkey/0.1/clearkey.info
 #endif
+
+#ifdef PKG_LOCALE_MANIFEST
+#include @PKG_LOCALE_MANIFEST@
+#endif
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -4,25 +4,23 @@
 
 STANDALONE_MAKEFILE := 1
 DIST_SUBDIR := browser
 
 include $(topsrcdir)/config/rules.mk
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
-MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
-
-ifdef MOZ_MULET
-MOZ_PKG_MANIFEST_P += $(topsrcdir)/b2g/installer/package-manifest.in
-endif
+MOZ_PKG_MANIFEST = $(srcdir)/package-manifest.in
 
 # Some files have been already bundled with xulrunner
 ifndef MOZ_MULET
 MOZ_PKG_FATAL_WARNINGS = 1
+else
+DEFINES += -DMOZ_MULET
 endif
 
 DEFINES += -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
 
 ifdef LIBXUL_SDK
 DEFINES += -DLIBXUL_SDK=1
 endif
 
@@ -93,25 +91,16 @@ endif
 ifdef GKMEDIAS_SHARED_LIBRARY
 DEFINES += -DGKMEDIAS_SHARED_LIBRARY
 endif
 
 ifdef MAKENSISU
 DEFINES += -DHAVE_MAKENSISU=1
 endif
 
-ifdef MOZ_PKG_MANIFEST_P
-MOZ_PKG_MANIFEST = package-manifest
-
-$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS)
-	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $(MOZ_PKG_MANIFEST_P) -o $@)
-
-GARBAGE += $(MOZ_PKG_MANIFEST)
-endif
-
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 MOZ_PKG_MAC_DSSTORE=branding/dsstore
 MOZ_PKG_MAC_BACKGROUND=branding/background.png
 MOZ_PKG_MAC_ICON=branding/disk.icns
 MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
 endif
 
 ifndef LIBXUL_SDK
@@ -175,23 +164,21 @@ else
 PKGCOMP_FIND_OPTS = -L
 endif
 ifeq (Darwin, $(OS_ARCH))
 FINDPATH = $(_APPNAME)/Contents/MacOS
 else
 FINDPATH=bin
 endif
 
-package-compare:: $(MOZ_PKG_MANIFEST)
-ifdef MOZ_PKG_MANIFEST_P
+package-compare::
 	cd $(DIST); find $(PKGCOMP_FIND_OPTS) $(FINDPATH) -type f | sort > bin-list.txt
-	grep '^$(BINPATH)' $(MOZ_PKG_MANIFEST) | sed -e 's/^\///' | sort > $(DIST)/pack-list.txt
+	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $(MOZ_PKG_MANIFEST)) | grep '^$(BINPATH)' | sed -e 's/^\///' | sort > $(DIST)/pack-list.txt
 	-diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 	rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt
-endif
 
 installer::
 ifdef INSTALLER_DIR
 	$(MAKE) -C $(INSTALLER_DIR)
 endif
 
 ifdef ENABLE_MARIONETTE
 DEFINES += -DENABLE_MARIONETTE=1
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -912,8 +912,12 @@ bin/libfreebl_32int64_3.so
 @RESPATH@/gmp-clearkey/0.1/clearkey.info
 #endif
 
 ; gfx
 #ifdef XP_WIN
 @RESPATH@/components/GfxSanityTest.manifest
 @RESPATH@/components/SanityTest.js
 #endif
+
+#ifdef MOZ_MULET
+#include ../../b2g/installer/package-manifest.in
+#endif
--- a/mobile/android/installer/Makefile.in
+++ b/mobile/android/installer/Makefile.in
@@ -11,35 +11,37 @@ L10N_PREF_JS_EXPORTS_PATH = $(FINAL_TARG
 L10N_PREF_JS_EXPORTS_FLAGS = $(PREF_PPFLAGS) --silence-missing-directive-warnings
 PP_TARGETS += L10N_PREF_JS_EXPORTS
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
-MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
+MOZ_PKG_MANIFEST = $(srcdir)/package-manifest.in
+
+ifdef MOZ_CHROME_MULTILOCALE
+MOZ_PKG_MANIFEST_DEPS = locale-manifest.in
+
+DEFINES += -DPKG_LOCALE_MANIFEST=$(CURDIR)/locale-manifest.in
+endif
 
 DEFINES += \
   -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
   -DPREF_DIR=$(PREF_DIR) \
   -DJAREXT= \
   -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME) \
   -DMOZ_CHILD_PROCESS_NAME_PIE=$(MOZ_CHILD_PROCESS_NAME_PIE) \
   -DANDROID_CPU_ARCH=$(ANDROID_CPU_ARCH) \
   $(NULL)
 
 ifdef MOZ_DEBUG
 DEFINES += -DMOZ_DEBUG=1
 endif
 
-ifdef MOZ_PKG_MANIFEST_P
-MOZ_PKG_MANIFEST = package-manifest
-endif
-
 MOZ_PACKAGER_MINIFY=1
 
 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
 
 # Note that JS_BINARY can be defined in packager.mk, so this test must come
 # after including that file. MOZ_PACKAGER_MINIFY_JS is used in packager.mk, but
 # since recipe evaluation is deferred, we can set it here after the inclusion.
 ifneq (,$(JS_BINARY))
@@ -58,29 +60,26 @@ else
 BINPATH = bin
 endif
 DEFINES += -DBINPATH=$(BINPATH)
 
 ifdef ENABLE_MARIONETTE
 DEFINES += -DENABLE_MARIONETTE=1
 endif
 
-ifdef MOZ_PKG_MANIFEST_P
+
+ifdef MOZ_CHROME_MULTILOCALE
 # When MOZ_CHROME_MULTILOCALE is defined, we write multilocale.json like:
 # {"locales": ["en-US", "de", "ar", ...]}
-
-$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS) FORCE
-	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@)
-ifdef MOZ_CHROME_MULTILOCALE
-	printf '\n[multilocale]\n' >> $@
+locale-manifest.in: $(GLOBAL_DEPS) FORCE
+	printf '\n[multilocale]\n' > $@
 	printf '@BINPATH@/res/multilocale.json\n' >> $@
 	for LOCALE in en-US $(MOZ_CHROME_MULTILOCALE) ;\
 	do \
 	  printf '$(BINPATH)/chrome/'"$$LOCALE"'$(JAREXT)\n' >> $@; \
 	  printf '$(BINPATH)/chrome/'"$$LOCALE"'.manifest\n' >> $@; \
 	done
 	COMMA=,
 	echo '{"locales": [$(foreach l,$(MOZ_CHROME_MULTILOCALE),"$(l)"$(COMMA)) "en-US"]}' \
 	  > $(FINAL_TARGET)/res/multilocale.json
+
+GARBAGE += locale-manifest.in
 endif
-
-GARBAGE += $(MOZ_PKG_MANIFEST)
-endif
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -653,8 +653,12 @@ bin/libfreebl_32int64_3.so
 @BINPATH@/components/MarionetteComponents.manifest
 @BINPATH@/components/marionettecomponent.js
 #endif
 
 @BINPATH@/components/WebappsUpdateTimer.js
 @BINPATH@/components/DataStore.manifest
 @BINPATH@/components/DataStoreImpl.js
 @BINPATH@/components/dom_datastore.xpt
+
+#ifdef PKG_LOCALE_MANIFEST
+#include @PKG_LOCALE_MANIFEST@
+#endif
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -32,17 +32,17 @@ endif
 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
 ELF_HACK_FLAGS = --fill
 endif
 export USE_ELF_HACK ELF_HACK_FLAGS
 
 # Override the value of OMNIJAR_NAME from config.status with the value
 # set earlier in this file.
 
-stage-package: $(MOZ_PKG_MANIFEST)
+stage-package: $(MOZ_PKG_MANIFEST) $(MOZ_PKG_MANIFEST_DEPS)
 	OMNIJAR_NAME=$(OMNIJAR_NAME) \
 	NO_PKG_FILES="$(NO_PKG_FILES)" \
 	$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.py $(DEFINES) \
 		--format $(MOZ_PACKAGER_FORMAT) \
 		$(addprefix --removals ,$(MOZ_PKG_REMOVALS)) \
 		$(if $(filter-out 0,$(MOZ_PKG_FATAL_WARNINGS)),,--ignore-errors) \
 		$(if $(MOZ_PACKAGER_MINIFY),--minify) \
 		$(if $(MOZ_PACKAGER_MINIFY_JS),--minify-js \