Browse Source

backport bug 1240930 and pre-requiistes

Bill Gianopoulos 3 years ago
parent
commit
26eb8c4adc

+ 80 - 0
bug1240930-253/comm/1240930-mail-80a1.patch

@@ -0,0 +1,80 @@
+# HG changeset patch
+# User Geoff Lankow <geoff@darktrojan.net>
+# Date 1593577763 -43200
+# Node ID 8b55e4dbec550ee94581636afcb8661a82200f92
+# Parent  926e7403d2a87e3bd461a02a0594aca7dab92980
+Port bug 1240930 - Rename the libs-% targets for l10n repacks to l10n-%. rs=bustage-fix
+
+diff --git a/mail/locales/Makefile.in b/mail/locales/Makefile.in
+--- a/mail/locales/Makefile.in
++++ b/mail/locales/Makefile.in
+@@ -13,17 +13,17 @@ EN_US_OR_L10N_FILE = $(firstword \
+ 	$(wildcard $(srcdir)/en-US/$(1)) \
+ 	$(LOCALE_SRCDIR)/$(1) )
+ 
+ SUBMAKEFILES += \
+ 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
+ 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
+ 	$(NULL)
+ 
+-# This makefile uses variable overrides from the libs-% target to
++# This makefile uses variable overrides from the l10n-% target to
+ # build non-default locales to non-default dist/ locations. Be aware!
+ 
+ PWD := $(CURDIR)
+ 
+ # These are defaulted to be compatible with the files the wget-en-US target
+ # pulls. You may override them if you provide your own files.
+ ZIP_IN ?= $(ABS_DIST)/$(PACKAGE)
+ 
+@@ -57,45 +57,45 @@ DIST_SUBDIRS = $(DIST_SUBDIR)
+ include $(moztopsrcdir)/config/rules.mk
+ 
+ ifeq ($(commreltopsrcdir),comm)
+ COMPARE_LOCALES_DEFINES += -Dmozilla=..
+ endif
+ 
+ include $(moztopsrcdir)/toolkit/locales/l10n.mk
+ 
+-libs-%: AB_CD=$*
+-libs-%:
++l10n-%: AB_CD=$*
++l10n-%:
+ # merge if we're not en-US. Conditional function because
+ # we need the current value of AB_CD.
+ 	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
+ 	$(NSINSTALL) -D $(DIST)/install
+-	@$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*  XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
++	@$(MAKE) -C $(DEPTH)/toolkit/locales l10n-$*  XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C $(DEPTH)/devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C ../../chat/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C ../../calendar/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+-	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
++	@$(MAKE) l10n AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
+ 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
+ 
+ 
+ package-win32-installer: $(SUBMAKEFILES)
+ 	$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
+ 
+ langpack: langpack-$(AB_CD)
+ 
+ # This is a generic target that will make a langpack, repack ZIP (+tarball)
+ # builds, and repack an installer if applicable. It is called from the
+ # tinderbox scripts. Alter it with caution.
+ 
+ installers-%: IS_LANGUAGE_REPACK=1
+ installers-%:
+ 	@$(MAKE) clobber-$*
+-	@$(MAKE) libs-$*
++	@$(MAKE) l10n-$*
+ 	@$(MAKE) package-langpack-$*
+ 	@$(MAKE) repackage-zip-$*
+ ifeq (WINNT,$(OS_ARCH))
+ 	@$(MAKE) package-win32-installer AB_CD=$*
+ endif
+ 	@echo 'repackaging done'
+ 
+ ifdef MOZ_UPDATER

+ 176 - 0
bug1240930-253/comm/1468240-port-1437942-mail-62a1.patch

@@ -0,0 +1,176 @@
+# HG changeset patch
+# User Michael Kaply <mozilla@kaply.com>
+# Date 1528922179 25200
+# Node ID 33551f4516d03c52f67cf624ee8ece12352342df
+# Parent  d1aa683d0a16f58f19400a87c3ef2fa6e73ea690
+Bug 1468240 - Move searchplugins to mail directory. rs=jorgk DONTBUILD
+
+diff --git a/mail/components/search/jar.mn b/mail/components/search/jar.mn
+new file mode 100644
+--- /dev/null
++++ b/mail/components/search/jar.mn
+@@ -0,0 +1,8 @@
++# 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/.
++
++messenger.jar:
++        searchplugins/                                              (searchplugins/**)
++
++% resource search-plugins %searchplugins/
+diff --git a/mail/components/search/moz.build b/mail/components/search/moz.build
+--- a/mail/components/search/moz.build
++++ b/mail/components/search/moz.build
+@@ -12,8 +12,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
+     EXTRA_PP_JS_MODULES += ['WinSearchIntegration.js']
+     FINAL_LIBRARY = 'mailcomps'
+ 
+ DIRS += ['public']
+ 
+ EXTRA_PP_JS_MODULES += [
+     'SearchIntegration.js',
+ ]
++
++JAR_MANIFESTS += ['jar.mn']
+diff --git a/mail/locales/en-US/searchplugins/bing.xml b/mail/components/search/searchplugins/bing.xml
+rename from mail/locales/en-US/searchplugins/bing.xml
+rename to mail/components/search/searchplugins/bing.xml
+diff --git a/mail/locales/en-US/searchplugins/google.xml b/mail/components/search/searchplugins/google.xml
+rename from mail/locales/en-US/searchplugins/google.xml
+rename to mail/components/search/searchplugins/google.xml
+diff --git a/mail/locales/search/list.json b/mail/components/search/searchplugins/list.json
+rename from mail/locales/search/list.json
+rename to mail/components/search/searchplugins/list.json
+diff --git a/mail/locales/en-US/searchplugins/twitter.xml b/mail/components/search/searchplugins/twitter.xml
+rename from mail/locales/en-US/searchplugins/twitter.xml
+rename to mail/components/search/searchplugins/twitter.xml
+diff --git a/mail/locales/en-US/searchplugins/wikipedia.xml b/mail/components/search/searchplugins/wikipedia.xml
+rename from mail/locales/en-US/searchplugins/wikipedia.xml
+rename to mail/components/search/searchplugins/wikipedia.xml
+diff --git a/mail/locales/en-US/searchplugins/yahoo.xml b/mail/components/search/searchplugins/yahoo.xml
+rename from mail/locales/en-US/searchplugins/yahoo.xml
+rename to mail/components/search/searchplugins/yahoo.xml
+diff --git a/mail/locales/en-US/searchplugins/amazondotcom.xml b/mail/components/search/searchplugins/amazondotcom.xml
+rename from mail/locales/en-US/searchplugins/amazondotcom.xml
+rename to mail/components/search/searchplugins/amazondotcom.xml
+diff --git a/mail/locales/en-US/searchplugins/ddg.xml b/mail/components/search/searchplugins/ddg.xml
+rename from mail/locales/en-US/searchplugins/ddg.xml
+rename to mail/components/search/searchplugins/ddg.xml
+diff --git a/mail/locales/Makefile.in b/mail/locales/Makefile.in
+--- a/mail/locales/Makefile.in
++++ b/mail/locales/Makefile.in
+@@ -45,59 +45,40 @@ MOZ_PKG_MAC_ICON=$(ABS_DIST)/branding/di
+ MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
+ endif
+ 
+ MOZ_SFX_PACKAGE=$(commtopsrcdir)/other-licenses/7zstub/thunderbird/7zSD.sfx
+ MOZ_INSTALLER_PATH=$(commtopsrcdir)/mail/installer/windows
+ 
+ NON_OMNIJAR_FILES = defaults/messenger/mailViews.dat
+ 
+-SEARCHPLUGINS_FILENAMES := $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD)))
+-SEARCHPLUGINS_PATH := .deps/generated_$(AB_CD)
+-SEARCHPLUGINS_TARGET := libs searchplugins
+-SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_FILENAMES)),$(or $(wildcard $(call EN_US_OR_L10N_FILE,searchplugins/$(plugin))),$(warning Missing searchplugin: $(plugin))))
+-# Some locale-specific search plugins may have preprocessor directives, but the
+-# default en-US ones do not.
+-SEARCHPLUGINS_FLAGS := --silence-missing-directive-warnings
+-PP_TARGETS += SEARCHPLUGINS
+-
+-list-json = $(SEARCHPLUGINS_PATH)/list.json
+-GARBAGE += $(list-json)
+-
+-libs:: searchplugins
+-
+ # Required for l10n.mk - defines a list of app sub dirs that should
+ # be included in langpack xpis.
+ DIST_SUBDIRS = $(DIST_SUBDIR)
+ 
+ include $(moztopsrcdir)/config/rules.mk
+ 
+ ifeq ($(commreltopsrcdir),comm)
+ COMPARE_LOCALES_DEFINES += -Dmozilla=..
+ endif
+ 
+ include $(moztopsrcdir)/toolkit/locales/l10n.mk
+ 
+-$(list-json): $(call mkdir_deps,$(SEARCHPLUGINS_PATH)) $(if $(IS_LANGUAGE_REPACK),FORCE)
+-	$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(list-json))
+-searchplugins:: $(list-json)
+-
+ libs-%: AB_CD=$*
+ libs-%:
+ # merge if we're not en-US. Conditional function because
+ # we need the current value of AB_CD.
+ 	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
+ 	$(NSINSTALL) -D $(DIST)/install
+ 	@$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*  XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C $(DEPTH)/devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C ../../chat/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C ../../calendar/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+-	@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
+ 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
+ 
+ 
+ package-win32-installer: $(SUBMAKEFILES)
+ 	$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
+ 
+ langpack: langpack-$(AB_CD)
+diff --git a/mail/locales/filter.py b/mail/locales/filter.py
+--- a/mail/locales/filter.py
++++ b/mail/locales/filter.py
+@@ -16,12 +16,9 @@ def test(mod, path, entity=None):
+   if mod == "extensions/spellcheck":
+     return "ignore"
+ 
+   if path == "chrome/messenger-region/region.properties":
+     return ("ignore" if (re.match(r"browser\.search\.order\.[1-9]", entity) or
+                          re.match(r"mail\.addr_book\.mapit_url\.[1-5]", entity))
+             else "error")
+ 
+-  # ignore search plugins
+-  if re.match(r"searchplugins\/.+\.xml", path):
+-    return "ignore"
+   return "error"
+diff --git a/mail/locales/jar.mn b/mail/locales/jar.mn
+--- a/mail/locales/jar.mn
++++ b/mail/locales/jar.mn
+@@ -225,18 +225,16 @@
+   locale/@AB_CD@/messenger/downloadsOverlay.dtd                         (%chrome/messenger/downloadsOverlay.dtd)
+   locale/@AB_CD@/messenger/chat.dtd                                     (%chrome/messenger/chat.dtd)
+   locale/@AB_CD@/messenger/chat.properties                              (%chrome/messenger/chat.properties)
+   locale/@AB_CD@/messenger/addbuddy.dtd                                 (%chrome/messenger/addbuddy.dtd)
+   locale/@AB_CD@/messenger/joinChat.dtd                                 (%chrome/messenger/joinChat.dtd)
+   locale/@AB_CD@/messenger/imAccounts.properties                        (%chrome/messenger/imAccounts.properties)
+   locale/@AB_CD@/messenger/imAccountWizard.dtd                          (%chrome/messenger/imAccountWizard.dtd)
+   locale/@AB_CD@/messenger/sanitize.dtd									(%chrome/messenger/sanitize.dtd)
+-  locale/@AB_CD@/messenger/searchplugins/list.json                      (.deps/generated_@AB_CD@/list.json)
+-  locale/@AB_CD@/messenger/searchplugins/                               (.deps/generated_@AB_CD@/*.xml)
+ % locale messenger-mapi @AB_CD@ %locale/@AB_CD@/messenger-mapi/
+   locale/@AB_CD@/messenger-mapi/mapi.properties                         (%chrome/messenger-mapi/mapi.properties)
+ % locale messenger-newsblog @AB_CD@ %locale/@AB_CD@/messenger-newsblog/
+   locale/@AB_CD@/messenger-newsblog/newsblog.properties                 (%chrome/messenger-newsblog/newsblog.properties)
+   locale/@AB_CD@/messenger-newsblog/feed-subscriptions.dtd              (%chrome/messenger-newsblog/feed-subscriptions.dtd)
+   locale/@AB_CD@/messenger-newsblog/am-newsblog.dtd                     (%chrome/messenger-newsblog/am-newsblog.dtd)
+ % locale messenger-smime @AB_CD@ %locale/@AB_CD@/messenger-smime/
+   locale/@AB_CD@/messenger-smime/msgCompSMIMEOverlay.dtd                (%chrome/messenger-smime/msgCompSMIMEOverlay.dtd)
+diff --git a/mail/locales/l10n.toml b/mail/locales/l10n.toml
+--- a/mail/locales/l10n.toml
++++ b/mail/locales/l10n.toml
+@@ -125,13 +125,8 @@ locales = [
+     key = "re:browser\\.search\\.order\\.[1-9].*"
+     action = "ignore"
+ 
+ # map service prefs don't have the same number for all locales
+ [[filters]]
+     path = "{l}mail/chrome/messenger-region/region.properties"
+     key = "re:mail\\.addr_book\\.mapit_url\\.[1-5].*"
+     action = "ignore"
+-
+-# search plugins are different per locale, ignore file difference
+-[[filters]]
+-    path = "{l}mail/searchplugins/*.xml"
+-    action = "ignore"

+ 469 - 0
bug1240930-253/comm/1639866-1-port-1437942-suite-277.patch

@@ -0,0 +1,469 @@
+# HG changeset patch
+# User Frank-Rainer Grahl <frgrahl@gmx.net>
+# Date 1590066890 -7200
+# Node ID 52cfcb2c361f894dc017fe316d3fa33ff01074ab
+# Parent  e8897a3e653176cf1764c3c6a9756c1b052b8b79
+Bug 1639866 - Part 1: Port Bug 1437942 "Remove search engines from langpacks" to SeaMonkey. r=IanN
+Packaging updates.
+
+diff --git a/suite/components/search/jar.mn b/suite/components/search/jar.mn
+--- a/suite/components/search/jar.mn
++++ b/suite/components/search/jar.mn
+@@ -6,10 +6,11 @@ comm.jar:
+ % content communicator %content/communicator/ contentaccessible=yes
+    content/communicator/search/engineManager.js                     (content/engineManager.js)
+    content/communicator/search/engineManager.xul                    (content/engineManager.xul)
+    content/communicator/search/search.xml                           (content/search.xml)
+    content/communicator/search/searchbarBindings.css                (content/searchbarBindings.css)
+    content/communicator/search/search-panel.js                      (content/search-panel.js)
+    content/communicator/search/search-panel.xul                     (content/search-panel.xul)
+ 
+-# L10n resource overrides
+-% resource search-plugins chrome://communicator/locale/searchplugins/
++   searchplugins/                                                   (searchplugins/**)
++
++% resource search-plugins %searchplugins/
+diff --git a/suite/locales/searchplugins/allegro-pl.xml b/suite/components/search/searchplugins/allegro-pl.xml
+rename from suite/locales/searchplugins/allegro-pl.xml
+rename to suite/components/search/searchplugins/allegro-pl.xml
+diff --git a/suite/locales/searchplugins/amazon-br.xml b/suite/components/search/searchplugins/amazon-br.xml
+rename from suite/locales/searchplugins/amazon-br.xml
+rename to suite/components/search/searchplugins/amazon-br.xml
+diff --git a/suite/locales/searchplugins/amazon-de.xml b/suite/components/search/searchplugins/amazon-de.xml
+rename from suite/locales/searchplugins/amazon-de.xml
+rename to suite/components/search/searchplugins/amazon-de.xml
+diff --git a/suite/locales/searchplugins/amazon-en-GB.xml b/suite/components/search/searchplugins/amazon-en-GB.xml
+rename from suite/locales/searchplugins/amazon-en-GB.xml
+rename to suite/components/search/searchplugins/amazon-en-GB.xml
+diff --git a/suite/locales/searchplugins/amazon-es.xml b/suite/components/search/searchplugins/amazon-es.xml
+rename from suite/locales/searchplugins/amazon-es.xml
+rename to suite/components/search/searchplugins/amazon-es.xml
+diff --git a/suite/locales/searchplugins/amazon-fr.xml b/suite/components/search/searchplugins/amazon-fr.xml
+rename from suite/locales/searchplugins/amazon-fr.xml
+rename to suite/components/search/searchplugins/amazon-fr.xml
+diff --git a/suite/locales/searchplugins/amazon-it.xml b/suite/components/search/searchplugins/amazon-it.xml
+rename from suite/locales/searchplugins/amazon-it.xml
+rename to suite/components/search/searchplugins/amazon-it.xml
+diff --git a/suite/locales/searchplugins/amazon-jp.xml b/suite/components/search/searchplugins/amazon-jp.xml
+rename from suite/locales/searchplugins/amazon-jp.xml
+rename to suite/components/search/searchplugins/amazon-jp.xml
+diff --git a/suite/locales/searchplugins/amazon-zh-CN.xml b/suite/components/search/searchplugins/amazon-zh-CN.xml
+rename from suite/locales/searchplugins/amazon-zh-CN.xml
+rename to suite/components/search/searchplugins/amazon-zh-CN.xml
+diff --git a/suite/locales/searchplugins/amazon.xml b/suite/components/search/searchplugins/amazon.xml
+rename from suite/locales/searchplugins/amazon.xml
+rename to suite/components/search/searchplugins/amazon.xml
+diff --git a/suite/locales/searchplugins/atlas-sk.xml b/suite/components/search/searchplugins/atlas-sk.xml
+rename from suite/locales/searchplugins/atlas-sk.xml
+rename to suite/components/search/searchplugins/atlas-sk.xml
+diff --git a/suite/locales/searchplugins/azet-sk.xml b/suite/components/search/searchplugins/azet-sk.xml
+rename from suite/locales/searchplugins/azet-sk.xml
+rename to suite/components/search/searchplugins/azet-sk.xml
+diff --git a/suite/locales/searchplugins/bing.xml b/suite/components/search/searchplugins/bing.xml
+rename from suite/locales/searchplugins/bing.xml
+rename to suite/components/search/searchplugins/bing.xml
+diff --git a/suite/locales/searchplugins/bolcom-nl.xml b/suite/components/search/searchplugins/bolcom-nl.xml
+rename from suite/locales/searchplugins/bolcom-nl.xml
+rename to suite/components/search/searchplugins/bolcom-nl.xml
+diff --git a/suite/locales/searchplugins/chambers-en-GB.xml b/suite/components/search/searchplugins/chambers-en-GB.xml
+rename from suite/locales/searchplugins/chambers-en-GB.xml
+rename to suite/components/search/searchplugins/chambers-en-GB.xml
+diff --git a/suite/locales/searchplugins/cnrtl-tlfi-fr.xml b/suite/components/search/searchplugins/cnrtl-tlfi-fr.xml
+rename from suite/locales/searchplugins/cnrtl-tlfi-fr.xml
+rename to suite/components/search/searchplugins/cnrtl-tlfi-fr.xml
+diff --git a/suite/locales/searchplugins/drae.xml b/suite/components/search/searchplugins/drae.xml
+rename from suite/locales/searchplugins/drae.xml
+rename to suite/components/search/searchplugins/drae.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-cs-CZ.xml b/suite/components/search/searchplugins/duckduckgo-cs-CZ.xml
+rename from suite/locales/searchplugins/duckduckgo-cs-CZ.xml
+rename to suite/components/search/searchplugins/duckduckgo-cs-CZ.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-de-DE.xml b/suite/components/search/searchplugins/duckduckgo-de-DE.xml
+rename from suite/locales/searchplugins/duckduckgo-de-DE.xml
+rename to suite/components/search/searchplugins/duckduckgo-de-DE.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-el-GR.xml b/suite/components/search/searchplugins/duckduckgo-el-GR.xml
+rename from suite/locales/searchplugins/duckduckgo-el-GR.xml
+rename to suite/components/search/searchplugins/duckduckgo-el-GR.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-en-GB.xml b/suite/components/search/searchplugins/duckduckgo-en-GB.xml
+rename from suite/locales/searchplugins/duckduckgo-en-GB.xml
+rename to suite/components/search/searchplugins/duckduckgo-en-GB.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-en-US.xml b/suite/components/search/searchplugins/duckduckgo-en-US.xml
+rename from suite/locales/searchplugins/duckduckgo-en-US.xml
+rename to suite/components/search/searchplugins/duckduckgo-en-US.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-es-AR.xml b/suite/components/search/searchplugins/duckduckgo-es-AR.xml
+rename from suite/locales/searchplugins/duckduckgo-es-AR.xml
+rename to suite/components/search/searchplugins/duckduckgo-es-AR.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-es-ES.xml b/suite/components/search/searchplugins/duckduckgo-es-ES.xml
+rename from suite/locales/searchplugins/duckduckgo-es-ES.xml
+rename to suite/components/search/searchplugins/duckduckgo-es-ES.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-fi-FI.xml b/suite/components/search/searchplugins/duckduckgo-fi-FI.xml
+rename from suite/locales/searchplugins/duckduckgo-fi-FI.xml
+rename to suite/components/search/searchplugins/duckduckgo-fi-FI.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-fr-FR.xml b/suite/components/search/searchplugins/duckduckgo-fr-FR.xml
+rename from suite/locales/searchplugins/duckduckgo-fr-FR.xml
+rename to suite/components/search/searchplugins/duckduckgo-fr-FR.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-hu-HU.xml b/suite/components/search/searchplugins/duckduckgo-hu-HU.xml
+rename from suite/locales/searchplugins/duckduckgo-hu-HU.xml
+rename to suite/components/search/searchplugins/duckduckgo-hu-HU.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-it-IT.xml b/suite/components/search/searchplugins/duckduckgo-it-IT.xml
+rename from suite/locales/searchplugins/duckduckgo-it-IT.xml
+rename to suite/components/search/searchplugins/duckduckgo-it-IT.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-ja-JP.xml b/suite/components/search/searchplugins/duckduckgo-ja-JP.xml
+rename from suite/locales/searchplugins/duckduckgo-ja-JP.xml
+rename to suite/components/search/searchplugins/duckduckgo-ja-JP.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-nb-NO.xml b/suite/components/search/searchplugins/duckduckgo-nb-NO.xml
+rename from suite/locales/searchplugins/duckduckgo-nb-NO.xml
+rename to suite/components/search/searchplugins/duckduckgo-nb-NO.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-nl-NL.xml b/suite/components/search/searchplugins/duckduckgo-nl-NL.xml
+rename from suite/locales/searchplugins/duckduckgo-nl-NL.xml
+rename to suite/components/search/searchplugins/duckduckgo-nl-NL.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-pl-PL.xml b/suite/components/search/searchplugins/duckduckgo-pl-PL.xml
+rename from suite/locales/searchplugins/duckduckgo-pl-PL.xml
+rename to suite/components/search/searchplugins/duckduckgo-pl-PL.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-pt-BR.xml b/suite/components/search/searchplugins/duckduckgo-pt-BR.xml
+rename from suite/locales/searchplugins/duckduckgo-pt-BR.xml
+rename to suite/components/search/searchplugins/duckduckgo-pt-BR.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-pt-PT.xml b/suite/components/search/searchplugins/duckduckgo-pt-PT.xml
+rename from suite/locales/searchplugins/duckduckgo-pt-PT.xml
+rename to suite/components/search/searchplugins/duckduckgo-pt-PT.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-ru-RU.xml b/suite/components/search/searchplugins/duckduckgo-ru-RU.xml
+rename from suite/locales/searchplugins/duckduckgo-ru-RU.xml
+rename to suite/components/search/searchplugins/duckduckgo-ru-RU.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-sk-SK.xml b/suite/components/search/searchplugins/duckduckgo-sk-SK.xml
+rename from suite/locales/searchplugins/duckduckgo-sk-SK.xml
+rename to suite/components/search/searchplugins/duckduckgo-sk-SK.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-sv-SE.xml b/suite/components/search/searchplugins/duckduckgo-sv-SE.xml
+rename from suite/locales/searchplugins/duckduckgo-sv-SE.xml
+rename to suite/components/search/searchplugins/duckduckgo-sv-SE.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-zh-CN.xml b/suite/components/search/searchplugins/duckduckgo-zh-CN.xml
+rename from suite/locales/searchplugins/duckduckgo-zh-CN.xml
+rename to suite/components/search/searchplugins/duckduckgo-zh-CN.xml
+diff --git a/suite/locales/searchplugins/duckduckgo-zh-TW.xml b/suite/components/search/searchplugins/duckduckgo-zh-TW.xml
+rename from suite/locales/searchplugins/duckduckgo-zh-TW.xml
+rename to suite/components/search/searchplugins/duckduckgo-zh-TW.xml
+diff --git a/suite/locales/searchplugins/duckduckgo.xml b/suite/components/search/searchplugins/duckduckgo.xml
+rename from suite/locales/searchplugins/duckduckgo.xml
+rename to suite/components/search/searchplugins/duckduckgo.xml
+diff --git a/suite/locales/searchplugins/ebay-de.xml b/suite/components/search/searchplugins/ebay-de.xml
+rename from suite/locales/searchplugins/ebay-de.xml
+rename to suite/components/search/searchplugins/ebay-de.xml
+diff --git a/suite/locales/searchplugins/ebay-en-GB.xml b/suite/components/search/searchplugins/ebay-en-GB.xml
+rename from suite/locales/searchplugins/ebay-en-GB.xml
+rename to suite/components/search/searchplugins/ebay-en-GB.xml
+diff --git a/suite/locales/searchplugins/ebay-es.xml b/suite/components/search/searchplugins/ebay-es.xml
+rename from suite/locales/searchplugins/ebay-es.xml
+rename to suite/components/search/searchplugins/ebay-es.xml
+diff --git a/suite/locales/searchplugins/ebay-fr.xml b/suite/components/search/searchplugins/ebay-fr.xml
+rename from suite/locales/searchplugins/ebay-fr.xml
+rename to suite/components/search/searchplugins/ebay-fr.xml
+diff --git a/suite/locales/searchplugins/ebay-it.xml b/suite/components/search/searchplugins/ebay-it.xml
+rename from suite/locales/searchplugins/ebay-it.xml
+rename to suite/components/search/searchplugins/ebay-it.xml
+diff --git a/suite/locales/searchplugins/ebay-nl.xml b/suite/components/search/searchplugins/ebay-nl.xml
+rename from suite/locales/searchplugins/ebay-nl.xml
+rename to suite/components/search/searchplugins/ebay-nl.xml
+diff --git a/suite/locales/searchplugins/ebay.xml b/suite/components/search/searchplugins/ebay.xml
+rename from suite/locales/searchplugins/ebay.xml
+rename to suite/components/search/searchplugins/ebay.xml
+diff --git a/suite/locales/searchplugins/google-jp.xml b/suite/components/search/searchplugins/google-jp.xml
+rename from suite/locales/searchplugins/google-jp.xml
+rename to suite/components/search/searchplugins/google-jp.xml
+diff --git a/suite/locales/searchplugins/google.xml b/suite/components/search/searchplugins/google.xml
+rename from suite/locales/searchplugins/google.xml
+rename to suite/components/search/searchplugins/google.xml
+diff --git a/suite/locales/searchplugins/heureka-cz.xml b/suite/components/search/searchplugins/heureka-cz.xml
+rename from suite/locales/searchplugins/heureka-cz.xml
+rename to suite/components/search/searchplugins/heureka-cz.xml
+diff --git a/suite/locales/searchplugins/hoepli.xml b/suite/components/search/searchplugins/hoepli.xml
+rename from suite/locales/searchplugins/hoepli.xml
+rename to suite/components/search/searchplugins/hoepli.xml
+diff --git a/suite/locales/searchplugins/huuto-fi.xml b/suite/components/search/searchplugins/huuto-fi.xml
+rename from suite/locales/searchplugins/huuto-fi.xml
+rename to suite/components/search/searchplugins/huuto-fi.xml
+diff --git a/suite/locales/searchplugins/images/amazon.ico b/suite/components/search/searchplugins/images/amazon.ico
+rename from suite/locales/searchplugins/images/amazon.ico
+rename to suite/components/search/searchplugins/images/amazon.ico
+diff --git a/suite/locales/searchplugins/images/duckduckgo.ico b/suite/components/search/searchplugins/images/duckduckgo.ico
+rename from suite/locales/searchplugins/images/duckduckgo.ico
+rename to suite/components/search/searchplugins/images/duckduckgo.ico
+diff --git a/suite/locales/searchplugins/images/ebay.ico b/suite/components/search/searchplugins/images/ebay.ico
+rename from suite/locales/searchplugins/images/ebay.ico
+rename to suite/components/search/searchplugins/images/ebay.ico
+diff --git a/suite/locales/searchplugins/images/google.ico b/suite/components/search/searchplugins/images/google.ico
+rename from suite/locales/searchplugins/images/google.ico
+rename to suite/components/search/searchplugins/images/google.ico
+diff --git a/suite/locales/searchplugins/images/startpage.ico b/suite/components/search/searchplugins/images/startpage.ico
+rename from suite/locales/searchplugins/images/startpage.ico
+rename to suite/components/search/searchplugins/images/startpage.ico
+diff --git a/suite/locales/searchplugins/images/wikipedia.ico b/suite/components/search/searchplugins/images/wikipedia.ico
+rename from suite/locales/searchplugins/images/wikipedia.ico
+rename to suite/components/search/searchplugins/images/wikipedia.ico
+diff --git a/suite/locales/searchplugins/images/yahoo.ico b/suite/components/search/searchplugins/images/yahoo.ico
+rename from suite/locales/searchplugins/images/yahoo.ico
+rename to suite/components/search/searchplugins/images/yahoo.ico
+diff --git a/suite/locales/search/list.json b/suite/components/search/searchplugins/list.json
+rename from suite/locales/search/list.json
+rename to suite/components/search/searchplugins/list.json
+--- a/suite/locales/search/list.json
++++ b/suite/components/search/searchplugins/list.json
+@@ -94,17 +94,17 @@
+       "default": {
+         "searchDefault": "Google",
+         "searchOrder": ["Google", "DuckDuckGo", "Yahoo"],
+         "visibleDefaultEngines": [
+           "amazon-it", "bing", "duckduckgo", "duckduckgo-it-IT", "ebay-it", "google", "hoepli", "startpage", "wikipedia-it", "yahoo-it"
+         ]
+       }
+     },
+-    "ja-JP-mac": {
++    "ja-JP-macos": {
+       "default": {
+         "searchDefault": "Google",
+         "searchOrder": ["Google", "DuckDuckGo", "Yahoo! JAPAN"],
+         "visibleDefaultEngines": [
+           "amazon-jp", "duckduckgo", "duckduckgo-ja-JP", "google-jp", "startpage", "wikipedia-ja", "yahoo-jp"
+         ]
+       }
+     },
+diff --git a/suite/locales/searchplugins/mapy-cz.xml b/suite/components/search/searchplugins/mapy-cz.xml
+rename from suite/locales/searchplugins/mapy-cz.xml
+rename to suite/components/search/searchplugins/mapy-cz.xml
+diff --git a/suite/locales/searchplugins/marktplaats-nl.xml b/suite/components/search/searchplugins/marktplaats-nl.xml
+rename from suite/locales/searchplugins/marktplaats-nl.xml
+rename to suite/components/search/searchplugins/marktplaats-nl.xml
+diff --git a/suite/locales/searchplugins/priberam.xml b/suite/components/search/searchplugins/priberam.xml
+rename from suite/locales/searchplugins/priberam.xml
+rename to suite/components/search/searchplugins/priberam.xml
+diff --git a/suite/locales/searchplugins/prisjakt-sv-SE.xml b/suite/components/search/searchplugins/prisjakt-sv-SE.xml
+rename from suite/locales/searchplugins/prisjakt-sv-SE.xml
+rename to suite/components/search/searchplugins/prisjakt-sv-SE.xml
+diff --git a/suite/locales/searchplugins/pwn-pl.xml b/suite/components/search/searchplugins/pwn-pl.xml
+rename from suite/locales/searchplugins/pwn-pl.xml
+rename to suite/components/search/searchplugins/pwn-pl.xml
+diff --git a/suite/locales/searchplugins/sapo.xml b/suite/components/search/searchplugins/sapo.xml
+rename from suite/locales/searchplugins/sapo.xml
+rename to suite/components/search/searchplugins/sapo.xml
+diff --git a/suite/locales/searchplugins/seznam-cz.xml b/suite/components/search/searchplugins/seznam-cz.xml
+rename from suite/locales/searchplugins/seznam-cz.xml
+rename to suite/components/search/searchplugins/seznam-cz.xml
+diff --git a/suite/locales/searchplugins/startpage-pl.xml b/suite/components/search/searchplugins/startpage-pl.xml
+rename from suite/locales/searchplugins/startpage-pl.xml
+rename to suite/components/search/searchplugins/startpage-pl.xml
+diff --git a/suite/locales/searchplugins/startpage.xml b/suite/components/search/searchplugins/startpage.xml
+rename from suite/locales/searchplugins/startpage.xml
+rename to suite/components/search/searchplugins/startpage.xml
+diff --git a/suite/locales/searchplugins/tyda-sv-SE.xml b/suite/components/search/searchplugins/tyda-sv-SE.xml
+rename from suite/locales/searchplugins/tyda-sv-SE.xml
+rename to suite/components/search/searchplugins/tyda-sv-SE.xml
+diff --git a/suite/locales/searchplugins/vatera.xml b/suite/components/search/searchplugins/vatera.xml
+rename from suite/locales/searchplugins/vatera.xml
+rename to suite/components/search/searchplugins/vatera.xml
+diff --git a/suite/locales/searchplugins/wikipedia-NO.xml b/suite/components/search/searchplugins/wikipedia-NO.xml
+rename from suite/locales/searchplugins/wikipedia-NO.xml
+rename to suite/components/search/searchplugins/wikipedia-NO.xml
+diff --git a/suite/locales/searchplugins/wikipedia-cz.xml b/suite/components/search/searchplugins/wikipedia-cz.xml
+rename from suite/locales/searchplugins/wikipedia-cz.xml
+rename to suite/components/search/searchplugins/wikipedia-cz.xml
+diff --git a/suite/locales/searchplugins/wikipedia-de.xml b/suite/components/search/searchplugins/wikipedia-de.xml
+rename from suite/locales/searchplugins/wikipedia-de.xml
+rename to suite/components/search/searchplugins/wikipedia-de.xml
+diff --git a/suite/locales/searchplugins/wikipedia-el.xml b/suite/components/search/searchplugins/wikipedia-el.xml
+rename from suite/locales/searchplugins/wikipedia-el.xml
+rename to suite/components/search/searchplugins/wikipedia-el.xml
+diff --git a/suite/locales/searchplugins/wikipedia-es.xml b/suite/components/search/searchplugins/wikipedia-es.xml
+rename from suite/locales/searchplugins/wikipedia-es.xml
+rename to suite/components/search/searchplugins/wikipedia-es.xml
+diff --git a/suite/locales/searchplugins/wikipedia-fi.xml b/suite/components/search/searchplugins/wikipedia-fi.xml
+rename from suite/locales/searchplugins/wikipedia-fi.xml
+rename to suite/components/search/searchplugins/wikipedia-fi.xml
+diff --git a/suite/locales/searchplugins/wikipedia-fr.xml b/suite/components/search/searchplugins/wikipedia-fr.xml
+rename from suite/locales/searchplugins/wikipedia-fr.xml
+rename to suite/components/search/searchplugins/wikipedia-fr.xml
+diff --git a/suite/locales/searchplugins/wikipedia-hu.xml b/suite/components/search/searchplugins/wikipedia-hu.xml
+rename from suite/locales/searchplugins/wikipedia-hu.xml
+rename to suite/components/search/searchplugins/wikipedia-hu.xml
+diff --git a/suite/locales/searchplugins/wikipedia-it.xml b/suite/components/search/searchplugins/wikipedia-it.xml
+rename from suite/locales/searchplugins/wikipedia-it.xml
+rename to suite/components/search/searchplugins/wikipedia-it.xml
+diff --git a/suite/locales/searchplugins/wikipedia-ja.xml b/suite/components/search/searchplugins/wikipedia-ja.xml
+rename from suite/locales/searchplugins/wikipedia-ja.xml
+rename to suite/components/search/searchplugins/wikipedia-ja.xml
+diff --git a/suite/locales/searchplugins/wikipedia-ka.xml b/suite/components/search/searchplugins/wikipedia-ka.xml
+rename from suite/locales/searchplugins/wikipedia-ka.xml
+rename to suite/components/search/searchplugins/wikipedia-ka.xml
+diff --git a/suite/locales/searchplugins/wikipedia-nl.xml b/suite/components/search/searchplugins/wikipedia-nl.xml
+rename from suite/locales/searchplugins/wikipedia-nl.xml
+rename to suite/components/search/searchplugins/wikipedia-nl.xml
+diff --git a/suite/locales/searchplugins/wikipedia-pl.xml b/suite/components/search/searchplugins/wikipedia-pl.xml
+rename from suite/locales/searchplugins/wikipedia-pl.xml
+rename to suite/components/search/searchplugins/wikipedia-pl.xml
+diff --git a/suite/locales/searchplugins/wikipedia-pt.xml b/suite/components/search/searchplugins/wikipedia-pt.xml
+rename from suite/locales/searchplugins/wikipedia-pt.xml
+rename to suite/components/search/searchplugins/wikipedia-pt.xml
+diff --git a/suite/locales/searchplugins/wikipedia-ru.xml b/suite/components/search/searchplugins/wikipedia-ru.xml
+rename from suite/locales/searchplugins/wikipedia-ru.xml
+rename to suite/components/search/searchplugins/wikipedia-ru.xml
+diff --git a/suite/locales/searchplugins/wikipedia-sk.xml b/suite/components/search/searchplugins/wikipedia-sk.xml
+rename from suite/locales/searchplugins/wikipedia-sk.xml
+rename to suite/components/search/searchplugins/wikipedia-sk.xml
+diff --git a/suite/locales/searchplugins/wikipedia-sv-SE.xml b/suite/components/search/searchplugins/wikipedia-sv-SE.xml
+rename from suite/locales/searchplugins/wikipedia-sv-SE.xml
+rename to suite/components/search/searchplugins/wikipedia-sv-SE.xml
+diff --git a/suite/locales/searchplugins/wikipedia-zh-CN.xml b/suite/components/search/searchplugins/wikipedia-zh-CN.xml
+rename from suite/locales/searchplugins/wikipedia-zh-CN.xml
+rename to suite/components/search/searchplugins/wikipedia-zh-CN.xml
+diff --git a/suite/locales/searchplugins/wikipedia-zh-TW.xml b/suite/components/search/searchplugins/wikipedia-zh-TW.xml
+rename from suite/locales/searchplugins/wikipedia-zh-TW.xml
+rename to suite/components/search/searchplugins/wikipedia-zh-TW.xml
+diff --git a/suite/locales/searchplugins/wikipedia.xml b/suite/components/search/searchplugins/wikipedia.xml
+rename from suite/locales/searchplugins/wikipedia.xml
+rename to suite/components/search/searchplugins/wikipedia.xml
+diff --git a/suite/locales/searchplugins/wolnelektury-pl.xml b/suite/components/search/searchplugins/wolnelektury-pl.xml
+rename from suite/locales/searchplugins/wolnelektury-pl.xml
+rename to suite/components/search/searchplugins/wolnelektury-pl.xml
+diff --git a/suite/locales/searchplugins/yahoo-NO.xml b/suite/components/search/searchplugins/yahoo-NO.xml
+rename from suite/locales/searchplugins/yahoo-NO.xml
+rename to suite/components/search/searchplugins/yahoo-NO.xml
+diff --git a/suite/locales/searchplugins/yahoo-ar.xml b/suite/components/search/searchplugins/yahoo-ar.xml
+rename from suite/locales/searchplugins/yahoo-ar.xml
+rename to suite/components/search/searchplugins/yahoo-ar.xml
+diff --git a/suite/locales/searchplugins/yahoo-bid-zh-TW.xml b/suite/components/search/searchplugins/yahoo-bid-zh-TW.xml
+rename from suite/locales/searchplugins/yahoo-bid-zh-TW.xml
+rename to suite/components/search/searchplugins/yahoo-bid-zh-TW.xml
+diff --git a/suite/locales/searchplugins/yahoo-br.xml b/suite/components/search/searchplugins/yahoo-br.xml
+rename from suite/locales/searchplugins/yahoo-br.xml
+rename to suite/components/search/searchplugins/yahoo-br.xml
+diff --git a/suite/locales/searchplugins/yahoo-de.xml b/suite/components/search/searchplugins/yahoo-de.xml
+rename from suite/locales/searchplugins/yahoo-de.xml
+rename to suite/components/search/searchplugins/yahoo-de.xml
+diff --git a/suite/locales/searchplugins/yahoo-en-GB.xml b/suite/components/search/searchplugins/yahoo-en-GB.xml
+rename from suite/locales/searchplugins/yahoo-en-GB.xml
+rename to suite/components/search/searchplugins/yahoo-en-GB.xml
+diff --git a/suite/locales/searchplugins/yahoo-es.xml b/suite/components/search/searchplugins/yahoo-es.xml
+rename from suite/locales/searchplugins/yahoo-es.xml
+rename to suite/components/search/searchplugins/yahoo-es.xml
+diff --git a/suite/locales/searchplugins/yahoo-fi.xml b/suite/components/search/searchplugins/yahoo-fi.xml
+rename from suite/locales/searchplugins/yahoo-fi.xml
+rename to suite/components/search/searchplugins/yahoo-fi.xml
+diff --git a/suite/locales/searchplugins/yahoo-fr.xml b/suite/components/search/searchplugins/yahoo-fr.xml
+rename from suite/locales/searchplugins/yahoo-fr.xml
+rename to suite/components/search/searchplugins/yahoo-fr.xml
+diff --git a/suite/locales/searchplugins/yahoo-it.xml b/suite/components/search/searchplugins/yahoo-it.xml
+rename from suite/locales/searchplugins/yahoo-it.xml
+rename to suite/components/search/searchplugins/yahoo-it.xml
+diff --git a/suite/locales/searchplugins/yahoo-jp.xml b/suite/components/search/searchplugins/yahoo-jp.xml
+rename from suite/locales/searchplugins/yahoo-jp.xml
+rename to suite/components/search/searchplugins/yahoo-jp.xml
+diff --git a/suite/locales/searchplugins/yahoo-nl.xml b/suite/components/search/searchplugins/yahoo-nl.xml
+rename from suite/locales/searchplugins/yahoo-nl.xml
+rename to suite/components/search/searchplugins/yahoo-nl.xml
+diff --git a/suite/locales/searchplugins/yahoo-sv-SE.xml b/suite/components/search/searchplugins/yahoo-sv-SE.xml
+rename from suite/locales/searchplugins/yahoo-sv-SE.xml
+rename to suite/components/search/searchplugins/yahoo-sv-SE.xml
+diff --git a/suite/locales/searchplugins/yahoo-zh-CN.xml b/suite/components/search/searchplugins/yahoo-zh-CN.xml
+rename from suite/locales/searchplugins/yahoo-zh-CN.xml
+rename to suite/components/search/searchplugins/yahoo-zh-CN.xml
+diff --git a/suite/locales/searchplugins/yahoo-zh-TW.xml b/suite/components/search/searchplugins/yahoo-zh-TW.xml
+rename from suite/locales/searchplugins/yahoo-zh-TW.xml
+rename to suite/components/search/searchplugins/yahoo-zh-TW.xml
+diff --git a/suite/locales/searchplugins/yahoo.xml b/suite/components/search/searchplugins/yahoo.xml
+rename from suite/locales/searchplugins/yahoo.xml
+rename to suite/components/search/searchplugins/yahoo.xml
+diff --git a/suite/locales/searchplugins/zoznam-sk.xml b/suite/components/search/searchplugins/zoznam-sk.xml
+rename from suite/locales/searchplugins/zoznam-sk.xml
+rename to suite/components/search/searchplugins/zoznam-sk.xml
+diff --git a/suite/locales/Makefile.in b/suite/locales/Makefile.in
+--- a/suite/locales/Makefile.in
++++ b/suite/locales/Makefile.in
+@@ -41,45 +41,27 @@ MOZ_SFX_PACKAGE=$(topsrcdir)/comm/other-
+ NON_OMNIJAR_FILES = \
+ 	defaults/messenger/mailViews.dat \
+ 	defaults/profile/panels.rdf \
+ 	defaults/profile/mimeTypes.rdf \
+ 	defaults/profile/chrome/userChrome-example.css \
+ 	defaults/profile/chrome/userContent-example.css \
+ 	$(NULL)
+ 
+-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)
+-SEARCHPLUGINS_TARGET := libs searchplugins
+-SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_FILENAMES)),$(or $(wildcard $(srcdir)/searchplugins/$(plugin)),$(error Missing searchplugin: $(plugin))))
+-# Some locale-specific search plugins may have preprocessor directives, but the
+-# default en-US ones do not.
+-SEARCHPLUGINS_FLAGS := --silence-missing-directive-warnings
+-PP_TARGETS += SEARCHPLUGINS
+-
+-list-json = $(SEARCHPLUGINS_PATH)/list.json
+-GARBAGE += $(list-json)
+-
+-libs:: searchplugins
+-
+ # Required for l10n.mk - defines a list of app sub dirs that should
+ # be included in langpack xpis.
+ # Currently not set in SeaMonkey.
+ DIST_SUBDIRS = $(DIST_SUBDIR)
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
+ COMPARE_LOCALES_DEFINES += -Dmozilla=..
+ 
+ include $(topsrcdir)/toolkit/locales/l10n.mk
+ 
+-$(list-json): $(call mkdir_deps,$(SEARCHPLUGINS_PATH)) $(if $(IS_LANGUAGE_REPACK),FORCE)
+-	$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(list-json))
+-searchplugins:: $(list-json)
+-
+ PROFILE_CHROME = userChrome-example.css userContent-example.css
+ 
+ NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
+ 
+ BOOKMARKS_INC_FILE = $(call MERGE_FILE,profile/bookmarks.inc)
+ BOOKMARKS_XTRA_FILE = $(call MERGE_FILE,profile/bookmarks.extra)
+ 
+ # the #include in the .in file requires all to be in the same dir, sadly.
+@@ -130,17 +112,16 @@ libs-%:
+ 	@$(MAKE) -C ../../calendar/locales AB_CD=$* XPI_NAME=locale-$*
+ ifdef MOZ_IRC
+ 	@$(MAKE) -C ../extensions/irc/locales libs-$*
+ endif
+ ifdef MOZ_DEBUGQA
+ 	@$(MAKE) -C ../extensions/debugQA/locales AB_CD=$* XPI_NAME=locale-$*
+ endif
+ 	@$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+-	@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C $(DEPTH)/devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
+ 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
+ 
+ package-win32-installer: $(SUBMAKEFILES)
+ 	$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
+ 
+diff --git a/suite/locales/jar.mn b/suite/locales/jar.mn
+--- a/suite/locales/jar.mn
++++ b/suite/locales/jar.mn
+@@ -194,25 +194,16 @@
+   locale/@AB_CD@/communicator/profile/profileSelection.dtd                  (%chrome/common/profile/profileSelection.dtd)
+   locale/@AB_CD@/communicator/profile/profileSelection.properties           (%chrome/common/profile/profileSelection.properties)
+   locale/@AB_CD@/communicator/safeMode.dtd                                  (%chrome/common/safeMode.dtd)
+   locale/@AB_CD@/communicator/search/engineManager.dtd                      (%chrome/common/search/engineManager.dtd)
+   locale/@AB_CD@/communicator/search/engineManager.properties               (%chrome/common/search/engineManager.properties)
+   locale/@AB_CD@/communicator/search/search.properties                      (%chrome/common/search/search.properties)
+   locale/@AB_CD@/communicator/search/searchbar.dtd                          (%chrome/common/search/searchbar.dtd)
+   locale/@AB_CD@/communicator/search/search-panel.dtd                       (%chrome/common/search/search-panel.dtd)
+-  locale/@AB_CD@/communicator/searchplugins/                                (.deps/generated_@AB_CD@/*.xml)
+-  locale/@AB_CD@/communicator/searchplugins/list.json                       (.deps/generated_@AB_CD@/list.json)
+-  locale/@AB_CD@/communicator/searchplugins/images/amazon.ico               (searchplugins/images/amazon.ico)
+-  locale/@AB_CD@/communicator/searchplugins/images/duckduckgo.ico           (searchplugins/images/duckduckgo.ico)
+-  locale/@AB_CD@/communicator/searchplugins/images/ebay.ico                 (searchplugins/images/ebay.ico)
+-  locale/@AB_CD@/communicator/searchplugins/images/google.ico               (searchplugins/images/google.ico)
+-  locale/@AB_CD@/communicator/searchplugins/images/startpage.ico            (searchplugins/images/startpage.ico)
+-  locale/@AB_CD@/communicator/searchplugins/images/wikipedia.ico            (searchplugins/images/wikipedia.ico)
+-  locale/@AB_CD@/communicator/searchplugins/images/yahoo.ico                (searchplugins/images/yahoo.ico)
+   locale/@AB_CD@/communicator/sidebar/customize.dtd                         (%chrome/common/sidebar/customize.dtd)
+   locale/@AB_CD@/communicator/sidebar/preview.dtd                           (%chrome/common/sidebar/preview.dtd)
+   locale/@AB_CD@/communicator/sidebar/sidebar.properties                    (%chrome/common/sidebar/sidebar.properties)
+   locale/@AB_CD@/communicator/sidebar/sidebarOverlay.dtd                    (%chrome/common/sidebar/sidebarOverlay.dtd)
+   locale/@AB_CD@/editor/editingOverlay.dtd                                  (%chrome/editor/editingOverlay.dtd)
+   locale/@AB_CD@/editor/editor.dtd                                          (%chrome/editor/editor.dtd)
+   locale/@AB_CD@/editor/editor.properties                                   (%chrome/editor/editor.properties)
+   locale/@AB_CD@/editor/editorOverlay.dtd                                   (%chrome/editor/editorOverlay.dtd)

+ 58 - 0
bug1240930-253/comm/1639866-2-port-1437942-suite-257.patch

@@ -0,0 +1,58 @@
+# HG changeset patch
+# User Bill Gianopoulos <wgianopoulos@gmail.com>
+# Date 1615744683 14400
+#      Sun Mar 14 13:58:03 2021 -0400
+# Parent  ba518af476fa403dc80525761479b11cbdb0e0f1
+Bug 1639866 - Part 2: Observe search service initialization after bug 1437942. r=frg a=frg
+
+diff --git a/suite/components/search/content/search.xml b/suite/components/search/content/search.xml
+--- a/suite/components/search/content/search.xml
++++ b/suite/components/search/content/search.xml
+@@ -74,25 +74,27 @@
+       <constructor><![CDATA[
+         if (this.parentNode.parentNode.localName == "toolbarpaletteitem")
+           return;
+ 
+         if (this.usePrivateBrowsing)
+           this._textbox.searchParam += "|private";
+ 
+         Services.obs.addObserver(this, "browser-search-engine-modified");
++        Services.obs.addObserver(this, "browser-search-service");
+         this._initialized = true;
+ 
+         Services.search.init(this);
+       ]]></constructor>
+ 
+       <destructor><![CDATA[
+         if (this._initialized) {
+           this._initialized = false;
+           Services.obs.removeObserver(this, "browser-search-engine-modified");
++          Services.obs.removeObserver(this, "browser-search-service");
+         }
+ 
+         // Make sure to break the cycle from _textbox to us. Otherwise we leak
+         // the world. But make sure it's actually pointing to us.
+         // Also make sure the textbox has ever been constructed, otherwise the
+         // _textbox getter will cause the textbox constructor to run, add an
+         // observer, and leak the world too.
+         if (this._textboxInitialized && this._textbox.mController.input == this)
+@@ -191,17 +193,18 @@
+         ]]></body>
+       </method>
+ 
+       <method name="observe">
+         <parameter name="aEngine"/>
+         <parameter name="aTopic"/>
+         <parameter name="aVerb"/>
+         <body><![CDATA[
+-          if (aTopic == "browser-search-engine-modified") {
++          if (aTopic == "browser-search-engine-modified" ||
++             (aTopic == "browser-search-service" && aVerb == "init-complete")) {
+             switch (aVerb) {
+             case "engine-removed":
+               this.offerNewEngine(aEngine);
+               break;
+             case "engine-added":
+               this.hideNewEngine(aEngine);
+               break;
+             case "engine-current":

+ 90 - 0
bug1240930-253/comm/1650631-port-1240930-suite-277.patch

@@ -0,0 +1,90 @@
+# HG changeset patch
+# User Bill Gianopoulos <wgianopoulos@gmail.com>
+# Date 1593598391 14400
+#      Wed Jul 01 06:13:11 2020 -0400
+# Parent  6f533dd49d3e0fac01f1ffbf45258ae7a97dc26e
+Bug 1650631 - Rename the libs-% targets for l10n repacks to l10n-%. r=frg
+Port bug 1240930 - Move jar_maker to the misc tier.
+
+diff --git a/suite/locales/Makefile.in b/suite/locales/Makefile.in
+--- a/suite/locales/Makefile.in
++++ b/suite/locales/Makefile.in
+@@ -9,17 +9,17 @@ include $(topsrcdir)/config/config.mk
+ 
+ MERGE_FILES = $(foreach f,$(1),$(call MERGE_FILE,$(f)))
+ 
+ SUBMAKEFILES += \
+ 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
+ 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
+ 	$(NULL)
+ 
+-# This makefile uses variable overrides from the libs-% target to
++# This makefile uses variable overrides from the l10n-% target to
+ # build non-default locales to non-default dist/ locations. Be aware!
+ 
+ PWD := $(CURDIR)
+ 
+ # These are defaulted to be compatible with the files the wget-en-US target
+ # pulls. You may override them if you provide your own files.
+ ZIP_IN ?= $(ABS_DIST)/$(PACKAGE)
+ 
+@@ -96,35 +96,35 @@ libs:: $(call MERGE_FILES,$(addprefix pr
+ 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome
+ 
+ # Extend l10n.mk clobber-% target for our localised extensions
+ ifdef MOZ_IRC
+ clobber-extensions-%:
+ 	$(RM) -rf $(DIST)/xpi-stage/chatzilla-$* $(DIST)/xpi-stage/chatzilla-*.$*.xpi
+ endif
+ 
+-libs-%: AB_CD=$*
+-libs-%:
++l10n-%: AB_CD=$*
++l10n-%:
+ # merge if we're not en-US. Conditional function because
+ # we need the current value of AB_CD.
+ 	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
+ 	$(NSINSTALL) -D $(DIST)/install
+-	@$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*
++	@$(MAKE) -C $(DEPTH)/toolkit/locales l10n-$*
+ #	@$(MAKE) -C $(DEPTH)/services/sync/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C ../../calendar/locales AB_CD=$* XPI_NAME=locale-$*
+ ifdef MOZ_IRC
+-	@$(MAKE) -C ../extensions/irc/locales libs-$*
++	@$(MAKE) -C ../extensions/irc/locales l10n-$*
+ endif
+ ifdef MOZ_DEBUGQA
+ 	@$(MAKE) -C ../extensions/debugQA/locales AB_CD=$* XPI_NAME=locale-$*
+ endif
+ 	@$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C $(DEPTH)/devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+-	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
++	@$(MAKE) l10n AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
+ 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
+ 
+ package-win32-installer: $(SUBMAKEFILES)
+ 	$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
+ 
+ repackage-extensions: $(STAGEDIST)
+ ifdef MOZ_IRC
+ 	$(MAKE) -C ../extensions/irc/locales repackage-zip-$(AB_CD) STAGEDIST=$(STAGEDIST)
+@@ -137,17 +137,17 @@ langpack: langpack-$(AB_CD)
+ # builds, and repack and installer if applicable. It is called from the
+ # tinderbox scripts. Alter it with caution.
+ installers-%: IS_LANGUAGE_REPACK=1
+ installers-%:
+ 	@$(MAKE) clobber-$*
+ ifdef MOZ_IRC
+ 	@$(MAKE) clobber-extensions-%*
+ endif
+-	@$(MAKE) libs-$*
++	@$(MAKE) l10n-$*
+ 	@$(MAKE) package-langpack-$*
+ 	@$(MAKE) repackage-zip-$*
+ 	@$(MAKE) repackage-extensions AB_CD=$*
+ ifeq (WINNT,$(OS_ARCH))
+ 	@$(MAKE) package-win32-installer AB_CD=$*
+ endif
+ 	@echo 'repackaging done'
+ 

+ 5 - 0
bug1240930-253/comm/series-append

@@ -0,0 +1,5 @@
+1468240-port-1437942-mail-62a1.patch
+1639866-1-port-1437942-suite-277.patch
+1639866-2-port-1437942-suite-257.patch
+1240930-mail-80a1.patch
+1650631-port-1240930-suite-277.patch

+ 445 - 0
bug1240930-253/mozilla/1240930-80a1.patch

@@ -0,0 +1,445 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1593552872 0
+# Node ID 22a1bfea8f7b108e24ebfd6c2539bcd524f8326b
+# Parent  3e0248a432be89e7016e5ef81736d418f8cbc4f0
+Bug 1240930 - Move jar_maker to the misc tier. r=firefox-build-system-reviewers,geckoview-reviewers,rstewart,agi
+
+Because jar_maker is not in the libs tier, we also rename the libs-%
+targets for l10n repacks to l10n-%, which make it clearer what they are
+for.
+
+And because multilocale.txt is both a GeneratedFile and a file that is
+generated (and installed) via manual build rules, keeping it in the misc
+target actually breaks building in toolkit/locales during l10n repacks,
+so move it to libs for now.
+
+Differential Revision: https://phabricator.services.mozilla.com/D81766
+
+diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
+--- a/browser/locales/Makefile.in
++++ b/browser/locales/Makefile.in
+@@ -6,17 +6,17 @@
+ include $(topsrcdir)/config/config.mk
+ 
+ 
+ SUBMAKEFILES += \
+ 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
+ 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
+ 	$(NULL)
+ 
+-# This makefile uses variable overrides from the libs-% target to
++# This makefile uses variable overrides from the l10n-% target to
+ # build non-default locales to non-default dist/ locations. Be aware!
+ 
+ PWD := $(CURDIR)
+ 
+ # These are defaulted to be compatible with the files the wget-en-US target
+ # pulls. You may override them if you provide your own files.
+ ZIP_IN ?= $(ABS_DIST)/$(PACKAGE)
+ 
+@@ -46,34 +46,34 @@ endif
+ # Required for l10n.mk - defines a list of app sub dirs that should
+ # be included in langpack xpis.
+ DIST_SUBDIRS = $(DIST_SUBDIR)
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
+ include $(topsrcdir)/toolkit/locales/l10n.mk
+ 
+-libs-%: AB_CD=$*
+-libs-%:
++l10n-%: AB_CD=$*
++l10n-%:
+ 	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
+ 	$(NSINSTALL) -D $(DIST)/install
+-	@$(MAKE) -C ../../toolkit/locales libs-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
++	@$(MAKE) -C ../../toolkit/locales l10n-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+ ifneq (,$(wildcard ../extensions/formautofill/locales))
+ 	@$(MAKE) -C ../extensions/formautofill/locales AB_CD=$* XPI_NAME=locale-$*
+ endif
+ 	@$(MAKE) -C ../extensions/jaws-esr/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C ../extensions/pocket/locale AB_CD=$* XPI_NAME=locale-$*
+ ifneq '$(or $(MOZ_DEV_EDITION),$(NIGHTLY_BUILD))' ''
+ 	@$(MAKE) -C ../extensions/webcompat-reporter/locales AB_CD=$* XPI_NAME=locale-$*
+ endif
+ 	@$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C ../../devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+-	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
++	@$(MAKE) l10n AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
+ 	@$(MAKE) multilocale.txt-$* AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
+ 
+ chrome-%: AB_CD=$*
+ chrome-%: IS_LANGUAGE_REPACK=1
+ chrome-%:
+ 	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
+ 	@$(MAKE) -C ../../toolkit/locales chrome-$*
+@@ -99,17 +99,17 @@ langpack: langpack-$(AB_CD)
+ 
+ # This is a generic target that will make a langpack, repack ZIP (+tarball)
+ # builds, and repack an installer if applicable. It is called from the
+ # tinderbox scripts. Alter it with caution.
+ 
+ installers-%: IS_LANGUAGE_REPACK=1
+ installers-%:
+ 	@$(MAKE) clobber-$*
+-	@$(MAKE) libs-$*
++	@$(MAKE) l10n-$*
+ 	@$(MAKE) package-langpack-$*
+ 	@$(MAKE) repackage-zip-$*
+ ifeq (WINNT,$(OS_ARCH))
+ 	@$(MAKE) package-win32-installer AB_CD=$*
+ endif
+ 	@echo 'repackaging done'
+ 
+ ident:
+diff --git a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -1229,22 +1229,26 @@ endif
+ # no way langpacks will get packaged right, so error out.
+ ifneq (,$(DIST_SUBDIR))
+ ifndef XPI_ROOT_APPID
+ $(error XPI_ROOT_APPID is not defined - langpacks will break.)
+ endif
+ endif
+ endif
+ 
+-libs realchrome:: $(FINAL_TARGET)/chrome
++misc realchrome:: $(FINAL_TARGET)/chrome
+ 	$(call py_action,jar_maker,\
+ 	  $(QUIET) -d $(FINAL_TARGET) \
+ 	  $(MAKE_JARS_FLAGS) $(DEFINES) $(ACDEFINES) \
+ 	  $(JAR_MANIFEST))
+ 
++ifdef AB_CD
++.PHONY: l10n
++l10n: misc ;
++endif
+ endif
+ 
+ endif
+ 
+ # When you move this out of the tools tier, please remove the corresponding
+ # hacks in recursivemake.py that check if Makefile.in sets the variable.
+ ifneq ($(XPI_PKGNAME),)
+ tools realchrome::
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -513,18 +513,16 @@ class RecursiveMakeBackend(CommonBackend
+         elif isinstance(obj, HostDefines):
+             self._process_defines(obj, backend_file, which='HOST_DEFINES')
+         elif isinstance(obj, Defines):
+             self._process_defines(obj, backend_file)
+ 
+         elif isinstance(obj, GeneratedFile):
+             if obj.required_for_compile:
+                 tier = 'export'
+-            elif obj.localized:
+-                tier = 'libs'
+             else:
+                 tier = 'misc'
+             self._no_skip[tier].add(backend_file.relobjdir)
+ 
+             # Localized generated files can use {AB_CD} and {AB_rCD} in their
+             # output paths.
+             if obj.localized:
+                 substs = {'AB_CD': '$(AB_CD)', 'AB_rCD': '$(AB_rCD)'}
+@@ -609,17 +607,17 @@ class RecursiveMakeBackend(CommonBackend
+            # with a different locale as input. IS_LANGUAGE_REPACK will reliably be set
+            # in this situation, so simply force the generation to run in that case.
+            force=force,
+            locale='--locale=$(AB_CD) ' if obj.localized else '',
+            script=obj.script,
+            method=obj.method))
+ 
+         elif isinstance(obj, JARManifest):
+-            self._no_skip['libs'].add(backend_file.relobjdir)
++            self._no_skip['misc'].add(backend_file.relobjdir)
+             backend_file.write('JAR_MANIFEST := %s\n' % obj.path.full_path)
+ 
+         elif isinstance(obj, RustProgram):
+             self._process_rust_program(obj, backend_file)
+             # Hook the program into the compile graph.
+             build_target = self._build_target_for_obj(obj)
+             self._compile_graph[build_target]
+ 
+@@ -1487,16 +1485,19 @@ class RecursiveMakeBackend(CommonBackend
+                     else:
+                         install_manifest.add_link(f.full_path, dest)
+                 else:
+                     install_manifest.add_optional_exists(dest)
+                     objdir_files.append(self._pretty_path(f, backend_file))
+             install_location = '$(DEPTH)/%s' % mozpath.join(target, path)
+             if objdir_files:
+                 tier = 'export' if obj.install_target == 'dist/include' else 'misc'
++                # We cannot generate multilocale.txt during misc at the moment.
++                if objdir_files[0] == 'multilocale.txt':
++                    tier = 'libs'
+                 self._add_install_target(backend_file, target_var, tier,
+                                          install_location, objdir_files)
+             if absolute_files:
+                 # Unfortunately, we can't use _add_install_target because on
+                 # Windows, the absolute file paths that we want to install
+                 # from often have spaces.  So we write our own rule.
+                 self._no_skip['misc'].add(backend_file.relobjdir)
+                 backend_file.write('misc::\n%s\n' %
+@@ -1545,37 +1546,37 @@ class RecursiveMakeBackend(CommonBackend
+ 
+     def _process_localized_files(self, obj, files, backend_file):
+         target = obj.install_target
+         path = mozpath.basedir(target, ('dist/bin', ))
+         if not path:
+             raise Exception('Cannot install localized files to ' + target)
+         for i, (path, files) in enumerate(files.walk()):
+             name = 'LOCALIZED_FILES_%d' % i
+-            self._no_skip['libs'].add(backend_file.relobjdir)
++            self._no_skip['misc'].add(backend_file.relobjdir)
+             self._write_localized_files_files(files, name + '_FILES', backend_file)
+             # Use FINAL_TARGET here because some l10n repack rules set
+             # XPI_NAME to generate langpacks.
+             backend_file.write('%s_DEST = $(FINAL_TARGET)/%s\n' % (name, path))
+-            backend_file.write('%s_TARGET := libs\n' % name)
++            backend_file.write('%s_TARGET := misc\n' % name)
+             backend_file.write('INSTALL_TARGETS += %s\n' % name)
+ 
+     def _process_localized_pp_files(self, obj, files, backend_file):
+         target = obj.install_target
+         path = mozpath.basedir(target, ('dist/bin', ))
+         if not path:
+             raise Exception('Cannot install localized files to ' + target)
+         for i, (path, files) in enumerate(files.walk()):
+             name = 'LOCALIZED_PP_FILES_%d' % i
+-            self._no_skip['libs'].add(backend_file.relobjdir)
++            self._no_skip['misc'].add(backend_file.relobjdir)
+             self._write_localized_files_files(files, name, backend_file)
+             # Use FINAL_TARGET here because some l10n repack rules set
+             # XPI_NAME to generate langpacks.
+             backend_file.write('%s_PATH = $(FINAL_TARGET)/%s\n' % (name, path))
+-            backend_file.write('%s_TARGET := libs\n' % name)
++            backend_file.write('%s_TARGET := misc\n' % name)
+             # Localized files will have different content in different
+             # localizations, and some preprocessed files may not have
+             # any preprocessor directives.
+             backend_file.write('%s_FLAGS := --silence-missing-directive-warnings\n' % name)
+             backend_file.write('PP_TARGETS += %s\n' % name)
+ 
+     def _process_objdir_files(self, obj, files, backend_file):
+         # We can't use an install manifest for the root of the objdir, since it
+diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
++++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+@@ -457,54 +457,54 @@ class TestRecursiveMakeBackend(BackendTe
+     def test_localized_generated_files(self):
+         """Ensure LOCALIZED_GENERATED_FILES is handled properly."""
+         env = self._consume('localized-generated-files', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+-            'libs:: $(MDDEPDIR)/foo.xyz.stub',
++            'misc:: $(MDDEPDIR)/foo.xyz.stub',
+             'foo.xyz: $(MDDEPDIR)/foo.xyz.stub ;',
+             'GARBAGE += foo.xyz',
+             'GARBAGE += $(MDDEPDIR)/foo.xyz.stub',
+             'EXTRA_MDDEPEND_FILES += foo.xyz.pp',
+             '$(MDDEPDIR)/foo.xyz.stub: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+             '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo.xyz $(MDDEPDIR)/foo.xyz.pp $(MDDEPDIR)/foo.xyz.stub $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
+             '@$(TOUCH) $@',
+             '',
+             'LOCALIZED_FILES_0_FILES += foo.xyz',
+             'LOCALIZED_FILES_0_DEST = $(FINAL_TARGET)/',
+-            'LOCALIZED_FILES_0_TARGET := libs',
++            'LOCALIZED_FILES_0_TARGET := misc',
+             'INSTALL_TARGETS += LOCALIZED_FILES_0',
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
+     def test_localized_generated_files_force(self):
+         """Ensure LOCALIZED_GENERATED_FILES with .force is handled properly."""
+         env = self._consume('localized-generated-files-force', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+-            'libs:: $(MDDEPDIR)/foo.xyz.stub',
++            'misc:: $(MDDEPDIR)/foo.xyz.stub',
+             'foo.xyz: $(MDDEPDIR)/foo.xyz.stub ;',
+             'GARBAGE += foo.xyz',
+             'GARBAGE += $(MDDEPDIR)/foo.xyz.stub',
+             'EXTRA_MDDEPEND_FILES += foo.xyz.pp',
+             '$(MDDEPDIR)/foo.xyz.stub: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+             '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo.xyz $(MDDEPDIR)/foo.xyz.pp $(MDDEPDIR)/foo.xyz.stub $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
+             '@$(TOUCH) $@',
+             '',
+-            'libs:: $(MDDEPDIR)/abc.xyz.stub',
++            'misc:: $(MDDEPDIR)/abc.xyz.stub',
+             'abc.xyz: $(MDDEPDIR)/abc.xyz.stub ;',
+             'GARBAGE += abc.xyz',
+             'GARBAGE += $(MDDEPDIR)/abc.xyz.stub',
+             'EXTRA_MDDEPEND_FILES += abc.xyz.pp',
+             '$(MDDEPDIR)/abc.xyz.stub: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input FORCE' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+             '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main abc.xyz $(MDDEPDIR)/abc.xyz.pp $(MDDEPDIR)/abc.xyz.stub $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
+             '@$(TOUCH) $@',
+@@ -518,17 +518,17 @@ class TestRecursiveMakeBackend(BackendTe
+         """Ensure LOCALIZED_GENERATED_FILES is handled properly
+         when {AB_CD} and {AB_rCD} are used."""
+         env = self._consume('localized-generated-files-AB_CD', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+-            'libs:: $(MDDEPDIR)/foo$(AB_CD).xyz.stub',
++            'misc:: $(MDDEPDIR)/foo$(AB_CD).xyz.stub',
+             'foo$(AB_CD).xyz: $(MDDEPDIR)/foo$(AB_CD).xyz.stub ;',
+             'GARBAGE += foo$(AB_CD).xyz',
+             'GARBAGE += $(MDDEPDIR)/foo$(AB_CD).xyz.stub',
+             'EXTRA_MDDEPEND_FILES += foo$(AB_CD).xyz.pp',
+             '$(MDDEPDIR)/foo$(AB_CD).xyz.stub: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+             '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo$(AB_CD).xyz $(MDDEPDIR)/foo$(AB_CD).xyz.pp $(MDDEPDIR)/foo$(AB_CD).xyz.stub $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
+             '@$(TOUCH) $@',
+@@ -972,17 +972,17 @@ class TestRecursiveMakeBackend(BackendTe
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+             'LOCALIZED_FILES_0_FILES += $(wildcard $(LOCALE_SRCDIR)/abc/*.abc)',
+             'LOCALIZED_FILES_0_FILES += $(call MERGE_FILE,bar.ini)',
+             'LOCALIZED_FILES_0_FILES += $(call MERGE_FILE,foo.js)',
+             'LOCALIZED_FILES_0_DEST = $(FINAL_TARGET)/',
+-            'LOCALIZED_FILES_0_TARGET := libs',
++            'LOCALIZED_FILES_0_TARGET := misc',
+             'INSTALL_TARGETS += LOCALIZED_FILES_0',
+         ]
+ 
+         found = [str for str in lines if 'LOCALIZED_FILES' in str]
+         self.assertEqual(found, expected)
+ 
+     def test_localized_pp_files(self):
+         """Test that LOCALIZED_PP_FILES is written to backend.mk correctly."""
+@@ -990,17 +990,17 @@ class TestRecursiveMakeBackend(BackendTe
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+             'LOCALIZED_PP_FILES_0 += $(call MERGE_FILE,bar.ini)',
+             'LOCALIZED_PP_FILES_0 += $(call MERGE_FILE,foo.js)',
+             'LOCALIZED_PP_FILES_0_PATH = $(FINAL_TARGET)/',
+-            'LOCALIZED_PP_FILES_0_TARGET := libs',
++            'LOCALIZED_PP_FILES_0_TARGET := misc',
+             'LOCALIZED_PP_FILES_0_FLAGS := --silence-missing-directive-warnings',
+             'PP_TARGETS += LOCALIZED_PP_FILES_0',
+         ]
+ 
+         found = [str for str in lines if 'LOCALIZED_PP_FILES' in str]
+         self.assertEqual(found, expected)
+ 
+     def test_config(self):
+diff --git a/toolkit/locales/Makefile.in b/toolkit/locales/Makefile.in
+--- a/toolkit/locales/Makefile.in
++++ b/toolkit/locales/Makefile.in
+@@ -1,21 +1,21 @@
+ # 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 $(topsrcdir)/config/rules.mk
+ 
+-libs-%: AB_CD=$*
+-libs-%:
+-	@$(MAKE) -C ../../netwerk/locales/ libs AB_CD=$* XPI_NAME=locale-$*
+-	@$(MAKE) -C ../../dom/locales/ libs AB_CD=$* XPI_NAME=locale-$*
+-	@$(MAKE) -C ../../security/manager/locales/ libs AB_CD=$* XPI_NAME=locale-$*
+-	@$(MAKE) -C ../../devtools/shared/locales/ libs AB_CD=$* XPI_NAME=locale-$*
+-	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$*
++l10n-%: AB_CD=$*
++l10n-%:
++	@$(MAKE) -C ../../netwerk/locales/ l10n AB_CD=$* XPI_NAME=locale-$*
++	@$(MAKE) -C ../../dom/locales/ l10n AB_CD=$* XPI_NAME=locale-$*
++	@$(MAKE) -C ../../security/manager/locales/ l10n AB_CD=$* XPI_NAME=locale-$*
++	@$(MAKE) -C ../../devtools/shared/locales/ l10n AB_CD=$* XPI_NAME=locale-$*
++	@$(MAKE) l10n AB_CD=$* XPI_NAME=locale-$*
+ 
+ # target to be used by multi-locale l10n builds, just add this locale
+ # like regular chrome code
+ chrome-%: AB_CD=$*
+ chrome-%:
+ 	@$(MAKE) -C $(DEPTH)/netwerk/locales/ chrome AB_CD=$*
+ 	@$(MAKE) -C $(DEPTH)/dom/locales/ chrome AB_CD=$*
+ 	@$(MAKE) -C $(DEPTH)/security/manager/locales/ chrome AB_CD=$*
+diff --git a/toolkit/locales/l10n.mk b/toolkit/locales/l10n.mk
+--- a/toolkit/locales/l10n.mk
++++ b/toolkit/locales/l10n.mk
+@@ -3,18 +3,18 @@
+ # 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/.
+ 
+ 
+ # Shared makefile that can be used to easily kick off l10n builds
+ # of Mozilla applications.
+ # This makefile should be included, and then assumes that the including
+ # makefile defines the following targets:
+-# libs-%
+-#   This target should call into the various libs targets that this
++# l10n-%
++#   This target should call into the various l10n targets that this
+ #   application depends on.
+ # installer-%
+ #   This target should list all required targets, a typical rule would be
+ #	installers-%: clobber-% langpack-% repackage-zip-%
+ #		@echo "repackaging done"
+ #   to initially clobber the locale staging area, and then to build the
+ #   language pack and zip package.
+ #   Other targets like windows installers might be listed, too, and should
+@@ -22,17 +22,17 @@
+ #   The installer-% targets should not set AB_CD, so that the unpackaging
+ #   step finds the original package.
+ # The including makefile should provide values for the variables
+ #   MOZ_APP_VERSION and MOZ_LANGPACK_EID.
+ 
+ 
+ run_for_effects := $(shell if test ! -d $(DIST); then $(NSINSTALL) -D $(DIST); fi)
+ 
+-# This makefile uses variable overrides from the libs-% target to
++# This makefile uses variable overrides from the l10n-% target to
+ # build non-default locales to non-default dist/ locations. Be aware!
+ 
+ LPROJ_ROOT = $(firstword $(subst -, ,$(AB_CD)))
+ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+ ifeq (zh-TW,$(AB_CD))
+ LPROJ_ROOT := $(subst -,_,$(AB_CD))
+ endif
+ endif
+@@ -199,17 +199,17 @@ endif
+ 	$(RM) -rf $(REAL_LOCALE_MERGEDIR)
+ 	-$(MOZILLA_DIR)/mach compare-locales $(COMPARE_LOCALES_DEFINES) --merge $(BASE_MERGE) $(srcdir)/l10n.toml $(L10NBASEDIR) $*
+ 
+ langpack-%: IS_LANGUAGE_REPACK=1
+ langpack-%: IS_LANGPACK=1
+ langpack-%: AB_CD=$*
+ langpack-%:
+ 	@echo 'Making langpack $(LANGPACK_FILE)'
+-	@$(MAKE) libs-$(AB_CD)
++	@$(MAKE) l10n-$(AB_CD)
+ 	@$(MAKE) package-langpack-$(AB_CD)
+ 
+ # language pack checking is done against the toolkit version.
+ ifeq (,$(MOZ_SUITE))
+ MOZ_MIN_APP_VERSION = $(MOZ_APP_VERSION)
+ MOZ_MAX_APP_VERSION = $(MOZ_APP_MAXVERSION)
+ else
+ MOZ_MIN_APP_VERSION = $(MOZILLA_VERSION)

+ 90 - 0
bug1240930-253/mozilla/1298328-61a1.patch

@@ -0,0 +1,90 @@
+# HG changeset patch
+# User Chris Manchester <cmanchester@mozilla.com>
+# Date 1520632195 28800
+# Node ID 48b8e6530f1b3d61b223d6506a16385dd2acb469
+# Parent  49cce2c9e2ab21606a9abcdc0ab0af991806957f
+Bug 1298328 - Fix dependency between buildid.h and libxul, do not re-generate buildid.h for every developer build. r=ted
+
+For automation builds, force buildid.h to be regenerated, and always
+#include buildid.h in nsAppRunner.cpp. This will eliminate the mismatch at the
+cost of re-linking libxul on every build.
+
+For developer builds, always #include buildid.h in nsAppRunner.cpp, but do not
+force buildid.h to be re-generated for incremental builds. This means we will
+never have a mismatch between platform and application buildids, although
+subsequent builds are no longer guaranteed to have a new buildid.
+
+MozReview-Commit-ID: 19hvu8AQXgN
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -26,18 +26,23 @@ include $(topsrcdir)/config/config.mk
+ GARBAGE_DIRS += _javagen _profile staticlib
+ DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
+    config/autoconf.mk \
+    mozilla-config.h \
+    netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
+    .mozconfig.mk
+ 
+ ifndef MOZ_PROFILE_USE
++# Automation builds should always have a new buildid, but for the sake of not
++# re-linking libxul on every incremental build we do not enforce this for
++# developer builds.
++ifneq (,$(MOZ_AUTOMATION)$(MOZ_BUILD_DATE))
+ buildid.h source-repo.h: FORCE
+ endif
++endif
+ 
+ BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
+ 
+ ifndef TEST_MOZBUILD
+ ifndef MOZ_PROFILE_USE
+ # We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
+ # rules.mk doesn't run early enough.
+ $(TIERS) binaries:: CLOBBER $(BUILD_BACKEND_FILES)
+diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
+--- a/toolkit/xre/nsAppRunner.cpp
++++ b/toolkit/xre/nsAppRunner.cpp
+@@ -241,16 +241,18 @@ extern void InstallSignalHandlers(const 
+ 
+ #define FILE_COMPATIBILITY_INFO NS_LITERAL_CSTRING("compatibility.ini")
+ #define FILE_INVALIDATE_CACHES NS_LITERAL_CSTRING(".purgecaches")
+ #define FILE_STARTUP_INCOMPLETE NS_LITERAL_STRING(".startup-incomplete")
+ 
+ int gArgc;
+ char** gArgv;
+ 
++#include "buildid.h"
++
+ static const char gToolkitVersion[] = NS_STRINGIFY(GRE_MILESTONE);
+ static const char gToolkitBuildID[] = NS_STRINGIFY(MOZ_BUILDID);
+ 
+ static nsIProfileLock* gProfileLock;
+ 
+ int gRestartArgc;
+ char** gRestartArgv;
+ 
+@@ -271,22 +273,16 @@ nsString gAbsoluteArgv0Path;
+ #endif
+ #ifdef MOZ_X11
+ #include <gdk/gdkx.h>
+ #endif /* MOZ_X11 */
+ #include "nsGTKToolkit.h"
+ #include <fontconfig/fontconfig.h>
+ #endif
+ #include "BinaryPath.h"
+-#ifndef MOZ_BUILDID
+-// See comment in Makefile.in why we want to avoid including buildid.h.
+-// Still include it when MOZ_BUILDID is not set, which can happen with some
+-// build backends.
+-#include "buildid.h"
+-#endif
+ 
+ #ifdef MOZ_LINKER
+ extern "C" MFBT_API bool IsSignalHandlingBroken();
+ #endif
+ 
+ #ifdef FUZZING
+ #include "FuzzerRunner.h"
+ 

+ 1565 - 0
bug1240930-253/mozilla/1437942-62a1.patch

@@ -0,0 +1,1565 @@
+# HG changeset patch
+# User Michael Kaply <mozilla@kaply.com>
+# Date 1528148750 18000
+# Node ID 67f15f4455067ee2d85245e5482d7241880911a1
+# Parent  bf962e0c8abe9f80d8e20a51a62667b2977d903b
+Bug 1437942 - Remove search engines from langpacks. r=adw
+
+MozReview-Commit-ID: GFCIbfmCc5B
+
+diff --git a/browser/base/content/test/static/browser_all_files_referenced.js b/browser/base/content/test/static/browser_all_files_referenced.js
+--- a/browser/base/content/test/static/browser_all_files_referenced.js
++++ b/browser/base/content/test/static/browser_all_files_referenced.js
+@@ -7,17 +7,16 @@
+ 
+ // Slow on asan builds.
+ requestLongerTimeout(5);
+ 
+ var isDevtools = SimpleTest.harnessParameters.subsuite == "devtools";
+ 
+ var gExceptionPaths = [
+   "chrome://browser/content/defaultthemes/",
+-  "chrome://browser/locale/searchplugins/",
+   "resource://app/defaults/blocklists/",
+   "resource://app/defaults/pinning/",
+   "resource://app/defaults/preferences/",
+   "resource://gre/modules/commonjs/",
+   "resource://gre/defaults/pref/",
+ 
+   // These resources are referenced using relative paths from html files.
+   "resource://payments/",
+@@ -30,16 +29,19 @@ var gExceptionPaths = [
+   "resource://activity-stream/prerendered/",
+ 
+   // browser/extensions/pdfjs/content/build/pdf.js#1999
+   "resource://pdf.js/web/images/",
+ 
+   // Exclude all the metadata paths under the country metadata folder because these
+   // paths will be concatenated in FormAutofillUtils.jsm based on different country/region.
+   "resource://formautofill/addressmetadata/",
++
++  // Exclude all search-plugins because they aren't referenced by filename
++  "resource://search-plugins/",
+ ];
+ 
+ // These are not part of the omni.ja file, so we find them only when running
+ // the test on a non-packaged build.
+ if (AppConstants.platform == "macosx")
+   gExceptionPaths.push("resource://gre/res/cursors/");
+ 
+ var whitelist = [
+diff --git a/browser/base/jar.mn b/browser/base/jar.mn
+--- a/browser/base/jar.mn
++++ b/browser/base/jar.mn
+@@ -137,9 +137,8 @@ browser.jar:
+         content/browser/blockedSite.xhtml               (content/blockedSite.xhtml)
+ 
+ % override chrome://global/content/netError.xhtml chrome://browser/content/aboutNetError.xhtml
+ 
+ # L10n resources and overrides.
+ % override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties
+ % override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd
+ % override chrome://mozapps/locale/downloads/settingsChange.dtd chrome://browser/locale/downloads/settingsChange.dtd
+-% resource search-plugins chrome://browser/locale/searchplugins/
+diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml
+--- a/browser/components/search/content/search.xml
++++ b/browser/components/search/content/search.xml
+@@ -66,16 +66,17 @@
+     </content>
+ 
+     <implementation implements="nsIObserver">
+       <constructor><![CDATA[
+         if (this.parentNode.parentNode.localName == "toolbarpaletteitem")
+           return;
+ 
+         Services.obs.addObserver(this, "browser-search-engine-modified");
++        Services.obs.addObserver(this, "browser-search-service");
+ 
+         this._initialized = true;
+ 
+         (window.delayedStartupPromise || Promise.resolve()).then(() => {
+           window.requestIdleCallback(() => {
+             Services.search.init(aStatus => {
+               // Bail out if the binding's been destroyed
+               if (!this._initialized)
+@@ -113,16 +114,17 @@
+       ]]></destructor>
+ 
+       <method name="destroy">
+         <body><![CDATA[
+         if (this._initialized) {
+           this._initialized = false;
+ 
+           Services.obs.removeObserver(this, "browser-search-engine-modified");
++          Services.obs.removeObserver(this, "browser-search-service");
+         }
+ 
+         // Make sure to break the cycle from _textbox to us. Otherwise we leak
+         // the world. But make sure it's actually pointing to us.
+         // Also make sure the textbox has ever been constructed, otherwise the
+         // _textbox getter will cause the textbox constructor to run, add an
+         // observer, and leak the world too.
+         if (this._textboxInitialized && this._textbox.mController.input == this)
+@@ -182,17 +184,18 @@
+         ]]></body>
+       </method>
+ 
+       <method name="observe">
+         <parameter name="aEngine"/>
+         <parameter name="aTopic"/>
+         <parameter name="aVerb"/>
+         <body><![CDATA[
+-          if (aTopic == "browser-search-engine-modified") {
++          if (aTopic == "browser-search-engine-modified" ||
++              (aTopic == "browser-search-service" && aVerb == "init-complete")) {
+             switch (aVerb) {
+             case "engine-removed":
+               this.offerNewEngine(aEngine);
+               break;
+             case "engine-added":
+               this.hideNewEngine(aEngine);
+               break;
+             case "engine-changed":
+@@ -1377,16 +1380,17 @@
+         menu.addEventListener("popuphidden", aEvent => {
+           this._ignoreMouseEvents = false;
+           aEvent.stopPropagation();
+         });
+ 
+         // Add weak referenced observers to invalidate our cached list of engines.
+         Services.prefs.addObserver("browser.search.hiddenOneOffs", this, true);
+         Services.obs.addObserver(this, "browser-search-engine-modified", true);
++        Services.obs.addObserver(this, "browser-search-service", true);
+ 
+         // Rebuild the buttons when the theme changes.  See bug 1357800 for
+         // details.  Summary: On Linux, switching between themes can cause a row
+         // of buttons to disappear.
+         Services.obs.addObserver(this, "lightweight-theme-changed", true);
+       ]]></constructor>
+ 
+       <!-- This handles events outside the one-off buttons, like on the popup
+diff --git a/browser/components/search/jar.mn b/browser/components/search/jar.mn
+--- a/browser/components/search/jar.mn
++++ b/browser/components/search/jar.mn
+@@ -2,8 +2,12 @@
+ # 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/.
+ 
+ browser.jar:
+         content/browser/search/search.xml                           (content/search.xml)
+         content/browser/search/searchbarBindings.css                (content/searchbarBindings.css)
+         content/browser/search/searchReset.xhtml                    (content/searchReset.xhtml)
+         content/browser/search/searchReset.js                       (content/searchReset.js)
++
++        searchplugins/                                              (searchplugins/**)
++
++% resource search-plugins %searchplugins/
+diff --git a/browser/locales/searchplugins/allaannonser-sv-SE.xml b/browser/components/search/searchplugins/allaannonser-sv-SE.xml
+rename from browser/locales/searchplugins/allaannonser-sv-SE.xml
+rename to browser/components/search/searchplugins/allaannonser-sv-SE.xml
+diff --git a/browser/locales/searchplugins/allegro-pl.xml b/browser/components/search/searchplugins/allegro-pl.xml
+rename from browser/locales/searchplugins/allegro-pl.xml
+rename to browser/components/search/searchplugins/allegro-pl.xml
+diff --git a/browser/locales/searchplugins/amazon-au.xml b/browser/components/search/searchplugins/amazon-au.xml
+rename from browser/locales/searchplugins/amazon-au.xml
+rename to browser/components/search/searchplugins/amazon-au.xml
+diff --git a/browser/locales/searchplugins/amazon-br.xml b/browser/components/search/searchplugins/amazon-br.xml
+rename from browser/locales/searchplugins/amazon-br.xml
+rename to browser/components/search/searchplugins/amazon-br.xml
+diff --git a/browser/locales/searchplugins/amazon-ca.xml b/browser/components/search/searchplugins/amazon-ca.xml
+rename from browser/locales/searchplugins/amazon-ca.xml
+rename to browser/components/search/searchplugins/amazon-ca.xml
+diff --git a/browser/locales/searchplugins/amazon-en-GB.xml b/browser/components/search/searchplugins/amazon-en-GB.xml
+rename from browser/locales/searchplugins/amazon-en-GB.xml
+rename to browser/components/search/searchplugins/amazon-en-GB.xml
+diff --git a/browser/locales/searchplugins/amazon-france.xml b/browser/components/search/searchplugins/amazon-france.xml
+rename from browser/locales/searchplugins/amazon-france.xml
+rename to browser/components/search/searchplugins/amazon-france.xml
+diff --git a/browser/locales/searchplugins/amazon-in.xml b/browser/components/search/searchplugins/amazon-in.xml
+rename from browser/locales/searchplugins/amazon-in.xml
+rename to browser/components/search/searchplugins/amazon-in.xml
+diff --git a/browser/locales/searchplugins/amazon-it.xml b/browser/components/search/searchplugins/amazon-it.xml
+rename from browser/locales/searchplugins/amazon-it.xml
+rename to browser/components/search/searchplugins/amazon-it.xml
+diff --git a/browser/locales/searchplugins/amazon-jp.xml b/browser/components/search/searchplugins/amazon-jp.xml
+rename from browser/locales/searchplugins/amazon-jp.xml
+rename to browser/components/search/searchplugins/amazon-jp.xml
+diff --git a/browser/locales/searchplugins/amazon-mx.xml b/browser/components/search/searchplugins/amazon-mx.xml
+rename from browser/locales/searchplugins/amazon-mx.xml
+rename to browser/components/search/searchplugins/amazon-mx.xml
+diff --git a/browser/locales/searchplugins/amazon-nl.xml b/browser/components/search/searchplugins/amazon-nl.xml
+rename from browser/locales/searchplugins/amazon-nl.xml
+rename to browser/components/search/searchplugins/amazon-nl.xml
+diff --git a/browser/locales/searchplugins/amazondotcn.xml b/browser/components/search/searchplugins/amazondotcn.xml
+rename from browser/locales/searchplugins/amazondotcn.xml
+rename to browser/components/search/searchplugins/amazondotcn.xml
+diff --git a/browser/locales/searchplugins/amazondotcom-de.xml b/browser/components/search/searchplugins/amazondotcom-de.xml
+rename from browser/locales/searchplugins/amazondotcom-de.xml
+rename to browser/components/search/searchplugins/amazondotcom-de.xml
+diff --git a/browser/locales/searchplugins/amazondotcom.xml b/browser/components/search/searchplugins/amazondotcom.xml
+rename from browser/locales/searchplugins/amazondotcom.xml
+rename to browser/components/search/searchplugins/amazondotcom.xml
+diff --git a/browser/locales/searchplugins/atlas-sk.xml b/browser/components/search/searchplugins/atlas-sk.xml
+rename from browser/locales/searchplugins/atlas-sk.xml
+rename to browser/components/search/searchplugins/atlas-sk.xml
+diff --git a/browser/locales/searchplugins/azerdict.xml b/browser/components/search/searchplugins/azerdict.xml
+rename from browser/locales/searchplugins/azerdict.xml
+rename to browser/components/search/searchplugins/azerdict.xml
+diff --git a/browser/locales/searchplugins/azet-sk.xml b/browser/components/search/searchplugins/azet-sk.xml
+rename from browser/locales/searchplugins/azet-sk.xml
+rename to browser/components/search/searchplugins/azet-sk.xml
+diff --git a/browser/locales/searchplugins/baidu.xml b/browser/components/search/searchplugins/baidu.xml
+rename from browser/locales/searchplugins/baidu.xml
+rename to browser/components/search/searchplugins/baidu.xml
+diff --git a/browser/locales/searchplugins/bbc-alba.xml b/browser/components/search/searchplugins/bbc-alba.xml
+rename from browser/locales/searchplugins/bbc-alba.xml
+rename to browser/components/search/searchplugins/bbc-alba.xml
+diff --git a/browser/locales/searchplugins/bing.xml b/browser/components/search/searchplugins/bing.xml
+rename from browser/locales/searchplugins/bing.xml
+rename to browser/components/search/searchplugins/bing.xml
+diff --git a/browser/locales/searchplugins/bok-NO.xml b/browser/components/search/searchplugins/bok-NO.xml
+rename from browser/locales/searchplugins/bok-NO.xml
+rename to browser/components/search/searchplugins/bok-NO.xml
+diff --git a/browser/locales/searchplugins/bolcom-fy-NL.xml b/browser/components/search/searchplugins/bolcom-fy-NL.xml
+rename from browser/locales/searchplugins/bolcom-fy-NL.xml
+rename to browser/components/search/searchplugins/bolcom-fy-NL.xml
+diff --git a/browser/locales/searchplugins/bolcom-nl.xml b/browser/components/search/searchplugins/bolcom-nl.xml
+rename from browser/locales/searchplugins/bolcom-nl.xml
+rename to browser/components/search/searchplugins/bolcom-nl.xml
+diff --git a/browser/locales/searchplugins/bookplus-fi.xml b/browser/components/search/searchplugins/bookplus-fi.xml
+rename from browser/locales/searchplugins/bookplus-fi.xml
+rename to browser/components/search/searchplugins/bookplus-fi.xml
+diff --git a/browser/locales/searchplugins/buscape.xml b/browser/components/search/searchplugins/buscape.xml
+rename from browser/locales/searchplugins/buscape.xml
+rename to browser/components/search/searchplugins/buscape.xml
+diff --git a/browser/locales/searchplugins/ceneji.xml b/browser/components/search/searchplugins/ceneji.xml
+rename from browser/locales/searchplugins/ceneji.xml
+rename to browser/components/search/searchplugins/ceneji.xml
+diff --git a/browser/locales/searchplugins/chambers-en-GB.xml b/browser/components/search/searchplugins/chambers-en-GB.xml
+rename from browser/locales/searchplugins/chambers-en-GB.xml
+rename to browser/components/search/searchplugins/chambers-en-GB.xml
+diff --git a/browser/locales/searchplugins/cnrtl-tlfi-fr.xml b/browser/components/search/searchplugins/cnrtl-tlfi-fr.xml
+rename from browser/locales/searchplugins/cnrtl-tlfi-fr.xml
+rename to browser/components/search/searchplugins/cnrtl-tlfi-fr.xml
+diff --git a/browser/locales/searchplugins/coccoc.xml b/browser/components/search/searchplugins/coccoc.xml
+rename from browser/locales/searchplugins/coccoc.xml
+rename to browser/components/search/searchplugins/coccoc.xml
+diff --git a/browser/locales/searchplugins/danawa-kr.xml b/browser/components/search/searchplugins/danawa-kr.xml
+rename from browser/locales/searchplugins/danawa-kr.xml
+rename to browser/components/search/searchplugins/danawa-kr.xml
+diff --git a/browser/locales/searchplugins/daum-kr.xml b/browser/components/search/searchplugins/daum-kr.xml
+rename from browser/locales/searchplugins/daum-kr.xml
+rename to browser/components/search/searchplugins/daum-kr.xml
+diff --git a/browser/locales/searchplugins/ddg.xml b/browser/components/search/searchplugins/ddg.xml
+rename from browser/locales/searchplugins/ddg.xml
+rename to browser/components/search/searchplugins/ddg.xml
+diff --git a/browser/locales/searchplugins/diccionariu-alla.xml b/browser/components/search/searchplugins/diccionariu-alla.xml
+rename from browser/locales/searchplugins/diccionariu-alla.xml
+rename to browser/components/search/searchplugins/diccionariu-alla.xml
+diff --git a/browser/locales/searchplugins/dict-enlv.xml b/browser/components/search/searchplugins/dict-enlv.xml
+rename from browser/locales/searchplugins/dict-enlv.xml
+rename to browser/components/search/searchplugins/dict-enlv.xml
+diff --git a/browser/locales/searchplugins/diec2.xml b/browser/components/search/searchplugins/diec2.xml
+rename from browser/locales/searchplugins/diec2.xml
+rename to browser/components/search/searchplugins/diec2.xml
+diff --git a/browser/locales/searchplugins/drae.xml b/browser/components/search/searchplugins/drae.xml
+rename from browser/locales/searchplugins/drae.xml
+rename to browser/components/search/searchplugins/drae.xml
+diff --git a/browser/locales/searchplugins/ebay-at.xml b/browser/components/search/searchplugins/ebay-at.xml
+rename from browser/locales/searchplugins/ebay-at.xml
+rename to browser/components/search/searchplugins/ebay-at.xml
+diff --git a/browser/locales/searchplugins/ebay-au.xml b/browser/components/search/searchplugins/ebay-au.xml
+rename from browser/locales/searchplugins/ebay-au.xml
+rename to browser/components/search/searchplugins/ebay-au.xml
+diff --git a/browser/locales/searchplugins/ebay-be.xml b/browser/components/search/searchplugins/ebay-be.xml
+rename from browser/locales/searchplugins/ebay-be.xml
+rename to browser/components/search/searchplugins/ebay-be.xml
+diff --git a/browser/locales/searchplugins/ebay-ca.xml b/browser/components/search/searchplugins/ebay-ca.xml
+rename from browser/locales/searchplugins/ebay-ca.xml
+rename to browser/components/search/searchplugins/ebay-ca.xml
+diff --git a/browser/locales/searchplugins/ebay-ch.xml b/browser/components/search/searchplugins/ebay-ch.xml
+rename from browser/locales/searchplugins/ebay-ch.xml
+rename to browser/components/search/searchplugins/ebay-ch.xml
+diff --git a/browser/locales/searchplugins/ebay-de.xml b/browser/components/search/searchplugins/ebay-de.xml
+rename from browser/locales/searchplugins/ebay-de.xml
+rename to browser/components/search/searchplugins/ebay-de.xml
+diff --git a/browser/locales/searchplugins/ebay-es.xml b/browser/components/search/searchplugins/ebay-es.xml
+rename from browser/locales/searchplugins/ebay-es.xml
+rename to browser/components/search/searchplugins/ebay-es.xml
+diff --git a/browser/locales/searchplugins/ebay-fr.xml b/browser/components/search/searchplugins/ebay-fr.xml
+rename from browser/locales/searchplugins/ebay-fr.xml
+rename to browser/components/search/searchplugins/ebay-fr.xml
+diff --git a/browser/locales/searchplugins/ebay-ie.xml b/browser/components/search/searchplugins/ebay-ie.xml
+rename from browser/locales/searchplugins/ebay-ie.xml
+rename to browser/components/search/searchplugins/ebay-ie.xml
+diff --git a/browser/locales/searchplugins/ebay-it.xml b/browser/components/search/searchplugins/ebay-it.xml
+rename from browser/locales/searchplugins/ebay-it.xml
+rename to browser/components/search/searchplugins/ebay-it.xml
+diff --git a/browser/locales/searchplugins/ebay-nl.xml b/browser/components/search/searchplugins/ebay-nl.xml
+rename from browser/locales/searchplugins/ebay-nl.xml
+rename to browser/components/search/searchplugins/ebay-nl.xml
+diff --git a/browser/locales/searchplugins/ebay-uk.xml b/browser/components/search/searchplugins/ebay-uk.xml
+rename from browser/locales/searchplugins/ebay-uk.xml
+rename to browser/components/search/searchplugins/ebay-uk.xml
+diff --git a/browser/locales/searchplugins/ebay.xml b/browser/components/search/searchplugins/ebay.xml
+rename from browser/locales/searchplugins/ebay.xml
+rename to browser/components/search/searchplugins/ebay.xml
+diff --git a/browser/locales/searchplugins/ecosia.xml b/browser/components/search/searchplugins/ecosia.xml
+rename from browser/locales/searchplugins/ecosia.xml
+rename to browser/components/search/searchplugins/ecosia.xml
+diff --git a/browser/locales/searchplugins/eki-ee.xml b/browser/components/search/searchplugins/eki-ee.xml
+rename from browser/locales/searchplugins/eki-ee.xml
+rename to browser/components/search/searchplugins/eki-ee.xml
+diff --git a/browser/locales/searchplugins/elebila.xml b/browser/components/search/searchplugins/elebila.xml
+rename from browser/locales/searchplugins/elebila.xml
+rename to browser/components/search/searchplugins/elebila.xml
+diff --git a/browser/locales/searchplugins/eudict.xml b/browser/components/search/searchplugins/eudict.xml
+rename from browser/locales/searchplugins/eudict.xml
+rename to browser/components/search/searchplugins/eudict.xml
+diff --git a/browser/locales/searchplugins/faclair-beag.xml b/browser/components/search/searchplugins/faclair-beag.xml
+rename from browser/locales/searchplugins/faclair-beag.xml
+rename to browser/components/search/searchplugins/faclair-beag.xml
+diff --git a/browser/locales/searchplugins/flip.xml b/browser/components/search/searchplugins/flip.xml
+rename from browser/locales/searchplugins/flip.xml
+rename to browser/components/search/searchplugins/flip.xml
+diff --git a/browser/locales/searchplugins/freelang.xml b/browser/components/search/searchplugins/freelang.xml
+rename from browser/locales/searchplugins/freelang.xml
+rename to browser/components/search/searchplugins/freelang.xml
+diff --git a/browser/locales/searchplugins/google-2018.xml b/browser/components/search/searchplugins/google-2018.xml
+rename from browser/locales/searchplugins/google-2018.xml
+rename to browser/components/search/searchplugins/google-2018.xml
+diff --git a/browser/locales/searchplugins/google-b-1-d.xml b/browser/components/search/searchplugins/google-b-1-d.xml
+rename from browser/locales/searchplugins/google-b-1-d.xml
+rename to browser/components/search/searchplugins/google-b-1-d.xml
+diff --git a/browser/locales/searchplugins/google-b-1-e.xml b/browser/components/search/searchplugins/google-b-1-e.xml
+rename from browser/locales/searchplugins/google-b-1-e.xml
+rename to browser/components/search/searchplugins/google-b-1-e.xml
+diff --git a/browser/locales/searchplugins/google-b-d.xml b/browser/components/search/searchplugins/google-b-d.xml
+rename from browser/locales/searchplugins/google-b-d.xml
+rename to browser/components/search/searchplugins/google-b-d.xml
+diff --git a/browser/locales/searchplugins/google-b-e.xml b/browser/components/search/searchplugins/google-b-e.xml
+rename from browser/locales/searchplugins/google-b-e.xml
+rename to browser/components/search/searchplugins/google-b-e.xml
+diff --git a/browser/locales/searchplugins/google-nocodes.xml b/browser/components/search/searchplugins/google-nocodes.xml
+rename from browser/locales/searchplugins/google-nocodes.xml
+rename to browser/components/search/searchplugins/google-nocodes.xml
+diff --git a/browser/locales/searchplugins/google.xml b/browser/components/search/searchplugins/google.xml
+rename from browser/locales/searchplugins/google.xml
+rename to browser/components/search/searchplugins/google.xml
+diff --git a/browser/locales/searchplugins/gujaratilexicon.xml b/browser/components/search/searchplugins/gujaratilexicon.xml
+rename from browser/locales/searchplugins/gujaratilexicon.xml
+rename to browser/components/search/searchplugins/gujaratilexicon.xml
+diff --git a/browser/locales/searchplugins/gulesider-NO.xml b/browser/components/search/searchplugins/gulesider-NO.xml
+rename from browser/locales/searchplugins/gulesider-NO.xml
+rename to browser/components/search/searchplugins/gulesider-NO.xml
+diff --git a/browser/locales/searchplugins/heureka-cz.xml b/browser/components/search/searchplugins/heureka-cz.xml
+rename from browser/locales/searchplugins/heureka-cz.xml
+rename to browser/components/search/searchplugins/heureka-cz.xml
+diff --git a/browser/locales/searchplugins/hoepli.xml b/browser/components/search/searchplugins/hoepli.xml
+rename from browser/locales/searchplugins/hoepli.xml
+rename to browser/components/search/searchplugins/hoepli.xml
+diff --git a/browser/locales/searchplugins/images/amazon.ico b/browser/components/search/searchplugins/images/amazon.ico
+rename from browser/locales/searchplugins/images/amazon.ico
+rename to browser/components/search/searchplugins/images/amazon.ico
+diff --git a/browser/locales/searchplugins/images/ebay.ico b/browser/components/search/searchplugins/images/ebay.ico
+rename from browser/locales/searchplugins/images/ebay.ico
+rename to browser/components/search/searchplugins/images/ebay.ico
+diff --git a/browser/locales/searchplugins/images/wikipedia.ico b/browser/components/search/searchplugins/images/wikipedia.ico
+rename from browser/locales/searchplugins/images/wikipedia.ico
+rename to browser/components/search/searchplugins/images/wikipedia.ico
+diff --git a/browser/locales/searchplugins/images/yandex-en.ico b/browser/components/search/searchplugins/images/yandex-en.ico
+rename from browser/locales/searchplugins/images/yandex-en.ico
+rename to browser/components/search/searchplugins/images/yandex-en.ico
+diff --git a/browser/locales/searchplugins/images/yandex-ru.ico b/browser/components/search/searchplugins/images/yandex-ru.ico
+rename from browser/locales/searchplugins/images/yandex-ru.ico
+rename to browser/components/search/searchplugins/images/yandex-ru.ico
+diff --git a/browser/locales/searchplugins/kannadastore.xml b/browser/components/search/searchplugins/kannadastore.xml
+rename from browser/locales/searchplugins/kannadastore.xml
+rename to browser/components/search/searchplugins/kannadastore.xml
+diff --git a/browser/locales/searchplugins/kaz-kk.xml b/browser/components/search/searchplugins/kaz-kk.xml
+rename from browser/locales/searchplugins/kaz-kk.xml
+rename to browser/components/search/searchplugins/kaz-kk.xml
+diff --git a/browser/locales/searchplugins/klask.xml b/browser/components/search/searchplugins/klask.xml
+rename from browser/locales/searchplugins/klask.xml
+rename to browser/components/search/searchplugins/klask.xml
+diff --git a/browser/locales/searchplugins/leit-is.xml b/browser/components/search/searchplugins/leit-is.xml
+rename from browser/locales/searchplugins/leit-is.xml
+rename to browser/components/search/searchplugins/leit-is.xml
+diff --git a/browser/locales/searchplugins/leo_ende_de-rm.xml b/browser/components/search/searchplugins/leo_ende_de-rm.xml
+rename from browser/locales/searchplugins/leo_ende_de-rm.xml
+rename to browser/components/search/searchplugins/leo_ende_de-rm.xml
+diff --git a/browser/locales/searchplugins/leo_ende_de.xml b/browser/components/search/searchplugins/leo_ende_de.xml
+rename from browser/locales/searchplugins/leo_ende_de.xml
+rename to browser/components/search/searchplugins/leo_ende_de.xml
+diff --git a/browser/locales/searchplugins/list-am.xml b/browser/components/search/searchplugins/list-am.xml
+rename from browser/locales/searchplugins/list-am.xml
+rename to browser/components/search/searchplugins/list-am.xml
+diff --git a/browser/locales/search/list.json b/browser/components/search/searchplugins/list.json
+rename from browser/locales/search/list.json
+rename to browser/components/search/searchplugins/list.json
+--- a/browser/locales/search/list.json
++++ b/browser/components/search/searchplugins/list.json
+@@ -440,17 +440,17 @@
+     },
+     "it": {
+       "default": {
+         "visibleDefaultEngines": [
+           "google-b-d", "bing", "amazon-it", "ddg", "ebay-it", "hoepli", "wikipedia-it"
+         ]
+       }
+     },
+-    "ja-JP-mac": {
++    "ja-JP-macos": {
+       "default": {
+         "searchOrder": ["Google", "Yahoo! JAPAN", "Bing", "Amazon.co.jp", "楽天市場", "ヤフオク!", "教えて!goo", "Twitter", "Wikipedia (ja)"],
+         "visibleDefaultEngines": [
+           "google-b-d", "yahoo-jp", "bing", "amazon-jp", "rakuten", "yahoo-jp-auctions", "oshiete-goo", "twitter-ja", "wikipedia-ja", "ddg"
+         ]
+       }
+     },
+     "ja": {
+diff --git a/browser/locales/searchplugins/longdo.xml b/browser/components/search/searchplugins/longdo.xml
+rename from browser/locales/searchplugins/longdo.xml
+rename to browser/components/search/searchplugins/longdo.xml
+diff --git a/browser/locales/searchplugins/mailru.xml b/browser/components/search/searchplugins/mailru.xml
+rename from browser/locales/searchplugins/mailru.xml
+rename to browser/components/search/searchplugins/mailru.xml
+diff --git a/browser/locales/searchplugins/mapy-cz.xml b/browser/components/search/searchplugins/mapy-cz.xml
+rename from browser/locales/searchplugins/mapy-cz.xml
+rename to browser/components/search/searchplugins/mapy-cz.xml
+diff --git a/browser/locales/searchplugins/marktplaats-fy-NL.xml b/browser/components/search/searchplugins/marktplaats-fy-NL.xml
+rename from browser/locales/searchplugins/marktplaats-fy-NL.xml
+rename to browser/components/search/searchplugins/marktplaats-fy-NL.xml
+diff --git a/browser/locales/searchplugins/marktplaats-nl.xml b/browser/components/search/searchplugins/marktplaats-nl.xml
+rename from browser/locales/searchplugins/marktplaats-nl.xml
+rename to browser/components/search/searchplugins/marktplaats-nl.xml
+diff --git a/browser/locales/searchplugins/mercadolibre-ar.xml b/browser/components/search/searchplugins/mercadolibre-ar.xml
+rename from browser/locales/searchplugins/mercadolibre-ar.xml
+rename to browser/components/search/searchplugins/mercadolibre-ar.xml
+diff --git a/browser/locales/searchplugins/mercadolibre-cl.xml b/browser/components/search/searchplugins/mercadolibre-cl.xml
+rename from browser/locales/searchplugins/mercadolibre-cl.xml
+rename to browser/components/search/searchplugins/mercadolibre-cl.xml
+diff --git a/browser/locales/searchplugins/mercadolibre-mx.xml b/browser/components/search/searchplugins/mercadolibre-mx.xml
+rename from browser/locales/searchplugins/mercadolibre-mx.xml
+rename to browser/components/search/searchplugins/mercadolibre-mx.xml
+diff --git a/browser/locales/searchplugins/mercadolivre.xml b/browser/components/search/searchplugins/mercadolivre.xml
+rename from browser/locales/searchplugins/mercadolivre.xml
+rename to browser/components/search/searchplugins/mercadolivre.xml
+diff --git a/browser/locales/searchplugins/meta-ua.xml b/browser/components/search/searchplugins/meta-ua.xml
+rename from browser/locales/searchplugins/meta-ua.xml
+rename to browser/components/search/searchplugins/meta-ua.xml
+diff --git a/browser/locales/searchplugins/metamarket.xml b/browser/components/search/searchplugins/metamarket.xml
+rename from browser/locales/searchplugins/metamarket.xml
+rename to browser/components/search/searchplugins/metamarket.xml
+diff --git a/browser/locales/searchplugins/morfix-dic.xml b/browser/components/search/searchplugins/morfix-dic.xml
+rename from browser/locales/searchplugins/morfix-dic.xml
+rename to browser/components/search/searchplugins/morfix-dic.xml
+diff --git a/browser/locales/searchplugins/najdi-si.xml b/browser/components/search/searchplugins/najdi-si.xml
+rename from browser/locales/searchplugins/najdi-si.xml
+rename to browser/components/search/searchplugins/najdi-si.xml
+diff --git a/browser/locales/searchplugins/naver-kr.xml b/browser/components/search/searchplugins/naver-kr.xml
+rename from browser/locales/searchplugins/naver-kr.xml
+rename to browser/components/search/searchplugins/naver-kr.xml
+diff --git a/browser/locales/searchplugins/neti-ee.xml b/browser/components/search/searchplugins/neti-ee.xml
+rename from browser/locales/searchplugins/neti-ee.xml
+rename to browser/components/search/searchplugins/neti-ee.xml
+diff --git a/browser/locales/searchplugins/odpiralni.xml b/browser/components/search/searchplugins/odpiralni.xml
+rename from browser/locales/searchplugins/odpiralni.xml
+rename to browser/components/search/searchplugins/odpiralni.xml
+diff --git a/browser/locales/searchplugins/olx.xml b/browser/components/search/searchplugins/olx.xml
+rename from browser/locales/searchplugins/olx.xml
+rename to browser/components/search/searchplugins/olx.xml
+diff --git a/browser/locales/searchplugins/oshiete-goo.xml b/browser/components/search/searchplugins/oshiete-goo.xml
+rename from browser/locales/searchplugins/oshiete-goo.xml
+rename to browser/components/search/searchplugins/oshiete-goo.xml
+diff --git a/browser/locales/searchplugins/osta-ee.xml b/browser/components/search/searchplugins/osta-ee.xml
+rename from browser/locales/searchplugins/osta-ee.xml
+rename to browser/components/search/searchplugins/osta-ee.xml
+diff --git a/browser/locales/searchplugins/ozonru.xml b/browser/components/search/searchplugins/ozonru.xml
+rename from browser/locales/searchplugins/ozonru.xml
+rename to browser/components/search/searchplugins/ozonru.xml
+diff --git a/browser/locales/searchplugins/palasprint.xml b/browser/components/search/searchplugins/palasprint.xml
+rename from browser/locales/searchplugins/palasprint.xml
+rename to browser/components/search/searchplugins/palasprint.xml
+diff --git a/browser/locales/searchplugins/paroledigenova-lij.xml b/browser/components/search/searchplugins/paroledigenova-lij.xml
+rename from browser/locales/searchplugins/paroledigenova-lij.xml
+rename to browser/components/search/searchplugins/paroledigenova-lij.xml
+diff --git a/browser/locales/searchplugins/pledarigrond.xml b/browser/components/search/searchplugins/pledarigrond.xml
+rename from browser/locales/searchplugins/pledarigrond.xml
+rename to browser/components/search/searchplugins/pledarigrond.xml
+diff --git a/browser/locales/searchplugins/pogodak.xml b/browser/components/search/searchplugins/pogodak.xml
+rename from browser/locales/searchplugins/pogodak.xml
+rename to browser/components/search/searchplugins/pogodak.xml
+diff --git a/browser/locales/searchplugins/portalbgdict.xml b/browser/components/search/searchplugins/portalbgdict.xml
+rename from browser/locales/searchplugins/portalbgdict.xml
+rename to browser/components/search/searchplugins/portalbgdict.xml
+diff --git a/browser/locales/searchplugins/priberam.xml b/browser/components/search/searchplugins/priberam.xml
+rename from browser/locales/searchplugins/priberam.xml
+rename to browser/components/search/searchplugins/priberam.xml
+diff --git a/browser/locales/searchplugins/priceru.xml b/browser/components/search/searchplugins/priceru.xml
+rename from browser/locales/searchplugins/priceru.xml
+rename to browser/components/search/searchplugins/priceru.xml
+diff --git a/browser/locales/searchplugins/prisjakt-sv-SE.xml b/browser/components/search/searchplugins/prisjakt-sv-SE.xml
+rename from browser/locales/searchplugins/prisjakt-sv-SE.xml
+rename to browser/components/search/searchplugins/prisjakt-sv-SE.xml
+diff --git a/browser/locales/searchplugins/pwn-pl.xml b/browser/components/search/searchplugins/pwn-pl.xml
+rename from browser/locales/searchplugins/pwn-pl.xml
+rename to browser/components/search/searchplugins/pwn-pl.xml
+diff --git a/browser/locales/searchplugins/qwant.xml b/browser/components/search/searchplugins/qwant.xml
+rename from browser/locales/searchplugins/qwant.xml
+rename to browser/components/search/searchplugins/qwant.xml
+diff --git a/browser/locales/searchplugins/qxl-NO.xml b/browser/components/search/searchplugins/qxl-NO.xml
+rename from browser/locales/searchplugins/qxl-NO.xml
+rename to browser/components/search/searchplugins/qxl-NO.xml
+diff --git a/browser/locales/searchplugins/rakuten.xml b/browser/components/search/searchplugins/rakuten.xml
+rename from browser/locales/searchplugins/rakuten.xml
+rename to browser/components/search/searchplugins/rakuten.xml
+diff --git a/browser/locales/searchplugins/readmoo.xml b/browser/components/search/searchplugins/readmoo.xml
+rename from browser/locales/searchplugins/readmoo.xml
+rename to browser/components/search/searchplugins/readmoo.xml
+diff --git a/browser/locales/searchplugins/rediff.xml b/browser/components/search/searchplugins/rediff.xml
+rename from browser/locales/searchplugins/rediff.xml
+rename to browser/components/search/searchplugins/rediff.xml
+diff --git a/browser/locales/searchplugins/reta-vortaro.xml b/browser/components/search/searchplugins/reta-vortaro.xml
+rename from browser/locales/searchplugins/reta-vortaro.xml
+rename to browser/components/search/searchplugins/reta-vortaro.xml
+diff --git a/browser/locales/searchplugins/salidzinilv.xml b/browser/components/search/searchplugins/salidzinilv.xml
+rename from browser/locales/searchplugins/salidzinilv.xml
+rename to browser/components/search/searchplugins/salidzinilv.xml
+diff --git a/browser/locales/searchplugins/sapo.xml b/browser/components/search/searchplugins/sapo.xml
+rename from browser/locales/searchplugins/sapo.xml
+rename to browser/components/search/searchplugins/sapo.xml
+diff --git a/browser/locales/searchplugins/seznam-cz.xml b/browser/components/search/searchplugins/seznam-cz.xml
+rename from browser/locales/searchplugins/seznam-cz.xml
+rename to browser/components/search/searchplugins/seznam-cz.xml
+diff --git a/browser/locales/searchplugins/slovnik-sk.xml b/browser/components/search/searchplugins/slovnik-sk.xml
+rename from browser/locales/searchplugins/slovnik-sk.xml
+rename to browser/components/search/searchplugins/slovnik-sk.xml
+diff --git a/browser/locales/searchplugins/sslv.xml b/browser/components/search/searchplugins/sslv.xml
+rename from browser/locales/searchplugins/sslv.xml
+rename to browser/components/search/searchplugins/sslv.xml
+diff --git a/browser/locales/searchplugins/sztaki-en-hu.xml b/browser/components/search/searchplugins/sztaki-en-hu.xml
+rename from browser/locales/searchplugins/sztaki-en-hu.xml
+rename to browser/components/search/searchplugins/sztaki-en-hu.xml
+diff --git a/browser/locales/searchplugins/tearma.xml b/browser/components/search/searchplugins/tearma.xml
+rename from browser/locales/searchplugins/tearma.xml
+rename to browser/components/search/searchplugins/tearma.xml
+diff --git a/browser/locales/searchplugins/termau.xml b/browser/components/search/searchplugins/termau.xml
+rename from browser/locales/searchplugins/termau.xml
+rename to browser/components/search/searchplugins/termau.xml
+diff --git a/browser/locales/searchplugins/twitter-ja.xml b/browser/components/search/searchplugins/twitter-ja.xml
+rename from browser/locales/searchplugins/twitter-ja.xml
+rename to browser/components/search/searchplugins/twitter-ja.xml
+diff --git a/browser/locales/searchplugins/twitter.xml b/browser/components/search/searchplugins/twitter.xml
+rename from browser/locales/searchplugins/twitter.xml
+rename to browser/components/search/searchplugins/twitter.xml
+diff --git a/browser/locales/searchplugins/tyda-sv-SE.xml b/browser/components/search/searchplugins/tyda-sv-SE.xml
+rename from browser/locales/searchplugins/tyda-sv-SE.xml
+rename to browser/components/search/searchplugins/tyda-sv-SE.xml
+diff --git a/browser/locales/searchplugins/vatera.xml b/browser/components/search/searchplugins/vatera.xml
+rename from browser/locales/searchplugins/vatera.xml
+rename to browser/components/search/searchplugins/vatera.xml
+diff --git a/browser/locales/searchplugins/webdunia.xml b/browser/components/search/searchplugins/webdunia.xml
+rename from browser/locales/searchplugins/webdunia.xml
+rename to browser/components/search/searchplugins/webdunia.xml
+diff --git a/browser/locales/searchplugins/wikipedia-NN.xml b/browser/components/search/searchplugins/wikipedia-NN.xml
+rename from browser/locales/searchplugins/wikipedia-NN.xml
+rename to browser/components/search/searchplugins/wikipedia-NN.xml
+diff --git a/browser/locales/searchplugins/wikipedia-NO.xml b/browser/components/search/searchplugins/wikipedia-NO.xml
+rename from browser/locales/searchplugins/wikipedia-NO.xml
+rename to browser/components/search/searchplugins/wikipedia-NO.xml
+diff --git a/browser/locales/searchplugins/wikipedia-af.xml b/browser/components/search/searchplugins/wikipedia-af.xml
+rename from browser/locales/searchplugins/wikipedia-af.xml
+rename to browser/components/search/searchplugins/wikipedia-af.xml
+diff --git a/browser/locales/searchplugins/wikipedia-an.xml b/browser/components/search/searchplugins/wikipedia-an.xml
+rename from browser/locales/searchplugins/wikipedia-an.xml
+rename to browser/components/search/searchplugins/wikipedia-an.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ar.xml b/browser/components/search/searchplugins/wikipedia-ar.xml
+rename from browser/locales/searchplugins/wikipedia-ar.xml
+rename to browser/components/search/searchplugins/wikipedia-ar.xml
+diff --git a/browser/locales/searchplugins/wikipedia-as.xml b/browser/components/search/searchplugins/wikipedia-as.xml
+rename from browser/locales/searchplugins/wikipedia-as.xml
+rename to browser/components/search/searchplugins/wikipedia-as.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ast.xml b/browser/components/search/searchplugins/wikipedia-ast.xml
+rename from browser/locales/searchplugins/wikipedia-ast.xml
+rename to browser/components/search/searchplugins/wikipedia-ast.xml
+diff --git a/browser/locales/searchplugins/wikipedia-az.xml b/browser/components/search/searchplugins/wikipedia-az.xml
+rename from browser/locales/searchplugins/wikipedia-az.xml
+rename to browser/components/search/searchplugins/wikipedia-az.xml
+diff --git a/browser/locales/searchplugins/wikipedia-be-tarask.xml b/browser/components/search/searchplugins/wikipedia-be-tarask.xml
+rename from browser/locales/searchplugins/wikipedia-be-tarask.xml
+rename to browser/components/search/searchplugins/wikipedia-be-tarask.xml
+diff --git a/browser/locales/searchplugins/wikipedia-be.xml b/browser/components/search/searchplugins/wikipedia-be.xml
+rename from browser/locales/searchplugins/wikipedia-be.xml
+rename to browser/components/search/searchplugins/wikipedia-be.xml
+diff --git a/browser/locales/searchplugins/wikipedia-bg.xml b/browser/components/search/searchplugins/wikipedia-bg.xml
+rename from browser/locales/searchplugins/wikipedia-bg.xml
+rename to browser/components/search/searchplugins/wikipedia-bg.xml
+diff --git a/browser/locales/searchplugins/wikipedia-bn.xml b/browser/components/search/searchplugins/wikipedia-bn.xml
+rename from browser/locales/searchplugins/wikipedia-bn.xml
+rename to browser/components/search/searchplugins/wikipedia-bn.xml
+diff --git a/browser/locales/searchplugins/wikipedia-br.xml b/browser/components/search/searchplugins/wikipedia-br.xml
+rename from browser/locales/searchplugins/wikipedia-br.xml
+rename to browser/components/search/searchplugins/wikipedia-br.xml
+diff --git a/browser/locales/searchplugins/wikipedia-bs.xml b/browser/components/search/searchplugins/wikipedia-bs.xml
+rename from browser/locales/searchplugins/wikipedia-bs.xml
+rename to browser/components/search/searchplugins/wikipedia-bs.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ca.xml b/browser/components/search/searchplugins/wikipedia-ca.xml
+rename from browser/locales/searchplugins/wikipedia-ca.xml
+rename to browser/components/search/searchplugins/wikipedia-ca.xml
+diff --git a/browser/locales/searchplugins/wikipedia-cy.xml b/browser/components/search/searchplugins/wikipedia-cy.xml
+rename from browser/locales/searchplugins/wikipedia-cy.xml
+rename to browser/components/search/searchplugins/wikipedia-cy.xml
+diff --git a/browser/locales/searchplugins/wikipedia-cz.xml b/browser/components/search/searchplugins/wikipedia-cz.xml
+rename from browser/locales/searchplugins/wikipedia-cz.xml
+rename to browser/components/search/searchplugins/wikipedia-cz.xml
+diff --git a/browser/locales/searchplugins/wikipedia-da.xml b/browser/components/search/searchplugins/wikipedia-da.xml
+rename from browser/locales/searchplugins/wikipedia-da.xml
+rename to browser/components/search/searchplugins/wikipedia-da.xml
+diff --git a/browser/locales/searchplugins/wikipedia-de.xml b/browser/components/search/searchplugins/wikipedia-de.xml
+rename from browser/locales/searchplugins/wikipedia-de.xml
+rename to browser/components/search/searchplugins/wikipedia-de.xml
+diff --git a/browser/locales/searchplugins/wikipedia-dsb.xml b/browser/components/search/searchplugins/wikipedia-dsb.xml
+rename from browser/locales/searchplugins/wikipedia-dsb.xml
+rename to browser/components/search/searchplugins/wikipedia-dsb.xml
+diff --git a/browser/locales/searchplugins/wikipedia-el.xml b/browser/components/search/searchplugins/wikipedia-el.xml
+rename from browser/locales/searchplugins/wikipedia-el.xml
+rename to browser/components/search/searchplugins/wikipedia-el.xml
+diff --git a/browser/locales/searchplugins/wikipedia-eo.xml b/browser/components/search/searchplugins/wikipedia-eo.xml
+rename from browser/locales/searchplugins/wikipedia-eo.xml
+rename to browser/components/search/searchplugins/wikipedia-eo.xml
+diff --git a/browser/locales/searchplugins/wikipedia-es.xml b/browser/components/search/searchplugins/wikipedia-es.xml
+rename from browser/locales/searchplugins/wikipedia-es.xml
+rename to browser/components/search/searchplugins/wikipedia-es.xml
+diff --git a/browser/locales/searchplugins/wikipedia-et.xml b/browser/components/search/searchplugins/wikipedia-et.xml
+rename from browser/locales/searchplugins/wikipedia-et.xml
+rename to browser/components/search/searchplugins/wikipedia-et.xml
+diff --git a/browser/locales/searchplugins/wikipedia-eu.xml b/browser/components/search/searchplugins/wikipedia-eu.xml
+rename from browser/locales/searchplugins/wikipedia-eu.xml
+rename to browser/components/search/searchplugins/wikipedia-eu.xml
+diff --git a/browser/locales/searchplugins/wikipedia-fa.xml b/browser/components/search/searchplugins/wikipedia-fa.xml
+rename from browser/locales/searchplugins/wikipedia-fa.xml
+rename to browser/components/search/searchplugins/wikipedia-fa.xml
+diff --git a/browser/locales/searchplugins/wikipedia-fi.xml b/browser/components/search/searchplugins/wikipedia-fi.xml
+rename from browser/locales/searchplugins/wikipedia-fi.xml
+rename to browser/components/search/searchplugins/wikipedia-fi.xml
+diff --git a/browser/locales/searchplugins/wikipedia-fr.xml b/browser/components/search/searchplugins/wikipedia-fr.xml
+rename from browser/locales/searchplugins/wikipedia-fr.xml
+rename to browser/components/search/searchplugins/wikipedia-fr.xml
+diff --git a/browser/locales/searchplugins/wikipedia-fy-NL.xml b/browser/components/search/searchplugins/wikipedia-fy-NL.xml
+rename from browser/locales/searchplugins/wikipedia-fy-NL.xml
+rename to browser/components/search/searchplugins/wikipedia-fy-NL.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ga-IE.xml b/browser/components/search/searchplugins/wikipedia-ga-IE.xml
+rename from browser/locales/searchplugins/wikipedia-ga-IE.xml
+rename to browser/components/search/searchplugins/wikipedia-ga-IE.xml
+diff --git a/browser/locales/searchplugins/wikipedia-gd.xml b/browser/components/search/searchplugins/wikipedia-gd.xml
+rename from browser/locales/searchplugins/wikipedia-gd.xml
+rename to browser/components/search/searchplugins/wikipedia-gd.xml
+diff --git a/browser/locales/searchplugins/wikipedia-gl.xml b/browser/components/search/searchplugins/wikipedia-gl.xml
+rename from browser/locales/searchplugins/wikipedia-gl.xml
+rename to browser/components/search/searchplugins/wikipedia-gl.xml
+diff --git a/browser/locales/searchplugins/wikipedia-gn.xml b/browser/components/search/searchplugins/wikipedia-gn.xml
+rename from browser/locales/searchplugins/wikipedia-gn.xml
+rename to browser/components/search/searchplugins/wikipedia-gn.xml
+diff --git a/browser/locales/searchplugins/wikipedia-gu.xml b/browser/components/search/searchplugins/wikipedia-gu.xml
+rename from browser/locales/searchplugins/wikipedia-gu.xml
+rename to browser/components/search/searchplugins/wikipedia-gu.xml
+diff --git a/browser/locales/searchplugins/wikipedia-he.xml b/browser/components/search/searchplugins/wikipedia-he.xml
+rename from browser/locales/searchplugins/wikipedia-he.xml
+rename to browser/components/search/searchplugins/wikipedia-he.xml
+diff --git a/browser/locales/searchplugins/wikipedia-hi.xml b/browser/components/search/searchplugins/wikipedia-hi.xml
+rename from browser/locales/searchplugins/wikipedia-hi.xml
+rename to browser/components/search/searchplugins/wikipedia-hi.xml
+diff --git a/browser/locales/searchplugins/wikipedia-hr.xml b/browser/components/search/searchplugins/wikipedia-hr.xml
+rename from browser/locales/searchplugins/wikipedia-hr.xml
+rename to browser/components/search/searchplugins/wikipedia-hr.xml
+diff --git a/browser/locales/searchplugins/wikipedia-hsb.xml b/browser/components/search/searchplugins/wikipedia-hsb.xml
+rename from browser/locales/searchplugins/wikipedia-hsb.xml
+rename to browser/components/search/searchplugins/wikipedia-hsb.xml
+diff --git a/browser/locales/searchplugins/wikipedia-hu.xml b/browser/components/search/searchplugins/wikipedia-hu.xml
+rename from browser/locales/searchplugins/wikipedia-hu.xml
+rename to browser/components/search/searchplugins/wikipedia-hu.xml
+diff --git a/browser/locales/searchplugins/wikipedia-hy.xml b/browser/components/search/searchplugins/wikipedia-hy.xml
+rename from browser/locales/searchplugins/wikipedia-hy.xml
+rename to browser/components/search/searchplugins/wikipedia-hy.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ia.xml b/browser/components/search/searchplugins/wikipedia-ia.xml
+rename from browser/locales/searchplugins/wikipedia-ia.xml
+rename to browser/components/search/searchplugins/wikipedia-ia.xml
+diff --git a/browser/locales/searchplugins/wikipedia-id.xml b/browser/components/search/searchplugins/wikipedia-id.xml
+rename from browser/locales/searchplugins/wikipedia-id.xml
+rename to browser/components/search/searchplugins/wikipedia-id.xml
+diff --git a/browser/locales/searchplugins/wikipedia-is.xml b/browser/components/search/searchplugins/wikipedia-is.xml
+rename from browser/locales/searchplugins/wikipedia-is.xml
+rename to browser/components/search/searchplugins/wikipedia-is.xml
+diff --git a/browser/locales/searchplugins/wikipedia-it.xml b/browser/components/search/searchplugins/wikipedia-it.xml
+rename from browser/locales/searchplugins/wikipedia-it.xml
+rename to browser/components/search/searchplugins/wikipedia-it.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ja.xml b/browser/components/search/searchplugins/wikipedia-ja.xml
+rename from browser/locales/searchplugins/wikipedia-ja.xml
+rename to browser/components/search/searchplugins/wikipedia-ja.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ka.xml b/browser/components/search/searchplugins/wikipedia-ka.xml
+rename from browser/locales/searchplugins/wikipedia-ka.xml
+rename to browser/components/search/searchplugins/wikipedia-ka.xml
+diff --git a/browser/locales/searchplugins/wikipedia-kab.xml b/browser/components/search/searchplugins/wikipedia-kab.xml
+rename from browser/locales/searchplugins/wikipedia-kab.xml
+rename to browser/components/search/searchplugins/wikipedia-kab.xml
+diff --git a/browser/locales/searchplugins/wikipedia-kk.xml b/browser/components/search/searchplugins/wikipedia-kk.xml
+rename from browser/locales/searchplugins/wikipedia-kk.xml
+rename to browser/components/search/searchplugins/wikipedia-kk.xml
+diff --git a/browser/locales/searchplugins/wikipedia-km.xml b/browser/components/search/searchplugins/wikipedia-km.xml
+rename from browser/locales/searchplugins/wikipedia-km.xml
+rename to browser/components/search/searchplugins/wikipedia-km.xml
+diff --git a/browser/locales/searchplugins/wikipedia-kn.xml b/browser/components/search/searchplugins/wikipedia-kn.xml
+rename from browser/locales/searchplugins/wikipedia-kn.xml
+rename to browser/components/search/searchplugins/wikipedia-kn.xml
+diff --git a/browser/locales/searchplugins/wikipedia-kr.xml b/browser/components/search/searchplugins/wikipedia-kr.xml
+rename from browser/locales/searchplugins/wikipedia-kr.xml
+rename to browser/components/search/searchplugins/wikipedia-kr.xml
+diff --git a/browser/locales/searchplugins/wikipedia-lij.xml b/browser/components/search/searchplugins/wikipedia-lij.xml
+rename from browser/locales/searchplugins/wikipedia-lij.xml
+rename to browser/components/search/searchplugins/wikipedia-lij.xml
+diff --git a/browser/locales/searchplugins/wikipedia-lo.xml b/browser/components/search/searchplugins/wikipedia-lo.xml
+rename from browser/locales/searchplugins/wikipedia-lo.xml
+rename to browser/components/search/searchplugins/wikipedia-lo.xml
+diff --git a/browser/locales/searchplugins/wikipedia-lt.xml b/browser/components/search/searchplugins/wikipedia-lt.xml
+rename from browser/locales/searchplugins/wikipedia-lt.xml
+rename to browser/components/search/searchplugins/wikipedia-lt.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ltg.xml b/browser/components/search/searchplugins/wikipedia-ltg.xml
+rename from browser/locales/searchplugins/wikipedia-ltg.xml
+rename to browser/components/search/searchplugins/wikipedia-ltg.xml
+diff --git a/browser/locales/searchplugins/wikipedia-lv.xml b/browser/components/search/searchplugins/wikipedia-lv.xml
+rename from browser/locales/searchplugins/wikipedia-lv.xml
+rename to browser/components/search/searchplugins/wikipedia-lv.xml
+diff --git a/browser/locales/searchplugins/wikipedia-mk.xml b/browser/components/search/searchplugins/wikipedia-mk.xml
+rename from browser/locales/searchplugins/wikipedia-mk.xml
+rename to browser/components/search/searchplugins/wikipedia-mk.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ml.xml b/browser/components/search/searchplugins/wikipedia-ml.xml
+rename from browser/locales/searchplugins/wikipedia-ml.xml
+rename to browser/components/search/searchplugins/wikipedia-ml.xml
+diff --git a/browser/locales/searchplugins/wikipedia-mr.xml b/browser/components/search/searchplugins/wikipedia-mr.xml
+rename from browser/locales/searchplugins/wikipedia-mr.xml
+rename to browser/components/search/searchplugins/wikipedia-mr.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ms.xml b/browser/components/search/searchplugins/wikipedia-ms.xml
+rename from browser/locales/searchplugins/wikipedia-ms.xml
+rename to browser/components/search/searchplugins/wikipedia-ms.xml
+diff --git a/browser/locales/searchplugins/wikipedia-my.xml b/browser/components/search/searchplugins/wikipedia-my.xml
+rename from browser/locales/searchplugins/wikipedia-my.xml
+rename to browser/components/search/searchplugins/wikipedia-my.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ne.xml b/browser/components/search/searchplugins/wikipedia-ne.xml
+rename from browser/locales/searchplugins/wikipedia-ne.xml
+rename to browser/components/search/searchplugins/wikipedia-ne.xml
+diff --git a/browser/locales/searchplugins/wikipedia-nl.xml b/browser/components/search/searchplugins/wikipedia-nl.xml
+rename from browser/locales/searchplugins/wikipedia-nl.xml
+rename to browser/components/search/searchplugins/wikipedia-nl.xml
+diff --git a/browser/locales/searchplugins/wikipedia-oc.xml b/browser/components/search/searchplugins/wikipedia-oc.xml
+rename from browser/locales/searchplugins/wikipedia-oc.xml
+rename to browser/components/search/searchplugins/wikipedia-oc.xml
+diff --git a/browser/locales/searchplugins/wikipedia-or.xml b/browser/components/search/searchplugins/wikipedia-or.xml
+rename from browser/locales/searchplugins/wikipedia-or.xml
+rename to browser/components/search/searchplugins/wikipedia-or.xml
+diff --git a/browser/locales/searchplugins/wikipedia-pa.xml b/browser/components/search/searchplugins/wikipedia-pa.xml
+rename from browser/locales/searchplugins/wikipedia-pa.xml
+rename to browser/components/search/searchplugins/wikipedia-pa.xml
+diff --git a/browser/locales/searchplugins/wikipedia-pl.xml b/browser/components/search/searchplugins/wikipedia-pl.xml
+rename from browser/locales/searchplugins/wikipedia-pl.xml
+rename to browser/components/search/searchplugins/wikipedia-pl.xml
+diff --git a/browser/locales/searchplugins/wikipedia-pt.xml b/browser/components/search/searchplugins/wikipedia-pt.xml
+rename from browser/locales/searchplugins/wikipedia-pt.xml
+rename to browser/components/search/searchplugins/wikipedia-pt.xml
+diff --git a/browser/locales/searchplugins/wikipedia-rm.xml b/browser/components/search/searchplugins/wikipedia-rm.xml
+rename from browser/locales/searchplugins/wikipedia-rm.xml
+rename to browser/components/search/searchplugins/wikipedia-rm.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ro.xml b/browser/components/search/searchplugins/wikipedia-ro.xml
+rename from browser/locales/searchplugins/wikipedia-ro.xml
+rename to browser/components/search/searchplugins/wikipedia-ro.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ru.xml b/browser/components/search/searchplugins/wikipedia-ru.xml
+rename from browser/locales/searchplugins/wikipedia-ru.xml
+rename to browser/components/search/searchplugins/wikipedia-ru.xml
+diff --git a/browser/locales/searchplugins/wikipedia-si.xml b/browser/components/search/searchplugins/wikipedia-si.xml
+rename from browser/locales/searchplugins/wikipedia-si.xml
+rename to browser/components/search/searchplugins/wikipedia-si.xml
+diff --git a/browser/locales/searchplugins/wikipedia-sk.xml b/browser/components/search/searchplugins/wikipedia-sk.xml
+rename from browser/locales/searchplugins/wikipedia-sk.xml
+rename to browser/components/search/searchplugins/wikipedia-sk.xml
+diff --git a/browser/locales/searchplugins/wikipedia-sl.xml b/browser/components/search/searchplugins/wikipedia-sl.xml
+rename from browser/locales/searchplugins/wikipedia-sl.xml
+rename to browser/components/search/searchplugins/wikipedia-sl.xml
+diff --git a/browser/locales/searchplugins/wikipedia-sq.xml b/browser/components/search/searchplugins/wikipedia-sq.xml
+rename from browser/locales/searchplugins/wikipedia-sq.xml
+rename to browser/components/search/searchplugins/wikipedia-sq.xml
+diff --git a/browser/locales/searchplugins/wikipedia-sr.xml b/browser/components/search/searchplugins/wikipedia-sr.xml
+rename from browser/locales/searchplugins/wikipedia-sr.xml
+rename to browser/components/search/searchplugins/wikipedia-sr.xml
+diff --git a/browser/locales/searchplugins/wikipedia-sv-SE.xml b/browser/components/search/searchplugins/wikipedia-sv-SE.xml
+rename from browser/locales/searchplugins/wikipedia-sv-SE.xml
+rename to browser/components/search/searchplugins/wikipedia-sv-SE.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ta.xml b/browser/components/search/searchplugins/wikipedia-ta.xml
+rename from browser/locales/searchplugins/wikipedia-ta.xml
+rename to browser/components/search/searchplugins/wikipedia-ta.xml
+diff --git a/browser/locales/searchplugins/wikipedia-te.xml b/browser/components/search/searchplugins/wikipedia-te.xml
+rename from browser/locales/searchplugins/wikipedia-te.xml
+rename to browser/components/search/searchplugins/wikipedia-te.xml
+diff --git a/browser/locales/searchplugins/wikipedia-th.xml b/browser/components/search/searchplugins/wikipedia-th.xml
+rename from browser/locales/searchplugins/wikipedia-th.xml
+rename to browser/components/search/searchplugins/wikipedia-th.xml
+diff --git a/browser/locales/searchplugins/wikipedia-tl.xml b/browser/components/search/searchplugins/wikipedia-tl.xml
+rename from browser/locales/searchplugins/wikipedia-tl.xml
+rename to browser/components/search/searchplugins/wikipedia-tl.xml
+diff --git a/browser/locales/searchplugins/wikipedia-tr.xml b/browser/components/search/searchplugins/wikipedia-tr.xml
+rename from browser/locales/searchplugins/wikipedia-tr.xml
+rename to browser/components/search/searchplugins/wikipedia-tr.xml
+diff --git a/browser/locales/searchplugins/wikipedia-uk.xml b/browser/components/search/searchplugins/wikipedia-uk.xml
+rename from browser/locales/searchplugins/wikipedia-uk.xml
+rename to browser/components/search/searchplugins/wikipedia-uk.xml
+diff --git a/browser/locales/searchplugins/wikipedia-ur.xml b/browser/components/search/searchplugins/wikipedia-ur.xml
+rename from browser/locales/searchplugins/wikipedia-ur.xml
+rename to browser/components/search/searchplugins/wikipedia-ur.xml
+diff --git a/browser/locales/searchplugins/wikipedia-uz.xml b/browser/components/search/searchplugins/wikipedia-uz.xml
+rename from browser/locales/searchplugins/wikipedia-uz.xml
+rename to browser/components/search/searchplugins/wikipedia-uz.xml
+diff --git a/browser/locales/searchplugins/wikipedia-vi.xml b/browser/components/search/searchplugins/wikipedia-vi.xml
+rename from browser/locales/searchplugins/wikipedia-vi.xml
+rename to browser/components/search/searchplugins/wikipedia-vi.xml
+diff --git a/browser/locales/searchplugins/wikipedia-wo.xml b/browser/components/search/searchplugins/wikipedia-wo.xml
+rename from browser/locales/searchplugins/wikipedia-wo.xml
+rename to browser/components/search/searchplugins/wikipedia-wo.xml
+diff --git a/browser/locales/searchplugins/wikipedia-zh-CN.xml b/browser/components/search/searchplugins/wikipedia-zh-CN.xml
+rename from browser/locales/searchplugins/wikipedia-zh-CN.xml
+rename to browser/components/search/searchplugins/wikipedia-zh-CN.xml
+diff --git a/browser/locales/searchplugins/wikipedia-zh-TW.xml b/browser/components/search/searchplugins/wikipedia-zh-TW.xml
+rename from browser/locales/searchplugins/wikipedia-zh-TW.xml
+rename to browser/components/search/searchplugins/wikipedia-zh-TW.xml
+diff --git a/browser/locales/searchplugins/wikipedia.xml b/browser/components/search/searchplugins/wikipedia.xml
+rename from browser/locales/searchplugins/wikipedia.xml
+rename to browser/components/search/searchplugins/wikipedia.xml
+diff --git a/browser/locales/searchplugins/wiktionary-oc.xml b/browser/components/search/searchplugins/wiktionary-oc.xml
+rename from browser/locales/searchplugins/wiktionary-oc.xml
+rename to browser/components/search/searchplugins/wiktionary-oc.xml
+diff --git a/browser/locales/searchplugins/wiktionary-te.xml b/browser/components/search/searchplugins/wiktionary-te.xml
+rename from browser/locales/searchplugins/wiktionary-te.xml
+rename to browser/components/search/searchplugins/wiktionary-te.xml
+diff --git a/browser/locales/searchplugins/wolnelektury-pl.xml b/browser/components/search/searchplugins/wolnelektury-pl.xml
+rename from browser/locales/searchplugins/wolnelektury-pl.xml
+rename to browser/components/search/searchplugins/wolnelektury-pl.xml
+diff --git a/browser/locales/searchplugins/yahoo-NO.xml b/browser/components/search/searchplugins/yahoo-NO.xml
+rename from browser/locales/searchplugins/yahoo-NO.xml
+rename to browser/components/search/searchplugins/yahoo-NO.xml
+diff --git a/browser/locales/searchplugins/yahoo-answer-zh-TW.xml b/browser/components/search/searchplugins/yahoo-answer-zh-TW.xml
+rename from browser/locales/searchplugins/yahoo-answer-zh-TW.xml
+rename to browser/components/search/searchplugins/yahoo-answer-zh-TW.xml
+diff --git a/browser/locales/searchplugins/yahoo-ar.xml b/browser/components/search/searchplugins/yahoo-ar.xml
+rename from browser/locales/searchplugins/yahoo-ar.xml
+rename to browser/components/search/searchplugins/yahoo-ar.xml
+diff --git a/browser/locales/searchplugins/yahoo-bid-zh-TW.xml b/browser/components/search/searchplugins/yahoo-bid-zh-TW.xml
+rename from browser/locales/searchplugins/yahoo-bid-zh-TW.xml
+rename to browser/components/search/searchplugins/yahoo-bid-zh-TW.xml
+diff --git a/browser/locales/searchplugins/yahoo-br.xml b/browser/components/search/searchplugins/yahoo-br.xml
+rename from browser/locales/searchplugins/yahoo-br.xml
+rename to browser/components/search/searchplugins/yahoo-br.xml
+diff --git a/browser/locales/searchplugins/yahoo-ch.xml b/browser/components/search/searchplugins/yahoo-ch.xml
+rename from browser/locales/searchplugins/yahoo-ch.xml
+rename to browser/components/search/searchplugins/yahoo-ch.xml
+diff --git a/browser/locales/searchplugins/yahoo-cl.xml b/browser/components/search/searchplugins/yahoo-cl.xml
+rename from browser/locales/searchplugins/yahoo-cl.xml
+rename to browser/components/search/searchplugins/yahoo-cl.xml
+diff --git a/browser/locales/searchplugins/yahoo-de.xml b/browser/components/search/searchplugins/yahoo-de.xml
+rename from browser/locales/searchplugins/yahoo-de.xml
+rename to browser/components/search/searchplugins/yahoo-de.xml
+diff --git a/browser/locales/searchplugins/yahoo-en-CA.xml b/browser/components/search/searchplugins/yahoo-en-CA.xml
+rename from browser/locales/searchplugins/yahoo-en-CA.xml
+rename to browser/components/search/searchplugins/yahoo-en-CA.xml
+diff --git a/browser/locales/searchplugins/yahoo-en-GB.xml b/browser/components/search/searchplugins/yahoo-en-GB.xml
+rename from browser/locales/searchplugins/yahoo-en-GB.xml
+rename to browser/components/search/searchplugins/yahoo-en-GB.xml
+diff --git a/browser/locales/searchplugins/yahoo-es.xml b/browser/components/search/searchplugins/yahoo-es.xml
+rename from browser/locales/searchplugins/yahoo-es.xml
+rename to browser/components/search/searchplugins/yahoo-es.xml
+diff --git a/browser/locales/searchplugins/yahoo-espanol.xml b/browser/components/search/searchplugins/yahoo-espanol.xml
+rename from browser/locales/searchplugins/yahoo-espanol.xml
+rename to browser/components/search/searchplugins/yahoo-espanol.xml
+diff --git a/browser/locales/searchplugins/yahoo-fi.xml b/browser/components/search/searchplugins/yahoo-fi.xml
+rename from browser/locales/searchplugins/yahoo-fi.xml
+rename to browser/components/search/searchplugins/yahoo-fi.xml
+diff --git a/browser/locales/searchplugins/yahoo-france.xml b/browser/components/search/searchplugins/yahoo-france.xml
+rename from browser/locales/searchplugins/yahoo-france.xml
+rename to browser/components/search/searchplugins/yahoo-france.xml
+diff --git a/browser/locales/searchplugins/yahoo-fy-NL.xml b/browser/components/search/searchplugins/yahoo-fy-NL.xml
+rename from browser/locales/searchplugins/yahoo-fy-NL.xml
+rename to browser/components/search/searchplugins/yahoo-fy-NL.xml
+diff --git a/browser/locales/searchplugins/yahoo-id.xml b/browser/components/search/searchplugins/yahoo-id.xml
+rename from browser/locales/searchplugins/yahoo-id.xml
+rename to browser/components/search/searchplugins/yahoo-id.xml
+diff --git a/browser/locales/searchplugins/yahoo-in.xml b/browser/components/search/searchplugins/yahoo-in.xml
+rename from browser/locales/searchplugins/yahoo-in.xml
+rename to browser/components/search/searchplugins/yahoo-in.xml
+diff --git a/browser/locales/searchplugins/yahoo-it.xml b/browser/components/search/searchplugins/yahoo-it.xml
+rename from browser/locales/searchplugins/yahoo-it.xml
+rename to browser/components/search/searchplugins/yahoo-it.xml
+diff --git a/browser/locales/searchplugins/yahoo-jp-auctions.xml b/browser/components/search/searchplugins/yahoo-jp-auctions.xml
+rename from browser/locales/searchplugins/yahoo-jp-auctions.xml
+rename to browser/components/search/searchplugins/yahoo-jp-auctions.xml
+diff --git a/browser/locales/searchplugins/yahoo-jp.xml b/browser/components/search/searchplugins/yahoo-jp.xml
+rename from browser/locales/searchplugins/yahoo-jp.xml
+rename to browser/components/search/searchplugins/yahoo-jp.xml
+diff --git a/browser/locales/searchplugins/yahoo-mx.xml b/browser/components/search/searchplugins/yahoo-mx.xml
+rename from browser/locales/searchplugins/yahoo-mx.xml
+rename to browser/components/search/searchplugins/yahoo-mx.xml
+diff --git a/browser/locales/searchplugins/yahoo-sv-SE.xml b/browser/components/search/searchplugins/yahoo-sv-SE.xml
+rename from browser/locales/searchplugins/yahoo-sv-SE.xml
+rename to browser/components/search/searchplugins/yahoo-sv-SE.xml
+diff --git a/browser/locales/searchplugins/yahoo-tl.xml b/browser/components/search/searchplugins/yahoo-tl.xml
+rename from browser/locales/searchplugins/yahoo-tl.xml
+rename to browser/components/search/searchplugins/yahoo-tl.xml
+diff --git a/browser/locales/searchplugins/yahoo-zh-TW-HK.xml b/browser/components/search/searchplugins/yahoo-zh-TW-HK.xml
+rename from browser/locales/searchplugins/yahoo-zh-TW-HK.xml
+rename to browser/components/search/searchplugins/yahoo-zh-TW-HK.xml
+diff --git a/browser/locales/searchplugins/yahoo-zh-TW.xml b/browser/components/search/searchplugins/yahoo-zh-TW.xml
+rename from browser/locales/searchplugins/yahoo-zh-TW.xml
+rename to browser/components/search/searchplugins/yahoo-zh-TW.xml
+diff --git a/browser/locales/searchplugins/yahoo.xml b/browser/components/search/searchplugins/yahoo.xml
+rename from browser/locales/searchplugins/yahoo.xml
+rename to browser/components/search/searchplugins/yahoo.xml
+diff --git a/browser/locales/searchplugins/yandex-az.xml b/browser/components/search/searchplugins/yandex-az.xml
+rename from browser/locales/searchplugins/yandex-az.xml
+rename to browser/components/search/searchplugins/yandex-az.xml
+diff --git a/browser/locales/searchplugins/yandex-by.xml b/browser/components/search/searchplugins/yandex-by.xml
+rename from browser/locales/searchplugins/yandex-by.xml
+rename to browser/components/search/searchplugins/yandex-by.xml
+diff --git a/browser/locales/searchplugins/yandex-en.xml b/browser/components/search/searchplugins/yandex-en.xml
+rename from browser/locales/searchplugins/yandex-en.xml
+rename to browser/components/search/searchplugins/yandex-en.xml
+diff --git a/browser/locales/searchplugins/yandex-kk.xml b/browser/components/search/searchplugins/yandex-kk.xml
+rename from browser/locales/searchplugins/yandex-kk.xml
+rename to browser/components/search/searchplugins/yandex-kk.xml
+diff --git a/browser/locales/searchplugins/yandex-ru.xml b/browser/components/search/searchplugins/yandex-ru.xml
+rename from browser/locales/searchplugins/yandex-ru.xml
+rename to browser/components/search/searchplugins/yandex-ru.xml
+diff --git a/browser/locales/searchplugins/yandex-tr.xml b/browser/components/search/searchplugins/yandex-tr.xml
+rename from browser/locales/searchplugins/yandex-tr.xml
+rename to browser/components/search/searchplugins/yandex-tr.xml
+diff --git a/browser/locales/searchplugins/yandex-uk.xml b/browser/components/search/searchplugins/yandex-uk.xml
+rename from browser/locales/searchplugins/yandex-uk.xml
+rename to browser/components/search/searchplugins/yandex-uk.xml
+diff --git a/browser/locales/searchplugins/zoznam-sk.xml b/browser/components/search/searchplugins/zoznam-sk.xml
+rename from browser/locales/searchplugins/zoznam-sk.xml
+rename to browser/components/search/searchplugins/zoznam-sk.xml
+diff --git a/browser/components/search/test/browser.ini b/browser/components/search/test/browser.ini
+--- a/browser/components/search/test/browser.ini
++++ b/browser/components/search/test/browser.ini
+@@ -19,21 +19,18 @@ support-files =
+ [browser_addEngine.js]
+ [browser_amazon.js]
+ [browser_bing.js]
+ [browser_contextmenu.js]
+ [browser_contextSearchTabPosition.js]
+ skip-if = os == "mac" # bug 967013
+ [browser_ddg.js]
+ [browser_eBay.js]
+-skip-if = artifact # bug 1315953
+ [browser_google.js]
+-skip-if = artifact # bug 1315953
+ [browser_google_behavior.js]
+-skip-if = artifact # bug 1315953
+ [browser_healthreport.js]
+ [browser_hiddenOneOffs_cleanup.js]
+ [browser_hiddenOneOffs_diacritics.js]
+ [browser_oneOffContextMenu.js]
+ [browser_oneOffContextMenu_setDefault.js]
+ [browser_oneOffHeader.js]
+ skip-if = os == "mac" #1421238
+ [browser_private_search_perwindowpb.js]
+diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
+--- a/browser/locales/Makefile.in
++++ b/browser/locales/Makefile.in
+@@ -38,42 +38,24 @@ MOZ_PKG_MAC_EXTRA=--symlink '/Applicatio
+ endif
+ 
+ ifeq ($(CPU_ARCH), aarch64)
+ MOZ_SFX_PACKAGE=$(topsrcdir)/other-licenses/7zstub/firefox/7zSD.ARM64.sfx
+ else
+ MOZ_SFX_PACKAGE=$(topsrcdir)/other-licenses/7zstub/firefox/7zSD.Win32.sfx
+ endif
+ 
+-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)
+-SEARCHPLUGINS_TARGET := libs searchplugins
+-SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_FILENAMES)),$(or $(wildcard $(srcdir)/searchplugins/$(plugin)),$(error Missing searchplugin: $(plugin))))
+-# Some locale-specific search plugins may have preprocessor directives, but the
+-# default en-US ones do not.
+-SEARCHPLUGINS_FLAGS := --silence-missing-directive-warnings
+-PP_TARGETS += SEARCHPLUGINS
+-
+-list-json = $(SEARCHPLUGINS_PATH)/list.json
+-GARBAGE += $(list-json)
+-
+-libs:: searchplugins
+-
+ # Required for l10n.mk - defines a list of app sub dirs that should
+ # be included in langpack xpis.
+ DIST_SUBDIRS = $(DIST_SUBDIR)
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
+ include $(topsrcdir)/toolkit/locales/l10n.mk
+ 
+-$(list-json): $(call mkdir_deps,$(SEARCHPLUGINS_PATH)) $(if $(IS_LANGUAGE_REPACK),FORCE)
+-	$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(list-json))
+-searchplugins:: $(list-json)
+-
+ libs-%: AB_CD=$*
+ libs-%:
+ 	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
+ 	$(NSINSTALL) -D $(DIST)/install
+ 	@$(MAKE) -C ../../toolkit/locales libs-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+ ifneq (,$(wildcard ../extensions/formautofill/locales))
+@@ -81,17 +63,16 @@ ifneq (,$(wildcard ../extensions/formaut
+ endif
+ 	@$(MAKE) -C ../extensions/jaws-esr/locales AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C ../extensions/pocket/locale AB_CD=$* XPI_NAME=locale-$*
+ ifneq '$(or $(MOZ_DEV_EDITION),$(NIGHTLY_BUILD))' ''
+ 	@$(MAKE) -C ../extensions/webcompat-reporter/locales AB_CD=$* XPI_NAME=locale-$*
+ endif
+ 	@$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ 	@$(MAKE) -C ../../devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+-	@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
+ 	@$(MAKE) multilocale.txt-$* AB_CD=$* XPI_NAME=locale-$*
+ 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
+ 
+ chrome-%: AB_CD=$*
+ chrome-%: IS_LANGUAGE_REPACK=1
+ chrome-%:
+ 	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
+diff --git a/browser/locales/jar.mn b/browser/locales/jar.mn
+--- a/browser/locales/jar.mn
++++ b/browser/locales/jar.mn
+@@ -80,29 +80,16 @@
+     locale/browser/preferences/search.dtd             (%chrome/browser/preferences/search.dtd)
+     locale/browser/preferences/security.dtd           (%chrome/browser/preferences/security.dtd)
+     locale/browser/preferences/selectBookmark.dtd     (%chrome/browser/preferences/selectBookmark.dtd)
+     locale/browser/preferences/siteDataSettings.dtd     (%chrome/browser/preferences/siteDataSettings.dtd)
+     locale/browser/preferences/sync.dtd               (%chrome/browser/preferences/sync.dtd)
+     locale/browser/preferences/translation.dtd        (%chrome/browser/preferences/translation.dtd)
+     locale/browser/syncBrand.dtd                (%chrome/browser/syncBrand.dtd)
+     locale/browser/syncSetup.properties         (%chrome/browser/syncSetup.properties)
+-#if BUILD_FASTER
+-    locale/browser/searchplugins/               (searchplugins/*.xml)
+-    locale/browser/searchplugins/list.json      (search/list.json)
+-#else
+-    locale/browser/searchplugins/               (.deps/generated_@AB_CD@/*.xml)
+-    locale/browser/searchplugins/list.json      (.deps/generated_@AB_CD@/list.json)
+-#endif
+-    locale/browser/searchplugins/images/amazon.ico     (searchplugins/images/amazon.ico)
+-    locale/browser/searchplugins/images/ebay.ico       (searchplugins/images/ebay.ico)
+-    locale/browser/searchplugins/images/wikipedia.ico  (searchplugins/images/wikipedia.ico)
+-    locale/browser/searchplugins/images/yahoo.ico      (searchplugins/images/yahoo.ico)
+-    locale/browser/searchplugins/images/yandex-en.ico  (searchplugins/images/yandex-en.ico)
+-    locale/browser/searchplugins/images/yandex-ru.ico  (searchplugins/images/yandex-ru.ico)
+ % locale browser-region @AB_CD@ %locale/browser-region/
+     locale/browser-region/region.properties        (%chrome/browser-region/region.properties)
+ # the following files are browser-specific overrides
+     locale/browser/netError.dtd                (%chrome/overrides/netError.dtd)
+     locale/browser/appstrings.properties       (%chrome/overrides/appstrings.properties)
+     locale/browser/downloads/settingsChange.dtd  (%chrome/overrides/settingsChange.dtd)
+ % locale pdf.js @AB_CD@ %locale/pdfviewer/
+     locale/pdfviewer/viewer.properties             (%pdfviewer/viewer.properties)
+diff --git a/browser/locales/moz.build b/browser/locales/moz.build
+--- a/browser/locales/moz.build
++++ b/browser/locales/moz.build
+@@ -39,16 +39,10 @@ with Files("**"):
+     BUG_COMPONENT = ("Toolkit", "Build Config")
+ 
+ with Files("all-locales"):
+     BUG_COMPONENT = ("Core", "Localization")
+ 
+ with Files("en-US/**"):
+     BUG_COMPONENT = ("Core", "Localization")
+ 
+-with Files("search/**"):
+-    BUG_COMPONENT = ("Firefox", "Search")
+-
+-with Files("searchplugins/**"):
+-    BUG_COMPONENT = ("Firefox", "Search")
+-
+ with Files("shipped-locales"):
+     BUG_COMPONENT = ("Core", "Localization")
+diff --git a/browser/modules/ContentSearch.jsm b/browser/modules/ContentSearch.jsm
+--- a/browser/modules/ContentSearch.jsm
++++ b/browser/modules/ContentSearch.jsm
+@@ -102,16 +102,17 @@ var ContentSearch = {
+   _destroyedPromise: null,
+ 
+   // The current controller and browser in _onMessageGetSuggestions.  Allows
+   // fetch cancellation from _cancelSuggestions.
+   _currentSuggestion: null,
+ 
+   init() {
+     Services.obs.addObserver(this, "browser-search-engine-modified");
++    Services.obs.addObserver(this, "browser-search-service");
+     Services.obs.addObserver(this, "shutdown-leaks-before-check");
+     Services.prefs.addObserver("browser.search.hiddenOneOffs", this);
+     this._stringBundle = Services.strings.createBundle("chrome://global/locale/autocomplete.properties");
+   },
+ 
+   get searchSuggestionUIStrings() {
+     if (this._searchSuggestionUIStrings) {
+       return this._searchSuggestionUIStrings;
+@@ -128,16 +129,17 @@ var ContentSearch = {
+   },
+ 
+   destroy() {
+     if (this._destroyedPromise) {
+       return this._destroyedPromise;
+     }
+ 
+     Services.obs.removeObserver(this, "browser-search-engine-modified");
++    Services.obs.removeObserver(this, "browser-search-service");
+     Services.obs.removeObserver(this, "shutdown-leaks-before-check");
+ 
+     this._eventQueue.length = 0;
+     this._destroyedPromise = Promise.resolve(this._currentEventPromise);
+     return this._destroyedPromise;
+   },
+ 
+   /**
+@@ -179,16 +181,20 @@ var ContentSearch = {
+       type: "Message",
+       data: msg,
+     });
+     this._processEventQueue();
+   },
+ 
+   observe(subj, topic, data) {
+     switch (topic) {
++    case "browser-search-service":
++      if (data != "init-complete") {
++        break;
++      }
+     case "nsPref:changed":
+     case "browser-search-engine-modified":
+       this._eventQueue.push({
+         type: "Observe",
+         data,
+       });
+       this._processEventQueue();
+       break;
+diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js
+--- a/toolkit/components/search/nsSearchService.js
++++ b/toolkit/components/search/nsSearchService.js
+@@ -51,17 +51,17 @@ const NS_APP_DISTRIBUTION_SEARCH_DIR_LIS
+ const NS_APP_USER_PROFILE_50_DIR = "ProfD";
+ 
+ // We load plugins from APP_SEARCH_PREFIX, where a list.txt
+ // file needs to exist to list available engines.
+ const APP_SEARCH_PREFIX = "resource://search-plugins/";
+ 
+ // See documentation in nsIBrowserSearchService.idl.
+ const SEARCH_ENGINE_TOPIC        = "browser-search-engine-modified";
+-const REQ_LOCALES_CHANGED_TOPIC  = "intl:requested-locales-changed";
++const TOPIC_LOCALES_CHANGE       = "intl:app-locales-changed";
+ const QUIT_APPLICATION_TOPIC     = "quit-application";
+ 
+ const SEARCH_ENGINE_REMOVED      = "engine-removed";
+ const SEARCH_ENGINE_ADDED        = "engine-added";
+ const SEARCH_ENGINE_CHANGED      = "engine-changed";
+ const SEARCH_ENGINE_LOADED       = "engine-loaded";
+ const SEARCH_ENGINE_CURRENT      = "engine-current";
+ const SEARCH_ENGINE_DEFAULT      = "engine-default";
+@@ -3064,19 +3064,19 @@ SearchService.prototype = {
+         await ensureKnownCountryCode(this);
+         // Due to the HTTP requests done by ensureKnownCountryCode, it's possible that
+         // at this point a synchronous init has been forced by other code.
+         if (!gInitialized)
+           await this._asyncLoadEngines(cache);
+ 
+         // Typically we'll re-init as a result of a pref observer,
+         // so signal to 'callers' that we're done.
++        gInitialized = true;
+         Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete");
+         this._recordEngineTelemetry();
+-        gInitialized = true;
+       } catch (err) {
+         LOG("Reinit failed: " + err);
+         Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "reinit-failed");
+       } finally {
+         Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "reinit-complete");
+       }
+     })();
+   },
+@@ -3479,24 +3479,41 @@ SearchService.prototype = {
+       this._parseListJSON(list, uris);
+     }
+     return uris;
+   },
+ 
+   _parseListJSON: function SRCH_SVC_parseListJSON(list, uris) {
+     let searchRegion =  Services.prefs.getCharPref("browser.search.region", "");
+ 
+-    let searchSettings;
++    let json;
+     try {
+-      searchSettings = JSON.parse(list);
++      json = JSON.parse(list);
+     } catch (e) {
+-      LOG("failing to parse list.json: " + e);
++      Cu.reportError("parseListJSON: Failed to parse list.json: " + e);
++      dump("parseListJSON: Failed to parse list.json: " + e + "\n");
+       return;
+     }
+ 
++    let searchSettings;
++    let locale = Services.locale.getAppLocaleAsBCP47();
++    if ("locales" in json &&
++        locale in json.locales) {
++      searchSettings = json.locales[locale];
++    } else {
++      // No locales were found, so use the JSON as is.
++      // It should have a default section.
++      if (!("default" in json)) {
++        Cu.reportError("parseListJSON: Missing default in list.json");
++        dump("parseListJSON: Missing default in list.json\n");
++        return;
++      }
++      searchSettings = json;
++    }
++
+     // Check if we have a useable country specific list of visible default engines.
+     // This will only be set if we got the list from the Mozilla search server;
+     // it will not be set for distributions.
+     let engineNames;
+     let visibleDefaultEngines = this.getVerifiedGlobalAttr("visibleDefaultEngines");
+     if (visibleDefaultEngines) {
+       let jarNames = new Set();
+       for (let region in searchSettings) {
+@@ -3543,17 +3560,17 @@ SearchService.prototype = {
+         "visibleDefaultEngines" in searchSettings[searchRegion]) {
+         engineNames = searchSettings[searchRegion].visibleDefaultEngines;
+       } else {
+         engineNames = searchSettings.default.visibleDefaultEngines;
+       }
+     }
+ 
+     // Remove any engine names that are supposed to be ignored.
+-    // This pref is only allows in a partner distribution.
++    // This pref is only allowed in a partner distribution.
+     let branch = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF);
+     if (isPartnerBuild() &&
+         branch.getPrefType("ignoredJAREngines") == branch.PREF_STRING) {
+       let ignoredJAREngines = branch.getCharPref("ignoredJAREngines")
+                                     .split(",");
+       let filteredEngineNames = engineNames.filter(e => !ignoredJAREngines.includes(e));
+       // Don't allow all engines to be hidden
+       if (filteredEngineNames.length > 0) {
+@@ -3571,35 +3588,53 @@ SearchService.prototype = {
+       for (let engine in esrOverrides) {
+         let index = engineNames.indexOf(engine);
+         if (index > -1) {
+           engineNames[index] = esrOverrides[engine];
+         }
+       }
+     }
+ 
++    if ("regionOverrides" in json &&
++        searchRegion in json.regionOverrides) {
++      for (let engine in json.regionOverrides[searchRegion]) {
++        let index = engineNames.indexOf(engine);
++        if (index > -1) {
++          engineNames[index] = json.regionOverrides[searchRegion][engine];
++        }
++      }
++    }
++
+     for (let name of engineNames) {
+       uris.push(APP_SEARCH_PREFIX + name + ".xml");
+     }
+ 
+     // Store this so that it can be used while writing the cache file.
+     this._visibleDefaultEngines = engineNames;
+ 
+     if (searchRegion && searchRegion in searchSettings &&
+         "searchDefault" in searchSettings[searchRegion]) {
+       this._searchDefault = searchSettings[searchRegion].searchDefault;
++    } else if ("searchDefault" in searchSettings.default) {
++      this._searchDefault = searchSettings.default.searchDefault;
+     } else {
+-      this._searchDefault = searchSettings.default.searchDefault;
++      this._searchDefault = json.default.searchDefault;
++    }
++
++    if (!this._searchDefault) {
++      Cu.reportError("parseListJSON: No searchDefault");
+     }
+ 
+     if (searchRegion && searchRegion in searchSettings &&
+         "searchOrder" in searchSettings[searchRegion]) {
+       this._searchOrder = searchSettings[searchRegion].searchOrder;
+     } else if ("searchOrder" in searchSettings.default) {
+       this._searchOrder = searchSettings.default.searchOrder;
++    } else if ("searchOrder" in json.default) {
++      this._searchOrder = json.default.searchOrder;
+     }
+   },
+ 
+   _parseListTxt: function SRCH_SVC_parseListTxt(list, uris) {
+     let names = list.split("\n").filter(n => !!n);
+     // This maps the names of our built-in engines to a boolean
+     // indicating whether it should be hidden by default.
+     let jarNames = new Map();
+@@ -4555,19 +4590,20 @@ SearchService.prototype = {
+             break;
+         }
+         break;
+ 
+       case QUIT_APPLICATION_TOPIC:
+         this._removeObservers();
+         break;
+ 
+-      case REQ_LOCALES_CHANGED_TOPIC:
++      case TOPIC_LOCALES_CHANGE:
+         // Locale changed. Re-init. We rely on observers, because we can't
+         // return this promise to anyone.
++        // FYI, This is also used by the search tests to do an async reinit.
+         this._asyncReInit();
+         break;
+     }
+   },
+ 
+   // nsITimerCallback
+   notify: function SRCH_SVC_notify(aTimer) {
+     LOG("_notify: checking for updates");
+@@ -4612,20 +4648,17 @@ SearchService.prototype = {
+       // There might be a race between synchronous and asynchronous
+       // initialization for which we try to register the observers twice.
+       return;
+     }
+     this._observersAdded = true;
+ 
+     Services.obs.addObserver(this, SEARCH_ENGINE_TOPIC);
+     Services.obs.addObserver(this, QUIT_APPLICATION_TOPIC);
+-
+-    if (AppConstants.MOZ_BUILD_APP == "mobile/android") {
+-      Services.obs.addObserver(this, REQ_LOCALES_CHANGED_TOPIC);
+-    }
++    Services.obs.addObserver(this, TOPIC_LOCALES_CHANGE);
+ 
+     // The current stage of shutdown. Used to help analyze crash
+     // signatures in case of shutdown timeout.
+     let shutdownState = {
+       step: "Not started",
+       latestError: {
+         message: undefined,
+         stack: undefined
+@@ -4657,20 +4690,17 @@ SearchService.prototype = {
+       () => shutdownState
+     );
+   },
+   _observersAdded: false,
+ 
+   _removeObservers: function SRCH_SVC_removeObservers() {
+     Services.obs.removeObserver(this, SEARCH_ENGINE_TOPIC);
+     Services.obs.removeObserver(this, QUIT_APPLICATION_TOPIC);
+-
+-    if (AppConstants.MOZ_BUILD_APP == "mobile/android") {
+-      Services.obs.removeObserver(this, REQ_LOCALES_CHANGED_TOPIC);
+-    }
++    Services.obs.removeObserver(this, TOPIC_LOCALES_CHANGE);
+   },
+ 
+   QueryInterface: XPCOMUtils.generateQI([
+     Ci.nsIBrowserSearchService,
+     Ci.nsIObserver,
+     Ci.nsITimerCallback
+   ])
+ };
+diff --git a/toolkit/components/search/tests/xpcshell/data/list.json b/toolkit/components/search/tests/xpcshell/data/list.json
+--- a/toolkit/components/search/tests/xpcshell/data/list.json
++++ b/toolkit/components/search/tests/xpcshell/data/list.json
+@@ -1,9 +1,30 @@
+ {
+   "default": {
+     "searchDefault": "Test search engine",
+     "searchOrder": ["engine-resourceicon", "engine-chromeicon"],
+     "visibleDefaultEngines": [
+       "engine", "engine-pref", "engine-rel-searchform-purpose", "engine-system-purpose", "engine-chromeicon", "engine-resourceicon"
+     ]
++  },
++  "regionOverrides": {
++    "RU": {
++      "engine": "engine-chromeicon"
++    }
++  },
++  "locales": {
++    "de": {
++      "default": {
++        "visibleDefaultEngines": [
++          "engine"
++        ]
++      }
++    },
++    "fr": {
++      "default": {
++        "visibleDefaultEngines": [
++          "engine", "engine-pref"
++        ]
++      }
++    }
+   }
+ }
+diff --git a/toolkit/components/search/tests/xpcshell/head_search.js b/toolkit/components/search/tests/xpcshell/head_search.js
+--- a/toolkit/components/search/tests/xpcshell/head_search.js
++++ b/toolkit/components/search/tests/xpcshell/head_search.js
+@@ -227,17 +227,17 @@ function isUSTimezone() {
+   // Hawaii-Aleutian Standard Time (http://www.timeanddate.com/time/zones/hast)
+ 
+   let UTCOffset = (new Date()).getTimezoneOffset();
+   return UTCOffset >= 150 && UTCOffset <= 600;
+ }
+ 
+ const kDefaultenginenamePref = "browser.search.defaultenginename";
+ const kTestEngineName = "Test search engine";
+-const REQ_LOCALES_CHANGED_TOPIC = "intl:requested-locales-changed";
++const TOPIC_LOCALES_CHANGE = "intl:app-locales-changed";
+ 
+ function getDefaultEngineName(isUS) {
+   // The list of visibleDefaultEngines needs to match or the cache will be ignored.
+   let chan = NetUtil.newChannel({
+     uri: "resource://search-plugins/list.json",
+     loadUsingSystemPrincipal: true
+   });
+   let searchSettings = parseJsonFromStream(chan.open2());
+@@ -458,17 +458,17 @@ function asyncInit() {
+     });
+   });
+ }
+ 
+ function asyncReInit() {
+   let promise = waitForSearchNotification("reinit-complete");
+ 
+   Services.search.QueryInterface(Ci.nsIObserver)
+-          .observe(null, REQ_LOCALES_CHANGED_TOPIC, null);
++          .observe(null, TOPIC_LOCALES_CHANGE, null);
+ 
+   return promise;
+ }
+ 
+ // This "enum" from nsSearchService.js
+ const TELEMETRY_RESULT_ENUM = {
+   SUCCESS: 0,
+   SUCCESS_WITHOUT_DATA: 1,
+diff --git a/toolkit/components/search/tests/xpcshell/test_list_json_locale.js b/toolkit/components/search/tests/xpcshell/test_list_json_locale.js
+new file mode 100644
+--- /dev/null
++++ b/toolkit/components/search/tests/xpcshell/test_list_json_locale.js
+@@ -0,0 +1,60 @@
++/* Any copyright is dedicated to the Public Domain.
++ * http://creativecommons.org/publicdomain/zero/1.0/ */
++
++/* Check default search engine is picked from list.json searchDefault */
++
++"use strict";
++
++function run_test() {
++  Assert.ok(!Services.search.isInitialized, "search isn't initialized yet");
++
++  run_next_test();
++}
++
++// Override list.json with test data from data/list.json
++// and check that different locale is working
++add_task(async function test_listJSONlocale() {
++  let url = "resource://test/data/";
++  let resProt = Services.io.getProtocolHandler("resource")
++                        .QueryInterface(Ci.nsIResProtocolHandler);
++  resProt.setSubstitution("search-plugins", Services.io.newURI(url));
++
++  Services.locale.setAvailableLocales(["de"]);
++  Services.locale.setRequestedLocales(["de"]);
++
++  await asyncInit();
++
++  Assert.ok(Services.search.isInitialized, "search initialized");
++
++  let sortedEngines = Services.search.getEngines();
++  Assert.equal(sortedEngines.length, 1, "Should have only one engine");
++});
++
++
++// Check that switching locale switches search engines
++add_task(async function test_listJSONlocaleSwitch() {
++  let promise = waitForSearchNotification("reinit-complete");
++
++  Services.locale.setAvailableLocales(["fr"]);
++  Services.locale.setRequestedLocales(["fr"]);
++
++  await promise;
++
++  Assert.ok(Services.search.isInitialized, "search initialized");
++
++  let sortedEngines = Services.search.getEngines();
++  Assert.equal(sortedEngines.length, 2, "Should have two engines");
++});
++
++// Check that region overrides apply
++add_task(async function test_listJSONRegionOverride() {
++  Services.prefs.setCharPref("browser.search.region", "RU");
++
++  await asyncReInit();
++
++  Assert.ok(Services.search.isInitialized, "search initialized");
++
++  let sortedEngines = Services.search.getEngines();
++  Assert.equal(sortedEngines.length, 2, "Should have two engines");
++  Assert.equal(sortedEngines[0].identifier, "engine-chromeicon", "Engine should have been overridden by engine-chromeicon");
++});
+diff --git a/toolkit/components/search/tests/xpcshell/xpcshell.ini b/toolkit/components/search/tests/xpcshell/xpcshell.ini
+--- a/toolkit/components/search/tests/xpcshell/xpcshell.ini
++++ b/toolkit/components/search/tests/xpcshell/xpcshell.ini
+@@ -35,16 +35,17 @@ support-files =
+ [test_bug930456_child.js]
+ [test_engine_set_alias.js]
+ [test_hasEngineWithURL.js]
+ [test_identifiers.js]
+ [test_invalid_engine_from_dir.js]
+ [test_init_async_multiple.js]
+ [test_init_async_multiple_then_sync.js]
+ [test_json_cache.js]
++[test_list_json_locale.js]
+ [test_list_json_searchdefault.js]
+ [test_list_json_searchorder.js]
+ [test_location.js]
+ [test_location_error.js]
+ [test_location_malformed_json.js]
+ [test_location_migrate_countrycode_isUS.js]
+ [test_location_migrate_no_countrycode_isUS.js]
+ [test_location_migrate_no_countrycode_notUS.js]
+diff --git a/toolkit/mozapps/installer/l10n-repack.py b/toolkit/mozapps/installer/l10n-repack.py
+--- a/toolkit/mozapps/installer/l10n-repack.py
++++ b/toolkit/mozapps/installer/l10n-repack.py
+@@ -10,25 +10,23 @@ directory.
+ from mozpack.packager import l10n
+ from argparse import ArgumentParser
+ import buildconfig
+ 
+ # Set of files or directories not listed in a chrome.manifest but that are
+ # localized.
+ NON_CHROME = set([
+     '**/crashreporter*.ini',
+-    'searchplugins',
+     'dictionaries',
+     'defaults/profile',
+     'defaults/pref*/*-l10n.js',
+     'update.locale',
+     'updater.ini',
+     'extensions/langpack-*@*',
+     'distribution/extensions/langpack-*@*',
+-    'chrome/**/searchplugins/*.xml',
+     '**/multilocale.txt'
+ ])
+ 
+ 
+ def valid_extra_l10n(arg):
+     if '=' not in arg:
+         raise ValueError('Invalid value')
+     return tuple(arg.split('=', 1))

+ 439 - 0
bug1240930-253/mozilla/1443208-1only-62a1.patch

@@ -0,0 +1,439 @@
+# HG changeset patch
+# User Nick Alexander <nalexander@mozilla.com>
+# Date 1520553846 28800
+# Node ID fe70510127c52b9ac8c1c9287ffc9c7148c414aa
+# Parent  0db6e65892e98f6fb98579b75d87b44beb65c936
+Bug 1443208 - Pre: Add force flag to GENERATED_FILES. r=ted.mielczarek
+
+The forces on the system are such that I really need to be able to
+FORCE a few RecursiveMake targets in order to make Android and Gradle
+use GENERATED_FILES and LOCALIZED_GENERATED_FILES.  Over time, I hope
+to avoid FORCE, but that time is not now.
+
+MozReview-Commit-ID: 453FpnihSRK
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -573,31 +573,38 @@ class RecursiveMakeBackend(CommonBackend
+                     # Android localized resources have special Makefile
+                     # handling.
+                     backend_file.write('%s:: %s\n' % (tier, first_output))
+             for output in outputs:
+                 if output != first_output:
+                     backend_file.write('%s: %s ;\n' % (output, first_output))
+                 backend_file.write('GARBAGE += %s\n' % output)
+             backend_file.write('EXTRA_MDDEPEND_FILES += %s\n' % dep_file)
++
++            force = ''
++            if obj.force:
++                force = ' FORCE'
++            elif obj.localized:
++                force = ' $(if $(IS_LANGUAGE_REPACK),FORCE)'
++
+             if obj.script:
+-                backend_file.write("""{output}: {script}{inputs}{backend}{repack_force}
++                backend_file.write("""{output}: {script}{inputs}{backend}{force}
+ \t$(REPORT_BUILD)
+ \t$(call py_action,file_generate,{locale}{script} {method} {output} $(MDDEPDIR)/{dep_file}{inputs}{flags})
+ 
+ """.format(output=first_output,
+            dep_file=dep_file,
+            inputs=' ' + ' '.join(inputs) if inputs else '',
+            flags=' ' + ' '.join(shell_quote(f) for f in obj.flags) if obj.flags else '',
+            backend=' backend.mk' if obj.flags else '',
+            # Locale repacks repack multiple locales from a single configured objdir,
+            # so standard mtime dependencies won't work properly when the build is re-run
+            # with a different locale as input. IS_LANGUAGE_REPACK will reliably be set
+            # in this situation, so simply force the generation to run in that case.
+-           repack_force=' $(if $(IS_LANGUAGE_REPACK),FORCE)' if obj.localized else '',
++           force=force,
+            locale='--locale=$(AB_CD) ' if obj.localized else '',
+            script=obj.script,
+            method=obj.method))
+ 
+         elif isinstance(obj, JARManifest):
+             self._no_skip['libs'].add(backend_file.relobjdir)
+             backend_file.write('JAR_MANIFEST := %s\n' % obj.path.full_path)
+ 
+diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
+--- a/python/mozbuild/mozbuild/frontend/context.py
++++ b/python/mozbuild/mozbuild/frontend/context.py
+@@ -926,16 +926,17 @@ BugzillaComponent = TypedNamedTuple('Bug
+                         [('product', unicode), ('component', unicode)])
+ SchedulingComponents = ContextDerivedTypedRecord(
+         ('inclusive', TypedList(unicode, StrictOrderingOnAppendList)),
+         ('exclusive', TypedList(unicode, StrictOrderingOnAppendList)))
+ 
+ GeneratedFilesList = StrictOrderingOnAppendListWithFlagsFactory({
+     'script': unicode,
+     'inputs': list,
++    'force': bool,
+     'flags': list, })
+ 
+ 
+ class Files(SubContext):
+     """Metadata attached to files.
+ 
+     It is common to want to annotate files with metadata, such as which
+     Bugzilla component tracks issues with certain files. This sub-context is
+@@ -1271,18 +1272,18 @@ VARIABLES = {
+         size.
+         """),
+ 
+     'GENERATED_FILES': (GeneratedFilesList, list,
+         """Generic generated files.
+ 
+         This variable contains a list of files for the build system to
+         generate at export time. The generation method may be declared
+-        with optional ``script``, ``inputs`` and ``flags`` attributes on
+-        individual entries.
++        with optional ``script``, ``inputs``, ``flags``, and ``force``
++        attributes on individual entries.
+         If the optional ``script`` attribute is not present on an entry, it
+         is assumed that rules for generating the file are present in
+         the associated Makefile.in.
+ 
+         Example::
+ 
+            GENERATED_FILES += ['bar.c', 'baz.c', 'foo.c']
+            bar = GENERATED_FILES['bar.c']
+@@ -1310,16 +1311,21 @@ VARIABLES = {
+           bar = GENERATED_FILES['bar.c']
+           bar.script = 'generate.py:make_bar'
+ 
+         The chosen script entry point may optionally return a set of strings,
+         indicating extra files the output depends on.
+ 
+         When the ``flags`` attribute is present, the given list of flags is
+         passed as extra arguments following the inputs.
++
++        When the ``force`` attribute is present, the file is generated every
++        build, regardless of whether it is stale.  This is special to the
++        RecursiveMake backend and intended for special situations only (e.g.,
++        localization).  Please consult a build peer before using ``force``.
+         """),
+ 
+     'DEFINES': (InitializedDefines, dict,
+         """Dictionary of compiler defines to declare.
+ 
+         These are passed in to the compiler as ``-Dkey='value'`` for string
+         values, ``-Dkey=value`` for numeric values, or ``-Dkey`` if the
+         value is True. Note that for string values, the outer-level of
+diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
+--- a/python/mozbuild/mozbuild/frontend/data.py
++++ b/python/mozbuild/mozbuild/frontend/data.py
+@@ -1117,26 +1117,29 @@ class GeneratedFile(ContextDerived):
+     __slots__ = (
+         'script',
+         'method',
+         'outputs',
+         'inputs',
+         'flags',
+         'required_for_compile',
+         'localized',
++        'force',
+     )
+ 
+-    def __init__(self, context, script, method, outputs, inputs, flags=(), localized=False):
++    def __init__(self, context, script, method, outputs, inputs,
++                 flags=(), localized=False, force=False):
+         ContextDerived.__init__(self, context)
+         self.script = script
+         self.method = method
+         self.outputs = outputs if isinstance(outputs, tuple) else (outputs,)
+         self.inputs = inputs
+         self.flags = flags
+         self.localized = localized
++        self.force = force
+ 
+         suffixes = (
+             '.c',
+             '.cpp',
+             '.h',
+             '.inc',
+             '.py',
+             '.rs',
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
+@@ -1386,17 +1386,17 @@ class TreeMetadataEmitter(LoggingMixin):
+                     if (isinstance(p, SourcePath) and
+                             not os.path.exists(p.full_path)):
+                         raise SandboxValidationError(
+                             'Input for generating %s does not exist: %s'
+                             % (f, p.full_path), context)
+                     inputs.append(p)
+ 
+                 yield GeneratedFile(context, script, method, outputs, inputs,
+-                                    flags.flags, localized=localized)
++                                    flags.flags, localized=localized, force=flags.force)
+ 
+     def _process_test_manifests(self, context):
+         for prefix, info in TEST_MANIFESTS.items():
+             for path, manifest in context.get('%s_MANIFESTS' % prefix, []):
+                 for obj in self._process_test_manifest(context, info, path, manifest):
+                     yield obj
+ 
+         for flavor in REFTEST_FLAVORS:
+diff --git a/python/mozbuild/mozbuild/test/backend/data/generated-files/foo-data b/python/mozbuild/mozbuild/test/backend/data/generated-files-force/foo-data
+copy from python/mozbuild/mozbuild/test/backend/data/generated-files/foo-data
+copy to python/mozbuild/mozbuild/test/backend/data/generated-files-force/foo-data
+diff --git a/python/mozbuild/mozbuild/test/backend/data/generated-files/generate-bar.py b/python/mozbuild/mozbuild/test/backend/data/generated-files-force/generate-bar.py
+copy from python/mozbuild/mozbuild/test/backend/data/generated-files/generate-bar.py
+copy to python/mozbuild/mozbuild/test/backend/data/generated-files-force/generate-bar.py
+diff --git a/python/mozbuild/mozbuild/test/backend/data/generated-files/generate-foo.py b/python/mozbuild/mozbuild/test/backend/data/generated-files-force/generate-foo.py
+copy from python/mozbuild/mozbuild/test/backend/data/generated-files/generate-foo.py
+copy to python/mozbuild/mozbuild/test/backend/data/generated-files-force/generate-foo.py
+diff --git a/python/mozbuild/mozbuild/test/backend/data/generated-files/moz.build b/python/mozbuild/mozbuild/test/backend/data/generated-files-force/moz.build
+copy from python/mozbuild/mozbuild/test/backend/data/generated-files/moz.build
+copy to python/mozbuild/mozbuild/test/backend/data/generated-files-force/moz.build
+--- a/python/mozbuild/mozbuild/test/backend/data/generated-files/moz.build
++++ b/python/mozbuild/mozbuild/test/backend/data/generated-files-force/moz.build
+@@ -1,12 +1,14 @@
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+ # Any copyright is dedicated to the Public Domain.
+ # http://creativecommons.org/publicdomain/zero/1.0/
+ 
+ GENERATED_FILES += [ 'bar.c', 'foo.c', 'quux.c' ]
+ 
+ bar = GENERATED_FILES['bar.c']
+ bar.script = 'generate-bar.py:baz'
++bar.force = True
+ 
+ foo = GENERATED_FILES['foo.c']
+ foo.script = 'generate-foo.py'
+ foo.inputs = ['foo-data']
++foo.force = False
+diff --git a/python/mozbuild/mozbuild/test/backend/data/localized-generated-files/en-US/localized-input b/python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/en-US/localized-input
+copy from python/mozbuild/mozbuild/test/backend/data/localized-generated-files/en-US/localized-input
+copy to python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/en-US/localized-input
+diff --git a/python/mozbuild/mozbuild/test/backend/data/localized-generated-files/foo-data b/python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/foo-data
+copy from python/mozbuild/mozbuild/test/backend/data/localized-generated-files/foo-data
+copy to python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/foo-data
+diff --git a/python/mozbuild/mozbuild/test/backend/data/localized-generated-files/generate-foo.py b/python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/generate-foo.py
+copy from python/mozbuild/mozbuild/test/backend/data/localized-generated-files/generate-foo.py
+copy to python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/generate-foo.py
+diff --git a/python/mozbuild/mozbuild/test/backend/data/localized-generated-files/moz.build b/python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/moz.build
+copy from python/mozbuild/mozbuild/test/backend/data/localized-generated-files/moz.build
+copy to python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/moz.build
+--- a/python/mozbuild/mozbuild/test/backend/data/localized-generated-files/moz.build
++++ b/python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/moz.build
+@@ -6,10 +6,17 @@ LOCALIZED_GENERATED_FILES += [ 'foo.xyz'
+ 
+ foo = LOCALIZED_GENERATED_FILES['foo.xyz']
+ foo.script = 'generate-foo.py'
+ foo.inputs = [
+     'en-US/localized-input',
+     'non-localized-input',
+ ]
+ 
+-# Also check that using it in LOCALIZED_FILES does the right thing.
+-LOCALIZED_FILES += [ '!foo.xyz' ]
++LOCALIZED_GENERATED_FILES += [ 'abc.xyz' ]
++
++abc = LOCALIZED_GENERATED_FILES['abc.xyz']
++abc.script = 'generate-foo.py'
++abc.inputs = [
++    'en-US/localized-input',
++    'non-localized-input',
++]
++abc.force = True
+diff --git a/python/mozbuild/mozbuild/test/backend/data/localized-generated-files/non-localized-input b/python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/non-localized-input
+copy from python/mozbuild/mozbuild/test/backend/data/localized-generated-files/non-localized-input
+copy to python/mozbuild/mozbuild/test/backend/data/localized-generated-files-force/non-localized-input
+diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
++++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+@@ -413,16 +413,46 @@ class TestRecursiveMakeBackend(BackendTe
+             'export:: quux.c',
+             'GARBAGE += quux.c',
+             'EXTRA_MDDEPEND_FILES += quux.c.pp',
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
++    def test_generated_files_force(self):
++        """Ensure GENERATED_FILES with .force is handled properly."""
++        env = self._consume('generated-files-force', RecursiveMakeBackend)
++
++        backend_path = mozpath.join(env.topobjdir, 'backend.mk')
++        lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
++
++        expected = [
++            'export:: bar.c',
++            'GARBAGE += bar.c',
++            'EXTRA_MDDEPEND_FILES += bar.c.pp',
++            'bar.c: %s/generate-bar.py FORCE' % env.topsrcdir,
++            '$(REPORT_BUILD)',
++            '$(call py_action,file_generate,%s/generate-bar.py baz bar.c $(MDDEPDIR)/bar.c.pp)' % env.topsrcdir,
++            '',
++            'export:: foo.c',
++            'GARBAGE += foo.c',
++            'EXTRA_MDDEPEND_FILES += foo.c.pp',
++            'foo.c: %s/generate-foo.py $(srcdir)/foo-data' % (env.topsrcdir),
++            '$(REPORT_BUILD)',
++            '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp $(srcdir)/foo-data)' % (env.topsrcdir),
++            '',
++            'export:: quux.c',
++            'GARBAGE += quux.c',
++            'EXTRA_MDDEPEND_FILES += quux.c.pp',
++        ]
++
++        self.maxDiff = None
++        self.assertEqual(lines, expected)
++
+     def test_localized_generated_files(self):
+         """Ensure LOCALIZED_GENERATED_FILES is handled properly."""
+         env = self._consume('localized-generated-files', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+@@ -437,16 +467,43 @@ class TestRecursiveMakeBackend(BackendTe
+             'LOCALIZED_FILES_0_DEST = $(FINAL_TARGET)/',
+             'LOCALIZED_FILES_0_TARGET := libs',
+             'INSTALL_TARGETS += LOCALIZED_FILES_0',
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
++    def test_localized_generated_files_force(self):
++        """Ensure LOCALIZED_GENERATED_FILES with .force is handled properly."""
++        env = self._consume('localized-generated-files-force', RecursiveMakeBackend)
++
++        backend_path = mozpath.join(env.topobjdir, 'backend.mk')
++        lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
++
++        expected = [
++            'libs:: foo.xyz',
++            'GARBAGE += foo.xyz',
++            'EXTRA_MDDEPEND_FILES += foo.xyz.pp',
++            'foo.xyz: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
++            '$(REPORT_BUILD)',
++            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo.xyz $(MDDEPDIR)/foo.xyz.pp $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '',
++            'libs:: abc.xyz',
++            'GARBAGE += abc.xyz',
++            'EXTRA_MDDEPEND_FILES += abc.xyz.pp',
++            'abc.xyz: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input FORCE' % env.topsrcdir,
++            '$(REPORT_BUILD)',
++            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main abc.xyz $(MDDEPDIR)/abc.xyz.pp $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '',
++        ]
++
++        self.maxDiff = None
++        self.assertEqual(lines, expected)
++
+     def test_localized_generated_files_AB_CD(self):
+         """Ensure LOCALIZED_GENERATED_FILES is handled properly
+         when {AB_CD} and {AB_rCD} are used."""
+         env = self._consume('localized-generated-files-AB_CD', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/generated-files/moz.build b/python/mozbuild/mozbuild/test/frontend/data/generated-files-force/moz.build
+copy from python/mozbuild/mozbuild/test/frontend/data/generated-files/moz.build
+copy to python/mozbuild/mozbuild/test/frontend/data/generated-files-force/moz.build
+--- a/python/mozbuild/mozbuild/test/frontend/data/generated-files/moz.build
++++ b/python/mozbuild/mozbuild/test/frontend/data/generated-files-force/moz.build
+@@ -1,5 +1,7 @@
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+ # Any copyright is dedicated to the Public Domain.
+ # http://creativecommons.org/publicdomain/zero/1.0/
+ 
+ GENERATED_FILES += [ 'bar.c', 'foo.c', ('xpidllex.py', 'xpidlyacc.py'), ]
++GENERATED_FILES['bar.c'].force = True
++GENERATED_FILES['foo.c'].force = False
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/localized-generated-files/moz.build b/python/mozbuild/mozbuild/test/frontend/data/localized-generated-files-force/moz.build
+copy from python/mozbuild/mozbuild/test/frontend/data/localized-generated-files/moz.build
+copy to python/mozbuild/mozbuild/test/frontend/data/localized-generated-files-force/moz.build
+--- a/python/mozbuild/mozbuild/test/frontend/data/localized-generated-files/moz.build
++++ b/python/mozbuild/mozbuild/test/frontend/data/localized-generated-files-force/moz.build
+@@ -1,5 +1,6 @@
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+ # Any copyright is dedicated to the Public Domain.
+ # http://creativecommons.org/publicdomain/zero/1.0/
+ 
+ LOCALIZED_GENERATED_FILES += [ 'abc.ini', ('bar', 'baz') ]
++LOCALIZED_GENERATED_FILES['abc.ini'].force = True
+diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
++++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+@@ -446,34 +446,43 @@ class TestEmitterBasic(unittest.TestCase
+         maxDiff = self.maxDiff
+         self.maxDiff = None
+         self.assertEqual(passthru.variables,
+                          {'AS': 'yasm',
+                           'AS_DASH_C_FLAG': '',
+                           'ASOUTOPTION': '-o '})
+         self.maxDiff = maxDiff
+ 
+-
+     def test_generated_files(self):
+         reader = self.reader('generated-files')
+         objs = self.read_topsrcdir(reader)
+ 
+         self.assertEqual(len(objs), 3)
+         for o in objs:
+             self.assertIsInstance(o, GeneratedFile)
+             self.assertFalse(o.localized)
++            self.assertFalse(o.force)
+ 
+         expected = ['bar.c', 'foo.c', ('xpidllex.py', 'xpidlyacc.py'), ]
+         for o, f in zip(objs, expected):
+             expected_filename = f if isinstance(f, tuple) else (f,)
+             self.assertEqual(o.outputs, expected_filename)
+             self.assertEqual(o.script, None)
+             self.assertEqual(o.method, None)
+             self.assertEqual(o.inputs, [])
+ 
++    def test_generated_files_force(self):
++        reader = self.reader('generated-files-force')
++        objs = self.read_topsrcdir(reader)
++
++        self.assertEqual(len(objs), 3)
++        for o in objs:
++            self.assertIsInstance(o, GeneratedFile)
++            self.assertEqual(o.force, 'bar.c' in o.outputs)
++
+     def test_localized_generated_files(self):
+         reader = self.reader('localized-generated-files')
+         objs = self.read_topsrcdir(reader)
+ 
+         self.assertEqual(len(objs), 2)
+         for o in objs:
+             self.assertIsInstance(o, GeneratedFile)
+             self.assertTrue(o.localized)
+@@ -482,16 +491,26 @@ class TestEmitterBasic(unittest.TestCase
+         expected = ['abc.ini', ('bar', 'baz'), ]
+         for o, f in zip(objs, expected):
+             expected_filename = f if isinstance(f, tuple) else (f,)
+             self.assertEqual(o.outputs, expected_filename)
+             self.assertEqual(o.script, None)
+             self.assertEqual(o.method, None)
+             self.assertEqual(o.inputs, [])
+ 
++    def test_localized_generated_files_force(self):
++        reader = self.reader('localized-generated-files-force')
++        objs = self.read_topsrcdir(reader)
++
++        self.assertEqual(len(objs), 2)
++        for o in objs:
++            self.assertIsInstance(o, GeneratedFile)
++            self.assertTrue(o.localized)
++            self.assertEqual(o.force, 'abc.ini' in o.outputs)
++
+     def test_localized_files_from_generated(self):
+         """Test that using LOCALIZED_GENERATED_FILES and then putting the output in
+         LOCALIZED_FILES as an objdir path works.
+         """
+         reader = self.reader('localized-files-from-generated')
+         objs = self.read_topsrcdir(reader)
+ 
+         self.assertEqual(len(objs), 2)
+

+ 143 - 0
bug1240930-253/mozilla/1454912-2no1-62a1.patch

@@ -0,0 +1,143 @@
+# HG changeset patch
+# User Mike Shal <mshal@mozilla.com>
+# Date 1525899199 14400
+# Node ID 82c74467f638711b16996f2a0dca28a597f32a0d
+# Parent  4dbe6c1bea4db5f0ae77a3487328c32ec240a5d7
+Bug 1454912 - Only output dependencies for GENERATED_FILES with scripts; r=nalexander
+
+Some GENERATED_FILES entries don't have .scripts associated with them
+(notably midl on Windows builds). In this case, we don't want to
+generate dependencies automatically since they will be handled by the
+Makefiles.
+
+MozReview-Commit-ID: AXmN2Unk9AY
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -562,38 +562,38 @@ class RecursiveMakeBackend(CommonBackend
+                 else:
+                     inputs = [self._pretty_path(f, backend_file) for f in obj.inputs]
+             else:
+                 inputs = []
+ 
+             if needs_AB_rCD:
+                 backend_file.write_once('include $(topsrcdir)/config/AB_rCD.mk\n')
+ 
+-            # If we're doing this during export that means we need it during
+-            # compile, but if we have an artifact build we don't run compile,
+-            # so we can skip it altogether or let the rule run as the result of
+-            # something depending on it.
+-            if tier != 'export' or not self.environment.is_artifact_build:
+-                if not needs_AB_rCD:
+-                    # Android localized resources have special Makefile
+-                    # handling.
+-                    backend_file.write('%s:: %s\n' % (tier, first_output))
+-            for output in outputs:
+-                if output != first_output:
+-                    backend_file.write('%s: %s ;\n' % (output, first_output))
+-                backend_file.write('GARBAGE += %s\n' % output)
+-            backend_file.write('EXTRA_MDDEPEND_FILES += %s\n' % dep_file)
+-
+             force = ''
+             if obj.force:
+                 force = ' FORCE'
+             elif obj.localized:
+                 force = ' $(if $(IS_LANGUAGE_REPACK),FORCE)'
+ 
+             if obj.script:
++                # If we're doing this during export that means we need it during
++                # compile, but if we have an artifact build we don't run compile,
++                # so we can skip it altogether or let the rule run as the result of
++                # something depending on it.
++                if tier != 'export' or not self.environment.is_artifact_build:
++                    if not needs_AB_rCD:
++                        # Android localized resources have special Makefile
++                        # handling.
++                        backend_file.write('%s:: %s\n' % (tier, first_output))
++                for output in outputs:
++                    if output != first_output:
++                        backend_file.write('%s: %s ;\n' % (output, first_output))
++                    backend_file.write('GARBAGE += %s\n' % output)
++                backend_file.write('EXTRA_MDDEPEND_FILES += %s\n' % dep_file)
++
+                 backend_file.write("""{output}: {script}{inputs}{backend}{force}
+ \t$(REPORT_BUILD)
+ \t$(call py_action,file_generate,{locale}{script} {method} {output} $(MDDEPDIR)/{dep_file}{inputs}{flags})
+ 
+ """.format(output=first_output,
+            dep_file=dep_file,
+            inputs=' ' + ' '.join(inputs) if inputs else '',
+            flags=' ' + ' '.join(shell_quote(f) for f in obj.flags) if obj.flags else '',
+diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
++++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+@@ -405,19 +405,16 @@ class TestRecursiveMakeBackend(BackendTe
+             '',
+             'export:: foo.c',
+             'GARBAGE += foo.c',
+             'EXTRA_MDDEPEND_FILES += foo.c.pp',
+             'foo.c: %s/generate-foo.py $(srcdir)/foo-data' % (env.topsrcdir),
+             '$(REPORT_BUILD)',
+             '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp $(srcdir)/foo-data)' % (env.topsrcdir),
+             '',
+-            'export:: quux.c',
+-            'GARBAGE += quux.c',
+-            'EXTRA_MDDEPEND_FILES += quux.c.pp',
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
+     def test_generated_files_force(self):
+         """Ensure GENERATED_FILES with .force is handled properly."""
+         env = self._consume('generated-files-force', RecursiveMakeBackend)
+@@ -435,19 +432,16 @@ class TestRecursiveMakeBackend(BackendTe
+             '',
+             'export:: foo.c',
+             'GARBAGE += foo.c',
+             'EXTRA_MDDEPEND_FILES += foo.c.pp',
+             'foo.c: %s/generate-foo.py $(srcdir)/foo-data' % (env.topsrcdir),
+             '$(REPORT_BUILD)',
+             '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp $(srcdir)/foo-data)' % (env.topsrcdir),
+             '',
+-            'export:: quux.c',
+-            'GARBAGE += quux.c',
+-            'EXTRA_MDDEPEND_FILES += quux.c.pp',
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
+     def test_localized_generated_files(self):
+         """Ensure LOCALIZED_GENERATED_FILES is handled properly."""
+         env = self._consume('localized-generated-files', RecursiveMakeBackend)
+@@ -544,28 +538,16 @@ class TestRecursiveMakeBackend(BackendTe
+         self.assertIn('mozilla/mozilla2.h', m)
+         self.assertIn('mozilla/dom/dom2.h', m)
+         self.assertIn('mozilla/dom/dom3.h', m)
+         # EXPORTS files that are also GENERATED_FILES should be handled as
+         # INSTALL_TARGETS.
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+         expected = [
+-            'export:: bar.h',
+-            'GARBAGE += bar.h',
+-            'EXTRA_MDDEPEND_FILES += bar.h.pp',
+-            'export:: mozilla2.h',
+-            'GARBAGE += mozilla2.h',
+-            'EXTRA_MDDEPEND_FILES += mozilla2.h.pp',
+-            'export:: dom2.h',
+-            'GARBAGE += dom2.h',
+-            'EXTRA_MDDEPEND_FILES += dom2.h.pp',
+-            'export:: dom3.h',
+-            'GARBAGE += dom3.h',
+-            'EXTRA_MDDEPEND_FILES += dom3.h.pp',
+             'dist_include_FILES += bar.h',
+             'dist_include_DEST := $(DEPTH)/dist/include/',
+             'dist_include_TARGET := export',
+             'INSTALL_TARGETS += dist_include',
+             'dist_include_mozilla_FILES += mozilla2.h',
+             'dist_include_mozilla_DEST := $(DEPTH)/dist/include/mozilla',
+             'dist_include_mozilla_TARGET := export',
+             'INSTALL_TARGETS += dist_include_mozilla',

+ 406 - 0
bug1240930-253/mozilla/1454912-3-62a1.patch

@@ -0,0 +1,406 @@
+# HG changeset patch
+# User Mike Shal <mshal@mozilla.com>
+# Date 1525868671 14400
+# Node ID 1eb04a9bfb7a82eb6fac5e29be7c6b03999d9361
+# Parent  82c74467f638711b16996f2a0dca28a597f32a0d
+Bug 1454912 - Use a .stub file as the target for all GENERATED_FILES rules; r=nalexander
+
+The make backend was treating the first output of a GENERATED_FILES rule
+specially, since it was the target of the rule containing the script
+invocation. We want the outputs of GENERATED_FILES rules to be
+FileAvoidWrite so that we avoid triggering downstream rules if the
+outputs are unchanged, but if the target of the script invocation is
+FileAvoidWrite, then make may continually re-run the script during a
+no-op build.
+
+The solution here is to use a stub file as the target of the script
+invocation which will always be touched when the script runs. Since
+nothing else in the build depends on the stub, we don't need to
+FileAvoidWrite it. All actual outputs of the script can be
+FileAvoidWrite, and make can properly avoid work for files that haven't
+changed.
+
+MozReview-Commit-ID: 3GejZw2tpqu
+
+diff --git a/CLOBBER b/CLOBBER
+--- a/CLOBBER
++++ b/CLOBBER
+@@ -17,9 +17,9 @@
+ #
+ # Modifying this file will now automatically clobber the buildbot machines \o/
+ #
+ 
+ # Are you updating CLOBBER because you think it's needed for your WebIDL
+ # changes to stick? As of bug 928195, this shouldn't be necessary! Please
+ # don't change CLOBBER for WebIDL changes any more.
+ 
+-Bug 1371485 - Moving gyp requires a clobber.
++Bug 1454912 - Changed out GENERATED_FILES are handled in the RecursiveMake backend
+diff --git a/config/config.mk b/config/config.mk
+--- a/config/config.mk
++++ b/config/config.mk
+@@ -24,16 +24,19 @@ topsrcdir	= $(DEPTH)
+ endif
+ 
+ ifndef INCLUDED_AUTOCONF_MK
+ include $(DEPTH)/config/autoconf.mk
+ endif
+ 
+ -include $(DEPTH)/.mozconfig.mk
+ 
++# MDDEPDIR is the subdirectory where dependency files are stored
++MDDEPDIR := .deps
++
+ ifndef EXTERNALLY_MANAGED_MAKE_FILE
+ # Import the automatically generated backend file. If this file doesn't exist,
+ # the backend hasn't been properly configured. We want this to be a fatal
+ # error, hence not using "-include".
+ ifndef STANDALONE_MAKEFILE
+ GLOBAL_DEPS += backend.mk
+ include backend.mk
+ endif
+@@ -417,19 +420,16 @@ endif # ! WINNT
+ 
+ # Make sure any compiled classes work with at least JVM 1.4
+ JAVAC_FLAGS += -source 1.4
+ 
+ ifdef MOZ_DEBUG
+ JAVAC_FLAGS += -g
+ endif
+ 
+-# MDDEPDIR is the subdirectory where dependency files are stored
+-MDDEPDIR := .deps
+-
+ # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
+ # this file
+ OBJ_SUFFIX := $(_OBJ_SUFFIX)
+ 
+ OBJS_VAR_SUFFIX := OBJS
+ 
+ # PGO builds with GCC build objects with instrumentation in a first pass,
+ # then objects optimized, without instrumentation, in a second pass. If
+diff --git a/python/mozbuild/mozbuild/action/file_generate.py b/python/mozbuild/mozbuild/action/file_generate.py
+--- a/python/mozbuild/mozbuild/action/file_generate.py
++++ b/python/mozbuild/mozbuild/action/file_generate.py
+@@ -28,16 +28,18 @@ def main(argv):
+     parser.add_argument('python_script', metavar='python-script', type=str,
+                         help='The Python script to run')
+     parser.add_argument('method_name', metavar='method-name', type=str,
+                         help='The method of the script to invoke')
+     parser.add_argument('output_file', metavar='output-file', type=str,
+                         help='The file to generate')
+     parser.add_argument('dep_file', metavar='dep-file', type=str,
+                         help='File to write any additional make dependencies to')
++    parser.add_argument('dep_target', metavar='dep-target', type=str,
++                        help='Make target to use in the dependencies file')
+     parser.add_argument('additional_arguments', metavar='arg',
+                         nargs=argparse.REMAINDER,
+                         help="Additional arguments to the script's main() method")
+ 
+     args = parser.parse_args(argv)
+ 
+     kwargs = {}
+     if args.locale:
+@@ -90,17 +92,17 @@ def main(argv):
+                 # the script.
+                 deps |= set(iter_modules_in_path(buildconfig.topsrcdir,
+                                                  buildconfig.topobjdir))
+                 # Add dependencies on any buildconfig items that were accessed
+                 # by the script.
+                 deps |= set(buildconfig.get_dependencies())
+ 
+                 mk = Makefile()
+-                mk.create_rule([args.output_file]).add_dependencies(deps)
++                mk.create_rule([args.dep_target]).add_dependencies(deps)
+                 with FileAvoidWrite(args.dep_file) as dep_file:
+                     mk.dump(dep_file)
+         # Even when our file's contents haven't changed, we want to update
+         # the file's mtime so make knows this target isn't still older than
+         # whatever prerequisite caused it to be built this time around.
+         try:
+             os.utime(args.output_file, None)
+         except:
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -538,16 +538,20 @@ class RecursiveMakeBackend(CommonBackend
+                 try:
+                     outputs.append(o.format(**substs))
+                 except KeyError as e:
+                     raise ValueError('%s not in %s is not a valid substitution in %s'
+                                      % (e.args[0], ', '.join(sorted(substs.keys())), o))
+ 
+             first_output = outputs[0]
+             dep_file = "%s.pp" % first_output
++            # The stub target file needs to go in MDDEPDIR so that it doesn't
++            # get written into generated Android resource directories, breaking
++            # Gradle tooling and/or polluting the Android packages.
++            stub_file = "$(MDDEPDIR)/%s.stub" % first_output
+ 
+             if obj.inputs:
+                 if obj.localized:
+                     # Localized generated files can have locale-specific inputs, which are
+                     # indicated by paths starting with `en-US/` or containing `/locales/en-US/`.
+                     def srcpath(p):
+                         if '/locales/en-US' in p:
+                             e, f = p.split('/locales/en-US/', 1)
+@@ -577,28 +581,30 @@ class RecursiveMakeBackend(CommonBackend
+                 # If we're doing this during export that means we need it during
+                 # compile, but if we have an artifact build we don't run compile,
+                 # so we can skip it altogether or let the rule run as the result of
+                 # something depending on it.
+                 if tier != 'export' or not self.environment.is_artifact_build:
+                     if not needs_AB_rCD:
+                         # Android localized resources have special Makefile
+                         # handling.
+-                        backend_file.write('%s:: %s\n' % (tier, first_output))
++                        backend_file.write('%s:: %s\n' % (tier, stub_file))
+                 for output in outputs:
+-                    if output != first_output:
+-                        backend_file.write('%s: %s ;\n' % (output, first_output))
++                    backend_file.write('%s: %s ;\n' % (output, stub_file))
+                     backend_file.write('GARBAGE += %s\n' % output)
++                backend_file.write('GARBAGE += %s\n' % stub_file)
+                 backend_file.write('EXTRA_MDDEPEND_FILES += %s\n' % dep_file)
+ 
+-                backend_file.write("""{output}: {script}{inputs}{backend}{force}
++                backend_file.write("""{stub}: {script}{inputs}{backend}{force}
+ \t$(REPORT_BUILD)
+-\t$(call py_action,file_generate,{locale}{script} {method} {output} $(MDDEPDIR)/{dep_file}{inputs}{flags})
++\t$(call py_action,file_generate,{locale}{script} {method} {output} $(MDDEPDIR)/{dep_file} {stub}{inputs}{flags})
++\t@$(TOUCH) $@
+ 
+-""".format(output=first_output,
++""".format(stub=stub_file,
++           output=first_output,
+            dep_file=dep_file,
+            inputs=' ' + ' '.join(inputs) if inputs else '',
+            flags=' ' + ' '.join(shell_quote(f) for f in obj.flags) if obj.flags else '',
+            backend=' backend.mk' if obj.flags else '',
+            # Locale repacks repack multiple locales from a single configured objdir,
+            # so standard mtime dependencies won't work properly when the build is re-run
+            # with a different locale as input. IS_LANGUAGE_REPACK will reliably be set
+            # in this situation, so simply force the generation to run in that case.
+diff --git a/python/mozbuild/mozbuild/backend/tup.py b/python/mozbuild/mozbuild/backend/tup.py
+--- a/python/mozbuild/mozbuild/backend/tup.py
++++ b/python/mozbuild/mozbuild/backend/tup.py
+@@ -593,16 +593,17 @@ class TupBackend(CommonBackend):
+             cmd = self._py_action('file_generate')
+             if obj.localized:
+                 cmd.append('--locale=en-US')
+             cmd.extend([
+                 obj.script,
+                 obj.method,
+                 obj.outputs[0],
+                 '%s.pp' % obj.outputs[0], # deps file required
++                'unused', # deps target is required
+             ])
+             full_inputs = [f.full_path for f in obj.inputs]
+             cmd.extend(full_inputs)
+             cmd.extend(shell_quote(f) for f in obj.flags)
+ 
+             outputs = []
+             outputs.extend(obj.outputs)
+             outputs.append('%s.pp' % obj.outputs[0])
+diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
++++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+@@ -391,76 +391,91 @@ class TestRecursiveMakeBackend(BackendTe
+     def test_generated_files(self):
+         """Ensure GENERATED_FILES is handled properly."""
+         env = self._consume('generated-files', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+-            'export:: bar.c',
++            'export:: $(MDDEPDIR)/bar.c.stub',
++            'bar.c: $(MDDEPDIR)/bar.c.stub ;',
+             'GARBAGE += bar.c',
++            'GARBAGE += $(MDDEPDIR)/bar.c.stub',
+             'EXTRA_MDDEPEND_FILES += bar.c.pp',
+-            'bar.c: %s/generate-bar.py' % env.topsrcdir,
++            '$(MDDEPDIR)/bar.c.stub: %s/generate-bar.py' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,%s/generate-bar.py baz bar.c $(MDDEPDIR)/bar.c.pp)' % env.topsrcdir,
++            '$(call py_action,file_generate,%s/generate-bar.py baz bar.c $(MDDEPDIR)/bar.c.pp $(MDDEPDIR)/bar.c.stub)' % env.topsrcdir,
++            '@$(TOUCH) $@',
+             '',
+-            'export:: foo.c',
++            'export:: $(MDDEPDIR)/foo.c.stub',
++            'foo.c: $(MDDEPDIR)/foo.c.stub ;',
+             'GARBAGE += foo.c',
++            'GARBAGE += $(MDDEPDIR)/foo.c.stub',
+             'EXTRA_MDDEPEND_FILES += foo.c.pp',
+-            'foo.c: %s/generate-foo.py $(srcdir)/foo-data' % (env.topsrcdir),
++            '$(MDDEPDIR)/foo.c.stub: %s/generate-foo.py $(srcdir)/foo-data' % (env.topsrcdir),
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp $(srcdir)/foo-data)' % (env.topsrcdir),
++            '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp $(MDDEPDIR)/foo.c.stub $(srcdir)/foo-data)' % (env.topsrcdir),
++            '@$(TOUCH) $@',
+             '',
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
+     def test_generated_files_force(self):
+         """Ensure GENERATED_FILES with .force is handled properly."""
+         env = self._consume('generated-files-force', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+-            'export:: bar.c',
++            'export:: $(MDDEPDIR)/bar.c.stub',
++            'bar.c: $(MDDEPDIR)/bar.c.stub ;',
+             'GARBAGE += bar.c',
++            'GARBAGE += $(MDDEPDIR)/bar.c.stub',
+             'EXTRA_MDDEPEND_FILES += bar.c.pp',
+-            'bar.c: %s/generate-bar.py FORCE' % env.topsrcdir,
++            '$(MDDEPDIR)/bar.c.stub: %s/generate-bar.py FORCE' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,%s/generate-bar.py baz bar.c $(MDDEPDIR)/bar.c.pp)' % env.topsrcdir,
++            '$(call py_action,file_generate,%s/generate-bar.py baz bar.c $(MDDEPDIR)/bar.c.pp $(MDDEPDIR)/bar.c.stub)' % env.topsrcdir,
++            '@$(TOUCH) $@',
+             '',
+-            'export:: foo.c',
++            'export:: $(MDDEPDIR)/foo.c.stub',
++            'foo.c: $(MDDEPDIR)/foo.c.stub ;',
+             'GARBAGE += foo.c',
++            'GARBAGE += $(MDDEPDIR)/foo.c.stub',
+             'EXTRA_MDDEPEND_FILES += foo.c.pp',
+-            'foo.c: %s/generate-foo.py $(srcdir)/foo-data' % (env.topsrcdir),
++            '$(MDDEPDIR)/foo.c.stub: %s/generate-foo.py $(srcdir)/foo-data' % (env.topsrcdir),
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp $(srcdir)/foo-data)' % (env.topsrcdir),
++            '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp $(MDDEPDIR)/foo.c.stub $(srcdir)/foo-data)' % (env.topsrcdir),
++            '@$(TOUCH) $@',
+             '',
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
+     def test_localized_generated_files(self):
+         """Ensure LOCALIZED_GENERATED_FILES is handled properly."""
+         env = self._consume('localized-generated-files', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+-            'libs:: foo.xyz',
++            'libs:: $(MDDEPDIR)/foo.xyz.stub',
++            'foo.xyz: $(MDDEPDIR)/foo.xyz.stub ;',
+             'GARBAGE += foo.xyz',
++            'GARBAGE += $(MDDEPDIR)/foo.xyz.stub',
+             'EXTRA_MDDEPEND_FILES += foo.xyz.pp',
+-            'foo.xyz: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
++            '$(MDDEPDIR)/foo.xyz.stub: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo.xyz $(MDDEPDIR)/foo.xyz.pp $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo.xyz $(MDDEPDIR)/foo.xyz.pp $(MDDEPDIR)/foo.xyz.stub $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '@$(TOUCH) $@',
+             '',
+             'LOCALIZED_FILES_0_FILES += foo.xyz',
+             'LOCALIZED_FILES_0_DEST = $(FINAL_TARGET)/',
+             'LOCALIZED_FILES_0_TARGET := libs',
+             'INSTALL_TARGETS += LOCALIZED_FILES_0',
+         ]
+ 
+         self.maxDiff = None
+@@ -469,58 +484,80 @@ class TestRecursiveMakeBackend(BackendTe
+     def test_localized_generated_files_force(self):
+         """Ensure LOCALIZED_GENERATED_FILES with .force is handled properly."""
+         env = self._consume('localized-generated-files-force', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+-            'libs:: foo.xyz',
++            'libs:: $(MDDEPDIR)/foo.xyz.stub',
++            'foo.xyz: $(MDDEPDIR)/foo.xyz.stub ;',
+             'GARBAGE += foo.xyz',
++            'GARBAGE += $(MDDEPDIR)/foo.xyz.stub',
+             'EXTRA_MDDEPEND_FILES += foo.xyz.pp',
+-            'foo.xyz: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
++            '$(MDDEPDIR)/foo.xyz.stub: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo.xyz $(MDDEPDIR)/foo.xyz.pp $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo.xyz $(MDDEPDIR)/foo.xyz.pp $(MDDEPDIR)/foo.xyz.stub $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '@$(TOUCH) $@',
+             '',
+-            'libs:: abc.xyz',
++            'libs:: $(MDDEPDIR)/abc.xyz.stub',
++            'abc.xyz: $(MDDEPDIR)/abc.xyz.stub ;',
+             'GARBAGE += abc.xyz',
++            'GARBAGE += $(MDDEPDIR)/abc.xyz.stub',
+             'EXTRA_MDDEPEND_FILES += abc.xyz.pp',
+-            'abc.xyz: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input FORCE' % env.topsrcdir,
++            '$(MDDEPDIR)/abc.xyz.stub: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input FORCE' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main abc.xyz $(MDDEPDIR)/abc.xyz.pp $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main abc.xyz $(MDDEPDIR)/abc.xyz.pp $(MDDEPDIR)/abc.xyz.stub $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '@$(TOUCH) $@',
+             '',
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
+     def test_localized_generated_files_AB_CD(self):
+         """Ensure LOCALIZED_GENERATED_FILES is handled properly
+         when {AB_CD} and {AB_rCD} are used."""
+         env = self._consume('localized-generated-files-AB_CD', RecursiveMakeBackend)
+ 
+         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+ 
+         expected = [
+-            'libs:: foo$(AB_CD).xyz',
++            'libs:: $(MDDEPDIR)/foo$(AB_CD).xyz.stub',
++            'foo$(AB_CD).xyz: $(MDDEPDIR)/foo$(AB_CD).xyz.stub ;',
+             'GARBAGE += foo$(AB_CD).xyz',
++            'GARBAGE += $(MDDEPDIR)/foo$(AB_CD).xyz.stub',
+             'EXTRA_MDDEPEND_FILES += foo$(AB_CD).xyz.pp',
+-            'foo$(AB_CD).xyz: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
++            '$(MDDEPDIR)/foo$(AB_CD).xyz.stub: %s/generate-foo.py $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo$(AB_CD).xyz $(MDDEPDIR)/foo$(AB_CD).xyz.pp $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main foo$(AB_CD).xyz $(MDDEPDIR)/foo$(AB_CD).xyz.pp $(MDDEPDIR)/foo$(AB_CD).xyz.stub $(call MERGE_FILE,localized-input) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '@$(TOUCH) $@',
+             '',
+             'include $(topsrcdir)/config/AB_rCD.mk',
++            'bar$(AB_rCD).xyz: $(MDDEPDIR)/bar$(AB_rCD).xyz.stub ;',
+             'GARBAGE += bar$(AB_rCD).xyz',
++            'GARBAGE += $(MDDEPDIR)/bar$(AB_rCD).xyz.stub'
+             'EXTRA_MDDEPEND_FILES += bar$(AB_rCD).xyz.pp',
+-            'bar$(AB_rCD).xyz: %s/generate-foo.py $(call MERGE_RELATIVE_FILE,localized-input,/locales/inner) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
++            '$(MDDEPDIR)/bar$(AB_rCD).xyz.stub: %s/generate-foo.py $(call MERGE_RELATIVE_FILE,localized-input,inner/locales) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
+             '$(REPORT_BUILD)',
+-            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main bar$(AB_rCD).xyz $(MDDEPDIR)/bar$(AB_rCD).xyz.pp $(call MERGE_RELATIVE_FILE,localized-input,/locales/inner) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main bar$(AB_rCD).xyz $(MDDEPDIR)/bar$(AB_rCD).xyz.pp $(MDDEPDIR)/bar$(AB_rCD).xyz.stub $(call MERGE_RELATIVE_FILE,localized-input,inner/locales) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '@$(TOUCH) $@',
+             '',
++            'zot$(AB_rCD).xyz: $(MDDEPDIR)/zot$(AB_rCD).xyz.stub ;',
++            'GARBAGE += zot$(AB_rCD).xyz',
++            'GARBAGE += $(MDDEPDIR)/zot$(AB_rCD).xyz.stub',
++            'EXTRA_MDDEPEND_FILES += zot$(AB_rCD).xyz.pp',
++            '$(MDDEPDIR)/zot$(AB_rCD).xyz.stub: %s/generate-foo.py $(call MERGE_RELATIVE_FILE,localized-input,locales) $(srcdir)/non-localized-input $(if $(IS_LANGUAGE_REPACK),FORCE)' % env.topsrcdir,
++            '$(REPORT_BUILD)',
++            '$(call py_action,file_generate,--locale=$(AB_CD) %s/generate-foo.py main zot$(AB_rCD).xyz $(MDDEPDIR)/zot$(AB_rCD).xyz.pp $(MDDEPDIR)/zot$(AB_rCD).xyz.stub $(call MERGE_RELATIVE_FILE,localized-input,locales) $(srcdir)/non-localized-input)' % env.topsrcdir,
++            '@$(TOUCH) $@',
++             '',
++
+         ]
+ 
+         self.maxDiff = None
+         self.assertEqual(lines, expected)
+ 
+     def test_exports_generated(self):
+         """Ensure EXPORTS that are listed in GENERATED_FILES
+         are handled properly."""

+ 44 - 0
bug1240930-253/mozilla/1454912-4-62a1.patch

@@ -0,0 +1,44 @@
+# HG changeset patch
+# User Mike Shal <mshal@mozilla.com>
+# Date 1525899064 14400
+# Node ID 9260cc524bb54d9318075578488de8a6f40677eb
+# Parent  1eb04a9bfb7a82eb6fac5e29be7c6b03999d9361
+Bug 1454912 - Revert "Bug 1218999 - Update mtimes when building a GENERATED_FILES target, even when contents don't change."; r=nalexander
+
+We no longer want to update mtimes of FileAvoidWrites so that downstream
+rules aren't triggered if the files aren't changed. Since the .stub file
+target of GENERATED_FILES are always touched, make won't continually
+rebuild them.
+
+MozReview-Commit-ID: GxrFgCJTYk
+
+diff --git a/python/mozbuild/mozbuild/action/file_generate.py b/python/mozbuild/mozbuild/action/file_generate.py
+--- a/python/mozbuild/mozbuild/action/file_generate.py
++++ b/python/mozbuild/mozbuild/action/file_generate.py
+@@ -95,25 +95,16 @@ def main(argv):
+                 # Add dependencies on any buildconfig items that were accessed
+                 # by the script.
+                 deps |= set(buildconfig.get_dependencies())
+ 
+                 mk = Makefile()
+                 mk.create_rule([args.dep_target]).add_dependencies(deps)
+                 with FileAvoidWrite(args.dep_file) as dep_file:
+                     mk.dump(dep_file)
+-        # Even when our file's contents haven't changed, we want to update
+-        # the file's mtime so make knows this target isn't still older than
+-        # whatever prerequisite caused it to be built this time around.
+-        try:
+-            os.utime(args.output_file, None)
+-        except:
+-            print('Error processing file "{0}"'.format(args.output_file),
+-                  file=sys.stderr)
+-            traceback.print_exc()
+     except IOError as e:
+         print('Error opening file "{0}"'.format(e.filename), file=sys.stderr)
+         traceback.print_exc()
+         return 1
+     return ret
+ 
+ if __name__ == '__main__':
+     sys.exit(main(sys.argv[1:]))
+

+ 177 - 0
bug1240930-253/mozilla/1455504-62a1.patch

@@ -0,0 +1,177 @@
+# HG changeset patch
+# User Chris Manchester <cmanchester@mozilla.com>
+# Date 1524613176 25200
+# Node ID b0e196352e1727b1df0ad2318a5587f62c9131ef
+# Parent  7f1909255cc9b55bae03e7a2ee947af96a066a1c
+Bug 1455504 - Normalize library paths to work around windows incremental linking bug. r=ted
+
+MozReview-Commit-ID: DuZaGMKVZrn
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1295,18 +1295,19 @@ class RecursiveMakeBackend(CommonBackend
+     def _process_host_shared_library(self, libdef, backend_file):
+         backend_file.write('HOST_SHARED_LIBRARY = %s\n' % libdef.lib_name)
+ 
+     def _build_target_for_obj(self, obj):
+         return '%s/%s' % (mozpath.relpath(obj.objdir,
+             self.environment.topobjdir), obj.KIND)
+ 
+     def _process_linked_libraries(self, obj, backend_file):
+-        def pretty_relpath(lib):
+-            return '$(DEPTH)/%s' % mozpath.relpath(lib.objdir, topobjdir)
++        def pretty_relpath(lib, name):
++            return os.path.normpath(mozpath.join(mozpath.relpath(lib.objdir, obj.objdir),
++                                                 name))
+ 
+         topobjdir = mozpath.normsep(obj.topobjdir)
+         # This will create the node even if there aren't any linked libraries.
+         build_target = self._build_target_for_obj(obj)
+         self._compile_graph[build_target]
+ 
+         objs, no_pgo_objs, shared_libs, os_libs, static_libs = self._expand_libs(obj)
+ 
+@@ -1368,34 +1369,34 @@ class RecursiveMakeBackend(CommonBackend
+                                                          pgo_list_file_path)
+                 backend_file.write_once('%s_PGO_OBJS := %s\n' %
+                                         (obj.name, pgo_list_file_ref))
+                 backend_file.write_once('%s: %s\n' % (obj_target,
+                                                       pgo_list_file_path))
+             write_obj_deps(obj_target, objs_ref, pgo_objs_ref)
+ 
+         for lib in shared_libs:
+-            backend_file.write_once('SHARED_LIBS += %s/%s\n' %
+-                                    (pretty_relpath(lib), lib.import_name))
++            backend_file.write_once('SHARED_LIBS += %s\n' %
++                                    pretty_relpath(lib, lib.import_name))
+         for lib in static_libs:
+-            backend_file.write_once('STATIC_LIBS += %s/%s\n' %
+-                                    (pretty_relpath(lib), lib.import_name))
++            backend_file.write_once('STATIC_LIBS += %s\n' %
++                                    pretty_relpath(lib, lib.import_name))
+         for lib in os_libs:
+             if obj.KIND == 'target':
+                 backend_file.write_once('OS_LIBS += %s\n' % lib)
+             else:
+                 backend_file.write_once('HOST_EXTRA_LIBS += %s\n' % lib)
+ 
+         for lib in obj.linked_libraries:
+             if not isinstance(lib, ExternalLibrary):
+                 self._compile_graph[build_target].add(
+                     self._build_target_for_obj(lib))
+-            if isinstance(lib, HostRustLibrary):
+-                backend_file.write_once('HOST_LIBS += %s/%s\n' %
+-                                        (pretty_relpath(lib), lib.import_name))
++            if isinstance(lib, (HostRustLibrary)):
++                backend_file.write_once('HOST_LIBS += %s\n' %
++                                        pretty_relpath(lib, lib.import_name))
+ 
+         # We have to link any Rust libraries after all intermediate static
+         # libraries have been listed to ensure that the Rust libraries are
+         # searched after the C/C++ objects that might reference Rust symbols.
+         if isinstance(obj, SharedLibrary):
+             self._process_rust_libraries(obj, backend_file, pretty_relpath)
+ 
+         # Process library-based defines
+@@ -1410,18 +1411,18 @@ class RecursiveMakeBackend(CommonBackend
+             return
+ 
+         # We should have already checked this in Linkable.link_library.
+         assert len(direct_linked) == 1
+ 
+         # TODO: see bug 1310063 for checking dependencies are set up correctly.
+ 
+         direct_linked = direct_linked[0]
+-        backend_file.write('RUST_STATIC_LIB_FOR_SHARED_LIB := %s/%s\n' %
+-                           (pretty_relpath(direct_linked), direct_linked.import_name))
++        backend_file.write('RUST_STATIC_LIB_FOR_SHARED_LIB := %s\n' %
++                           pretty_relpath(direct_linked, direct_linked.import_name))
+ 
+     def _process_final_target_files(self, obj, files, backend_file):
+         target = obj.install_target
+         path = mozpath.basedir(target, (
+             'dist/bin',
+             'dist/xpi-stage',
+             '_tests',
+             'dist/include',
+diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
++++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+@@ -1042,44 +1042,45 @@ class TestRecursiveMakeBackend(BackendTe
+ 
+             for line in lines:
+                 self.assertNotIn('LIB_IS_C_ONLY', line)
+ 
+     def test_linkage(self):
+         env = self._consume('linkage', RecursiveMakeBackend)
+         expected_linkage = {
+             'prog': {
+-                'SHARED_LIBS': ['$(DEPTH)/prog/qux/qux.so',
+-                                '$(DEPTH)/shared/baz.so'],
+-                'STATIC_LIBS': ['$(DEPTH)/real/foo.a'],
++                'SHARED_LIBS': ['qux/qux.so',
++                                '../shared/baz.so'],
++                'STATIC_LIBS': ['../real/foo.a'],
+                 'OS_LIBS': ['-lfoo', '-lbaz', '-lbar'],
+             },
+             'shared': {
+                 'OS_LIBS': ['-lfoo'],
+-                'SHARED_LIBS': ['$(DEPTH)/prog/qux/qux.so'],
++                'SHARED_LIBS': ['../prog/qux/qux.so'],
+                 'STATIC_LIBS': [],
+             },
+             'static': {
+-                'STATIC_LIBS': ['$(DEPTH)/real/foo.a'],
++                'STATIC_LIBS': ['../real/foo.a'],
+                 'OS_LIBS': ['-lbar'],
+-                'SHARED_LIBS': ['$(DEPTH)/prog/qux/qux.so'],
++                'SHARED_LIBS': ['../prog/qux/qux.so'],
+             },
+             'real': {
+                 'STATIC_LIBS': [],
+-                'SHARED_LIBS': ['$(DEPTH)/prog/qux/qux.so'],
++                'SHARED_LIBS': ['../prog/qux/qux.so'],
+                 'OS_LIBS': ['-lbaz'],
+             }
+         }
+         actual_linkage = {}
+         for name in expected_linkage.keys():
+             with open(os.path.join(env.topobjdir, name, 'backend.mk'), 'rb') as fh:
+                 actual_linkage[name] = [line.rstrip() for line in fh.readlines()]
+         for name in expected_linkage:
+             for var in expected_linkage[name]:
+                 for val in expected_linkage[name][var]:
++                    val = os.path.normpath(val)
+                     line = '%s += %s' % (var, val)
+                     self.assertIn(line,
+                                   actual_linkage[name])
+                     actual_linkage[name].remove(line)
+                 for line in actual_linkage[name]:
+                     self.assertNotIn('%s +=' % var, line)
+ 
+     def test_list_files(self):
+@@ -1092,21 +1093,21 @@ class TestRecursiveMakeBackend(BackendTe
+             ],
+             'shared/baz_so.list': [
+                 'baz/baz1.o',
+             ],
+         }
+         actual_list_files = {}
+         for name in expected_list_files.keys():
+             with open(os.path.join(env.topobjdir, name), 'rb') as fh:
+-                actual_list_files[name] = [mozpath.normsep(line.rstrip())
++                actual_list_files[name] = [line.rstrip()
+                                            for line in fh.readlines()]
+         for name in expected_list_files:
+             self.assertEqual(actual_list_files[name],
+-                             expected_list_files[name])
++                             [os.path.normpath(f) for f in expected_list_files[name]])
+ 
+         # We don't produce a list file for a shared library composed only of
+         # object files in its directory, but instead list them in a variable.
+         with open(os.path.join(env.topobjdir, 'prog', 'qux', 'backend.mk'), 'rb') as fh:
+             lines = [line.rstrip() for line in fh.readlines()]
+ 
+         self.assertIn('qux.so_OBJS := qux1.o', lines)
+ 

+ 74 - 0
bug1240930-253/mozilla/1457321-1only-62a1.patch

@@ -0,0 +1,74 @@
+# HG changeset patch
+# User Kris Maglione <maglione.k@gmail.com>
+# Date 1524868975 25200
+# Node ID fe5d46cd794bfb3e8974d8213cb3fa752902ef3b
+# Parent  0dabdf7580cc81b98ffc96a9c7072df386bbf897
+Bug 1457321: Part 1 - Add bundled dictionaries to built_in_addons.json. r=ted,rhelmer
+
+MozReview-Commit-ID: GxCSXXaz8kz
+
+diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in
+--- a/browser/app/Makefile.in
++++ b/browser/app/Makefile.in
+@@ -101,9 +101,9 @@ ifdef MOZ_UPDATER
+ 	mv -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices'
+ 	ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater'
+ endif
+ 	printf APPLMOZB > '$(dist_dest)/Contents/PkgInfo'
+ endif
+ 
+ .PHONY: features
+ tools features::
+-	$(PYTHON) -c 'import os, json; listing = {"system": sorted(os.listdir("$(DIST)/bin/browser/features"))}; print json.dumps(listing)' > $(DIST)/bin/browser/chrome/browser/content/browser/built_in_addons.json
++	$(call py_action,generate_builtin_addons,--features=browser/features browser/chrome/browser/content/browser/built_in_addons.json)
+diff --git a/python/mozbuild/mozbuild/action/generate_builtin_addons.py b/python/mozbuild/mozbuild/action/generate_builtin_addons.py
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/action/generate_builtin_addons.py
+@@ -0,0 +1,46 @@
++# 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/.
++
++from __future__ import absolute_import, print_function, unicode_literals
++
++import argparse
++import json
++import os.path
++import sys
++
++import buildconfig
++
++
++def main(argv):
++    parser = argparse.ArgumentParser(
++        description='Produces a JSON manifest of built-in add-ons')
++    parser.add_argument('--features', type=str, dest='featuresdir',
++                        action='store', help=('The distribution sub-directory '
++                                              'containing feature add-ons'))
++    parser.add_argument('outputfile', help='File to write output to')
++    args = parser.parse_args(argv)
++
++    bindir = os.path.join(buildconfig.topobjdir, 'dist/bin')
++
++    def find_dictionaries(path):
++        dicts = {}
++        for filename in os.listdir(os.path.join(bindir, path)):
++            base, ext = os.path.splitext(filename)
++            if ext == '.dic':
++                dicts[base] = '%s/%s' % (path, filename)
++        return dicts
++
++    listing = {
++        "dictionaries": find_dictionaries("dictionaries"),
++    }
++    if args.featuresdir:
++        listing["system"] = sorted(os.listdir(os.path.join(bindir,
++                                                           args.featuresdir)))
++
++    with open(os.path.join(bindir, args.outputfile), 'w') as fh:
++        json.dump(listing, fh, sort_keys=True)
++
++
++if __name__ == '__main__':
++    sys.exit(main(sys.argv[1:]))

+ 40 - 0
bug1240930-253/mozilla/1459597-62a1.patch

@@ -0,0 +1,40 @@
+# HG changeset patch
+# User Ted Mielczarek <ted@mielczarek.org>
+# Date 1526054172 14400
+# Node ID bad54bae22fada00a6441796e2f9e181ccd3d2fd
+# Parent  a9c20695f9621c00de310dfcb208655e6866d16f
+bug 1459597 - fix Original Filename display in Windows file version info. r=chmanchester
+
+MozReview-Commit-ID: 1JdpRcbS6qN
+
+diff --git a/config/version.mk b/config/version.mk
+--- a/config/version.mk
++++ b/config/version.mk
+@@ -18,23 +18,23 @@ RESFILE=./module.res
+ _RC_STRING = -QUIET 1 -DEPTH $(DEPTH) -TOPSRCDIR $(MOZILLA_DIR) -OBJDIR . -SRCDIR $(srcdir) -DISPNAME "$(MOZ_APP_DISPLAYNAME)" -APPVERSION $(MOZ_APP_VERSION)
+ ifdef MOZILLA_OFFICIAL
+ _RC_STRING += -OFFICIAL 1
+ endif
+ ifdef MOZ_DEBUG
+ _RC_STRING += -DEBUG 1
+ endif
+ ifdef PROGRAM
+-_RC_STRING += -BINARY $(PROGRAM)
++_RC_STRING += -BINARY $(notdir $(PROGRAM))
+ else
+ ifdef _PROGRAM
+-_RC_STRING += -BINARY $(_PROGRAM)
++_RC_STRING += -BINARY $(notdir $(_PROGRAM))
+ else
+ ifdef SHARED_LIBRARY
+-_RC_STRING += -BINARY $(SHARED_LIBRARY)
++_RC_STRING += -BINARY $(notdir $(SHARED_LIBRARY))
+ endif
+ endif
+ endif
+ ifdef RCINCLUDE
+ _RC_STRING += -RCINCLUDE $(srcdir)/$(RCINCLUDE)
+ endif
+ 
+ GARBAGE += $(RESFILE) $(RCFILE)
+

+ 53 - 0
bug1240930-253/mozilla/1461383-62a1.patch

@@ -0,0 +1,53 @@
+# HG changeset patch
+# User Nathan Froyd <froydnj@mozilla.com>
+# Date 1526393123 14400
+# Node ID 73dd77918ce5997d13cefc2cae32c7ae4644ce82
+# Parent  d52f0d61dd570ae9414bfad4dd3df88051466fdd
+Bug 1461383 - fix test_build.py for local builds; r=chmanchester,f=mshal
+
+test_build.py fails on local builds with messages like:
+
+make[4]: Entering directory '/tmp/tmp65BjCH'
+make[4]: *** No rule to make target 'buildid.h'.  Stop.
+make[4]: Leaving directory '/tmp/tmp65BjCH'
+/home/froydnj/src/gecko-dev.git/config/faster/rules.mk:76: recipe for target '/tmp/tmp65BjCH/buildid.h' failed
+make[3]: *** [/tmp/tmp65BjCH/buildid.h] Error 2
+make[3]: *** Waiting for unfinished jobs....
+make[4]: Entering directory '/tmp/tmp65BjCH'
+make[4]: *** No rule to make target 'source-repo.h'.  Stop.
+make[4]: Leaving directory '/tmp/tmp65BjCH'
+/home/froydnj/src/gecko-dev.git/config/faster/rules.mk:76: recipe for target '/tmp/tmp65BjCH/source-repo.h' failed
+make[3]: *** [/tmp/tmp65BjCH/source-repo.h] Error 2
+make[3]: Leaving directory '/tmp/tmp65BjCH/faster'
+Makefile:155: recipe for target 'faster' failed
+
+The tests pass in automation, however, because automation always defines
+the rules for buildid.h and source-repo.h in the toplevel Makefile.in.
+For local builds, however, those rules are not defined to avoid build
+churn.  Let's ensure that the necessary rules are defined during testing
+as well.
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -28,18 +28,18 @@ DIST_GARBAGE = config.cache config.log c
+    config/autoconf.mk \
+    mozilla-config.h \
+    netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
+    .mozconfig.mk
+ 
+ ifndef MOZ_PROFILE_USE
+ # Automation builds should always have a new buildid, but for the sake of not
+ # re-linking libxul on every incremental build we do not enforce this for
+-# developer builds.
+-ifneq (,$(MOZ_AUTOMATION)$(MOZ_BUILD_DATE))
++# developer builds.  Tests always need a new buildid as well.
++ifneq (,$(MOZ_AUTOMATION)$(MOZ_BUILD_DATE)$(TEST_MOZBUILD))
+ buildid.h source-repo.h: FORCE
+ endif
+ endif
+ 
+ BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
+ 
+ ifndef TEST_MOZBUILD
+ ifndef MOZ_PROFILE_USE

+ 71 - 0
bug1240930-253/mozilla/1461881-62a1.patch

@@ -0,0 +1,71 @@
+# HG changeset patch
+# User Mike Shal <mshal@mozilla.com>
+# Date 1526485927 14400
+# Node ID b6306fd112d2d33f192ba4cae93edc8478d9ab7f
+# Parent  8a38e426dde23253b7709a6d20e53d62e73fab8d
+Bug 1461881 - Fix packager.mk file_generate actions; r=Pike
+
+Bug 1454912 added a new argument to the file_generate action to
+correspond to the make target in the generated dependencies file. These
+multilocale.txt targets in packager.mk need to add a parameter for this
+argument, otherwise the first locale will be silently used as the target
+and won't be included in the resulting multilocale.txt file.
+
+MozReview-Commit-ID: 3nW5Twj89VH
+
+diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk
+--- a/toolkit/mozapps/installer/packager.mk
++++ b/toolkit/mozapps/installer/packager.mk
+@@ -186,24 +186,24 @@ else
+ BASE_PATH:=@RESPATH@
+ MULTILOCALE_DIR = $(DIST)/$(RESPATH)/res
+ endif
+ 
+ # This version of the target uses MOZ_CHROME_MULTILOCALE to build multilocale.txt
+ # and places it in dist/bin/res - it should be used when packaging a build.
+ multilocale.txt: LOCALES?=$(MOZ_CHROME_MULTILOCALE)
+ multilocale.txt:
+-	$(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp $(ALL_LOCALES))
++	$(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp '$(MULTILOCALE_DIR)/multilocale.txt' $(ALL_LOCALES))
+ 
+ # This version of the target uses AB_CD to build multilocale.txt and places it
+ # in the $(XPI_NAME)/res dir - it should be used when repackaging a build.
+ multilocale.txt-%: LOCALES?=$(AB_CD)
+ multilocale.txt-%: MULTILOCALE_DIR=$(DIST)/xpi-stage/$(XPI_NAME)/res
+ multilocale.txt-%:
+-	$(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp $(ALL_LOCALES))
++	$(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp '$(MULTILOCALE_DIR)/multilocale.txt' $(ALL_LOCALES))
+ 
+ locale-manifest.in: LOCALES?=$(MOZ_CHROME_MULTILOCALE)
+ locale-manifest.in: $(GLOBAL_DEPS) FORCE
+ 	printf '\n[multilocale]\n' > $@
+ 	printf '$(BASE_PATH)/res/multilocale.txt\n' >> $@
+ 	for LOCALE in $(ALL_LOCALES) ;\
+ 	do \
+ 	  for ENTRY in $(MOZ_CHROME_LOCALE_ENTRIES) ;\
+diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in
+deleted file mode 100644
+--- a/toolkit/xre/Makefile.in
++++ /dev/null
+@@ -1,21 +0,0 @@
+-# -*- makefile -*-
+-# vim:set ts=8 sw=8 sts=8 noet:
+-
+-# 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/.
+-
+-milestone_txt = $(topsrcdir)/config/milestone.txt
+-
+-include $(topsrcdir)/config/rules.mk
+-
+-MOZ_BUILDID   := $(shell awk '{print $$3}' $(DEPTH)/buildid.h)
+-$(call errorIfEmpty,GRE_MILESTONE MOZ_BUILDID)
+-
+-MK_COMPILE_DEFINES = -DMOZ_BUILDID=$(MOZ_BUILDID)
+-
+-# Note these dependencies are broken because the target is *not* the cpp file.
+-# BUT, actually fixing it would make libxul rebuilt on every single incremental
+-# build because of the automatic buildid change. This is why we can't actually
+-# include buildid.h there, because it would add the dependency.
+-$(srcdir)/nsAppRunner.cpp: $(DEPTH)/buildid.h $(milestone_txt)

File diff suppressed because it is too large
+ 102 - 0
bug1240930-253/mozilla/1464128-62a1.patch


+ 43 - 0
bug1240930-253/mozilla/1464381-62a1.patch

@@ -0,0 +1,43 @@
+# HG changeset patch
+# User Nick Alexander <nalexander@mozilla.com>
+# Date 1527287839 25200
+# Node ID eaefe57724c7cdf82de3dd524094cf119de734e6
+# Parent  12bfa62dcd976f8185c2842cd9bdaa4d39d58b0f
+Bug 1464381 - Fix check for NIGHTLY_BUILD. r=gps
+
+This was simply an oversight in the implementation of Bug 1464128.
+What's happening is that `set_config` in `moz.configure` is not
+unconditional, and NIGHTLY_BUILD is set in local builds and in B and N
+builds in automation, so there was no test of the other case, which
+promptly fails.  This re-uses a pattern successful in mobile/android
+for setting defines.
+
+MozReview-Commit-ID: 4zL4hVsqE3Q
+
+diff --git a/browser/locales/generate_bookmarks.py b/browser/locales/generate_bookmarks.py
+--- a/browser/locales/generate_bookmarks.py
++++ b/browser/locales/generate_bookmarks.py
+@@ -24,19 +24,22 @@ def main(output, bookmarks_html_in, book
+     # no localized input uses the preprocessor conditional #if (really,
+     # anything but #define), so it's safe to restrict the set of defines to
+     # what's used in mozilla-central directly.
+     defines = {}
+     defines['AB_CD'] = locale
+     if defines['AB_CD'] == 'ja-JP-mac':
+         defines['AB_CD'] = 'ja'
+ 
+-    defines['NIGHTLY_BUILD'] = CONFIG['NIGHTLY_BUILD']
+     defines['BOOKMARKS_INCLUDE_PATH'] = bookmarks_inc
+ 
++    for var in ('NIGHTLY_BUILD',):
++        if var in CONFIG:
++            defines[var] = CONFIG[var]
++
+     includes = preprocessor.preprocess(includes=[bookmarks_html_in],
+                                        defines=defines,
+                                        output=output)
+     return includes
+ 
+ 
+ if __name__ == "__main__":
+     main(sys.argv[1:])

+ 285 - 0
bug1240930-253/mozilla/1469067-62a1.patch

@@ -0,0 +1,285 @@
+# HG changeset patch
+# User Chris Manchester <cmanchester@mozilla.com>
+# Date 1529356940 25200
+# Node ID 33c34fbb0b0d7e890c1985c3ba896dd1a238dd1d
+# Parent  81864d0dfb82a4d1812607225114797c1d1df052
+Bug 1469067 - Build host programs in their final locations rather than copying them to dist/host/bin. r=mshal
+
+MozReview-Commit-ID: BrSou1ee2qV
+
+diff --git a/config/makefiles/target_binaries.mk b/config/makefiles/target_binaries.mk
+--- a/config/makefiles/target_binaries.mk
++++ b/config/makefiles/target_binaries.mk
+@@ -17,18 +17,18 @@ endif
+ 
+ ifdef SHARED_LIBRARY
+ SHARED_LIBRARY_FILES = $(SHARED_LIBRARY)
+ SHARED_LIBRARY_DEST ?= $(FINAL_TARGET)
+ SHARED_LIBRARY_TARGET = target
+ INSTALL_TARGETS += SHARED_LIBRARY
+ endif # SHARED_LIBRARY
+ 
+-ifneq (,$(strip $(HOST_SIMPLE_PROGRAMS)$(HOST_PROGRAM)))
+-HOST_PROGRAMS_EXECUTABLES = $(HOST_SIMPLE_PROGRAMS) $(HOST_PROGRAM) $(HOST_RUST_PROGRAMS)
++ifneq (,$(strip $(HOST_SIMPLE_PROGRAMS)))
++HOST_PROGRAMS_EXECUTABLES = $(HOST_SIMPLE_PROGRAMS) $(HOST_RUST_PROGRAMS)
+ HOST_PROGRAMS_DEST ?= $(DIST)/host/bin
+ HOST_PROGRAMS_TARGET = host
+ INSTALL_TARGETS += HOST_PROGRAMS
+ endif
+ 
+ endif # !NO_DIST_INSTALL
+ 
+ # EOF
+diff --git a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -560,32 +560,32 @@ endif # WINNT && !GNU_CC
+ 
+ ifdef ENABLE_STRIP
+ 	$(STRIP) $(STRIP_FLAGS) $@
+ endif
+ ifdef MOZ_POST_PROGRAM_COMMAND
+ 	$(MOZ_POST_PROGRAM_COMMAND) $@
+ endif
+ 
+-$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
++$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS) $(call mkdir_deps,$(DEPTH)/dist/host/bin)
+ 	$(REPORT_BUILD)
+ ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
+ 	$(HOST_LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $($(notdir $@)_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LINKER_LIBPATHS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
+ ifdef MSMANIFEST_TOOL
+ 	@if test -f $@.manifest; then \
+-		if test -f '$(srcdir)/$@.manifest'; then \
+-			echo 'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
+-			$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
++               if test -f '$(srcdir)/$(notdir $@).manifest'; then \
++                       echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest and $@.manifest'; \
++                       $(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
+ 		else \
+ 			echo 'Embedding manifest from $@.manifest'; \
+ 			$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
+ 		fi; \
+-	elif test -f '$(srcdir)/$@.manifest'; then \
+-		echo 'Embedding manifest from $(srcdir)/$@.manifest'; \
+-		$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' -OUTPUTRESOURCE:$@\;1; \
++       elif test -f '$(srcdir)/$(notdir $@).manifest'; then \
++               echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest'; \
++               $(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' -OUTPUTRESOURCE:$@\;1; \
+ 	fi
+ endif	# MSVC with manifest tool
+ else
+ ifeq ($(HOST_CPP_PROG_LINK),1)
+ 	$(HOST_CXX) -o $@ $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $($(notdir $@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
+ else
+ 	$(HOST_CC) -o $@ $(HOST_C_LDFLAGS) $(HOST_LDFLAGS) $($(notdir $@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
+ endif # HOST_CPP_PROG_LINK
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -628,17 +628,17 @@ class RecursiveMakeBackend(CommonBackend
+             self._process_rust_tests(obj, backend_file)
+ 
+         elif isinstance(obj, Program):
+             self._process_program(obj, backend_file)
+             self._process_linked_libraries(obj, backend_file)
+             self._no_skip['syms'].add(backend_file.relobjdir)
+ 
+         elif isinstance(obj, HostProgram):
+-            self._process_host_program(obj.program, backend_file)
++            self._process_host_program(obj, backend_file)
+             self._process_linked_libraries(obj, backend_file)
+ 
+         elif isinstance(obj, SimpleProgram):
+             self._process_simple_program(obj, backend_file)
+             self._process_linked_libraries(obj, backend_file)
+             self._no_skip['syms'].add(backend_file.relobjdir)
+ 
+         elif isinstance(obj, HostSimpleProgram):
+@@ -1101,17 +1101,18 @@ class RecursiveMakeBackend(CommonBackend
+         ))
+ 
+     def _process_program(self, obj, backend_file):
+         backend_file.write('PROGRAM = %s\n' % self._pretty_path(obj.output_path, backend_file))
+         if not obj.cxx_link and not self.environment.bin_suffix:
+             backend_file.write('PROG_IS_C_ONLY_%s := 1\n' % obj.program)
+ 
+     def _process_host_program(self, program, backend_file):
+-        backend_file.write('HOST_PROGRAM = %s\n' % program)
++        backend_file.write('HOST_PROGRAM = %s\n' %
++                           self._pretty_path(program.output_path, backend_file))
+ 
+     def _process_rust_program_base(self, obj, backend_file,
+                                    target_variable,
+                                    target_cargo_variable):
+         backend_file.write_once('CARGO_FILE := %s\n' % obj.cargo_file)
+         backend_file.write_once('CARGO_TARGET_DIR := .\n')
+         backend_file.write('%s += %s\n' % (target_variable, obj.location))
+         backend_file.write('%s += %s\n' % (target_cargo_variable, obj.name))
+diff --git a/python/mozbuild/mozbuild/backend/tup.py b/python/mozbuild/mozbuild/backend/tup.py
+--- a/python/mozbuild/mozbuild/backend/tup.py
++++ b/python/mozbuild/mozbuild/backend/tup.py
+@@ -458,17 +458,22 @@ class TupBackend(CommonBackend):
+     def _gen_host_programs(self, backend_file):
+         for p in backend_file.host_programs:
+             self._gen_host_program(backend_file, p)
+ 
+ 
+     def _gen_host_program(self, backend_file, prog):
+         _, _, _, extra_libs, _ = self._expand_libs(prog)
+         objs = prog.objs
+-        outputs = [prog.program]
++
++        if isinstance(prog, HostSimpleProgram):
++            outputs = [prog.name]
++        else:
++            outputs = [mozpath.relpath(prog.output_path.full_path,
++                                       backend_file.objdir)]
+         host_libs = []
+         for lib in prog.linked_libraries:
+             if isinstance(lib, HostLibrary):
+                 host_libs.append(lib)
+         host_libs = self._lib_paths(backend_file.objdir, host_libs)
+ 
+         inputs = objs + host_libs
+         use_cxx = any(f.endswith(('.cc', '.cpp')) for f in prog.source_files())
+diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
+--- a/python/mozbuild/mozbuild/frontend/data.py
++++ b/python/mozbuild/mozbuild/frontend/data.py
+@@ -507,16 +507,20 @@ class Program(BaseProgram):
+     KIND = 'target'
+ 
+ 
+ class HostProgram(HostMixin, BaseProgram):
+     """Context derived container object for HOST_PROGRAM"""
+     SUFFIX_VAR = 'HOST_BIN_SUFFIX'
+     KIND = 'host'
+ 
++    @property
++    def install_target(self):
++        return 'dist/host/bin'
++
+ 
+ class SimpleProgram(BaseProgram):
+     """Context derived container object for each program in SIMPLE_PROGRAMS"""
+     SUFFIX_VAR = 'BIN_SUFFIX'
+     KIND = 'target'
+ 
+     def source_files(self):
+         for srcs in self.sources.values():
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/final-target/moz.build b/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/final-target/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/final-target/moz.build
+@@ -0,0 +1,5 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++FINAL_TARGET = 'final/target'
++HostProgram('final-target')
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/installed/moz.build b/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/installed/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/installed/moz.build
+@@ -0,0 +1,4 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++HostProgram('dist-host-bin')
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/moz.build b/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/moz.build
+@@ -0,0 +1,12 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++@template
++def HostProgram(name):
++    HOST_PROGRAM = name
++
++DIRS += [
++    'final-target',
++    'installed',
++    'not-installed',
++]
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/not-installed/moz.build b/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/not-installed/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/host-program-paths/not-installed/moz.build
+@@ -0,0 +1,5 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++DIST_INSTALL = False
++HostProgram('not-installed')
+\ No newline at end of file
+diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
++++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+@@ -19,16 +19,17 @@ from mozbuild.frontend.data import (
+     ConfigFileSubstitution,
+     Defines,
+     DirectoryTraversal,
+     Exports,
+     FinalTargetPreprocessedFiles,
+     GeneratedFile,
+     GeneratedSources,
+     HostDefines,
++    HostProgram,
+     HostRustLibrary,
+     HostRustProgram,
+     HostSources,
+     IPDLCollection,
+     JARManifest,
+     LinkageMultipleRustLibrariesError,
+     LocalInclude,
+     LocalizedFiles,
+@@ -70,16 +71,17 @@ class TestEmitterBasic(unittest.TestCase
+     def tearDown(self):
+         os.environ.clear()
+         os.environ.update(self._old_env)
+ 
+     def reader(self, name, enable_tests=False, extra_substs=None):
+         substs = dict(
+             ENABLE_TESTS='1' if enable_tests else '',
+             BIN_SUFFIX='.prog',
++            HOST_BIN_SUFFIX='.hostprog',
+             OS_TARGET='WINNT',
+             COMPILE_ENVIRONMENT='1',
+             STL_FLAGS=['-I/path/to/topobjdir/dist/stl_wrappers'],
+             VISIBILITY_FLAGS=['-include',
+                               '$(topsrcdir)/config/gcc_hidden.h'],
+             OBJ_SUFFIX='obj',
+         )
+         if extra_substs:
+@@ -694,16 +696,28 @@ class TestEmitterBasic(unittest.TestCase
+         prog_paths = [o.output_path for o in objs if isinstance(o, Program)]
+         self.assertEqual(prog_paths, [
+             '!/dist/bin/dist-bin.prog',
+             '!/dist/bin/foo/dist-subdir.prog',
+             '!/final/target/final-target.prog',
+             '!not-installed.prog',
+         ])
+ 
++    def test_host_program_paths(self):
++        """The destination of a HOST_PROGRAM (almost always dist/host/bin)
++        should be accurately reflected in Program.output_path."""
++        reader = self.reader('host-program-paths')
++        objs = self.read_topsrcdir(reader)
++        prog_paths = [o.output_path for o in objs if isinstance(o, HostProgram)]
++        self.assertEqual(prog_paths, [
++            '!/dist/host/bin/final-target.hostprog',
++            '!/dist/host/bin/dist-host-bin.hostprog',
++            '!not-installed.hostprog',
++        ])
++
+     def test_test_manifest_missing_manifest(self):
+         """A missing manifest file should result in an error."""
+         reader = self.reader('test-manifest-missing-manifest')
+ 
+         with self.assertRaisesRegexp(BuildReaderError, 'IOError: Missing files'):
+             self.read_topsrcdir(reader)
+ 
+     def test_empty_test_manifest_rejected(self):
+

+ 37 - 0
bug1240930-253/mozilla/1470552-62a1.patch

@@ -0,0 +1,37 @@
+# HG changeset patch
+# User Chris Manchester <cmanchester@mozilla.com>
+# Date 1529705439 25200
+# Node ID 1dbc843c1429a374579251d6c843e11bd211ec28
+# Parent  6aec9dc32d1c194f22d98bc51e886678ff0ba200
+Bug 1470552 - Update Makefile.in to refer to stub file target for buildid.h and source-repo.h generated in backend.mk r=froydnj
+
+MozReview-Commit-ID: CxLkQjX8veW
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -30,17 +30,23 @@ DIST_GARBAGE = config.cache config.log c
+    netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
+    .mozconfig.mk
+ 
+ ifndef MOZ_PROFILE_USE
+ # Automation builds should always have a new buildid, but for the sake of not
+ # re-linking libxul on every incremental build we do not enforce this for
+ # developer builds.  Tests always need a new buildid as well.
+ ifneq (,$(MOZ_AUTOMATION)$(MOZ_BUILD_DATE)$(TEST_MOZBUILD))
+-buildid.h source-repo.h: FORCE
++$(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
++endif
++# Additionally, provide a dummy target during tests, because
++# faster/rules.mk will expect these targets to exist.
++ifdef TEST_MOZBUILD
++source-repo.h: $(MDDEPDIR)/source-repo.h.stub
++buildid.h: $(MDDEPDIR)/buildid.h.stub
+ endif
+ endif
+ 
+ BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
+ 
+ ifndef TEST_MOZBUILD
+ ifndef MOZ_PROFILE_USE
+ # We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in

+ 94 - 0
bug1240930-253/mozilla/1642032-1-79a1.patch

@@ -0,0 +1,94 @@
+# HG changeset patch
+# User Nathan Froyd <froydnj@mozilla.com>
+# Date 1591734204 0
+# Node ID a9239d02662726ebc80e3c0b02213b32795feaf4
+# Parent  fba4303d6219d355e1a767727f308a80328ef2b9
+Bug 1642032 - part 1 - factor out install targets for final target files; r=nalexander
+
+We're going to reuse this machinery in a subsequent patch.  I think this
+change, by virtue of moving all the output to a single place, also makes
+things clearer.
+
+Differential Revision: https://phabricator.services.mozilla.com/D78617
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1421,16 +1421,24 @@ class RecursiveMakeBackend(CommonBackend
+         assert len(direct_linked) == 1
+ 
+         # TODO: see bug 1310063 for checking dependencies are set up correctly.
+ 
+         direct_linked = direct_linked[0]
+         backend_file.write('RUST_STATIC_LIB_FOR_SHARED_LIB := %s\n' %
+                            pretty_relpath(direct_linked, direct_linked.import_name))
+ 
++    def _add_install_target(self, backend_file, install_target, tier, dest, files):
++        self._no_skip[tier].add(backend_file.relobjdir)
++        for f in files:
++            backend_file.write('%s_FILES += %s\n' % (install_target, f))
++        backend_file.write('%s_DEST := %s\n' % (install_target, dest))
++        backend_file.write('%s_TARGET := %s\n' % (install_target, tier))
++        backend_file.write('INSTALL_TARGETS += %s\n' % install_target)
++
+     def _process_final_target_files(self, obj, files, backend_file):
+         target = obj.install_target
+         path = mozpath.basedir(target, (
+             'dist/bin',
+             'dist/xpi-stage',
+             '_tests',
+             'dist/include',
+         ))
+@@ -1443,17 +1451,18 @@ class RecursiveMakeBackend(CommonBackend
+ 
+         manifest = path.replace('/', '_')
+         install_manifest = self._install_manifests[manifest]
+         reltarget = mozpath.relpath(target, path)
+ 
+         for path, files in files.walk():
+             target_var = (mozpath.join(target, path)
+                           if path else target).replace('/', '_')
+-            have_objdir_files = False
++            objdir_files = []
++
+             for f in files:
+                 assert not isinstance(f, RenamedSourcePath)
+                 dest = mozpath.join(reltarget, path, f.target_basename)
+                 if not isinstance(f, ObjDirPath):
+                     if '*' in f:
+                         if f.startswith('/') or isinstance(f, AbsolutePath):
+                             basepath, wild = os.path.split(f.full_path)
+                             if '*' in basepath:
+@@ -1462,27 +1471,22 @@ class RecursiveMakeBackend(CommonBackend
+ 
+                             install_manifest.add_pattern_link(basepath, wild, path)
+                         else:
+                             install_manifest.add_pattern_link(f.srcdir, f, path)
+                     else:
+                         install_manifest.add_link(f.full_path, dest)
+                 else:
+                     install_manifest.add_optional_exists(dest)
+-                    backend_file.write('%s_FILES += %s\n' % (
+-                        target_var, self._pretty_path(f, backend_file)))
+-                    have_objdir_files = True
+-            if have_objdir_files:
++                    objdir_files.append(self._pretty_path(f, backend_file))
++            if objdir_files:
+                 tier = 'export' if obj.install_target == 'dist/include' else 'misc'
+-                self._no_skip[tier].add(backend_file.relobjdir)
+-                backend_file.write('%s_DEST := $(DEPTH)/%s\n'
+-                                   % (target_var,
+-                                      mozpath.join(target, path)))
+-                backend_file.write('%s_TARGET := %s\n' % (target_var, tier))
+-                backend_file.write('INSTALL_TARGETS += %s\n' % target_var)
++                self._add_install_target(backend_file, target_var, tier,
++                                         '$(DEPTH)/%s' % mozpath.join(target, path),
++                                         objdir_files)
+ 
+     def _process_final_target_pp_files(self, obj, files, backend_file, name):
+         # Bug 1177710 - We'd like to install these via manifests as
+         # preprocessed files. But they currently depend on non-standard flags
+         # being added via some Makefiles, so for now we just pass them through
+         # to the underlying Makefile.in.
+         #
+         # Note that if this becomes a manifest, OBJDIR_PP_FILES will likely

+ 84 - 0
bug1240930-253/mozilla/1642032-2-79a1.patch

@@ -0,0 +1,84 @@
+# HG changeset patch
+# User Nathan Froyd <froydnj@mozilla.com>
+# Date 1591734209 0
+# Node ID c1628d8da86fff9d408cb53d1a3c886c57099101
+# Parent  a9239d02662726ebc80e3c0b02213b32795feaf4
+Bug 1642032 - part 2 - install non-wildcard absolute FINAL_TARGET_FILES during misc; r=nalexander
+
+Such files are, at least as of this writing, only libraries, and we can
+get by with installing them later.  This change will also avoid having
+them added to the dependent libraries list.
+
+Differential Revision: https://phabricator.services.mozilla.com/D78618
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1451,42 +1451,64 @@ class RecursiveMakeBackend(CommonBackend
+ 
+         manifest = path.replace('/', '_')
+         install_manifest = self._install_manifests[manifest]
+         reltarget = mozpath.relpath(target, path)
+ 
+         for path, files in files.walk():
+             target_var = (mozpath.join(target, path)
+                           if path else target).replace('/', '_')
++            # We don't necessarily want to combine these, because non-wildcard
++            # absolute files tend to be libraries, and we don't want to mix
++            # those in with objdir headers that will be installed during export.
++            # (See bug 1642882 for details.)
+             objdir_files = []
+-
++            absolute_files = []
++ 
+             for f in files:
+                 assert not isinstance(f, RenamedSourcePath)
+                 dest = mozpath.join(reltarget, path, f.target_basename)
+                 if not isinstance(f, ObjDirPath):
+                     if '*' in f:
+                         if f.startswith('/') or isinstance(f, AbsolutePath):
+                             basepath, wild = os.path.split(f.full_path)
+                             if '*' in basepath:
+                                 raise Exception("Wildcards are only supported in the filename part of "
+                                                 "srcdir-relative or absolute paths.")
+ 
+                             install_manifest.add_pattern_link(basepath, wild, path)
+                         else:
+                             install_manifest.add_pattern_link(f.srcdir, f, path)
++                    elif isinstance(f, AbsolutePath):
++                        if not f.full_path.lower().endswith(('.dll', '.pdb', '.so')):
++                            raise Exception("Absolute paths installed to FINAL_TARGET_FILES must"
++                                            " only be shared libraries or associated debug"
++                                            " information.")
++                        install_manifest.add_optional_exists(dest)
++                        absolute_files.append(f.full_path)
+                     else:
+                         install_manifest.add_link(f.full_path, dest)
+                 else:
+                     install_manifest.add_optional_exists(dest)
+                     objdir_files.append(self._pretty_path(f, backend_file))
++            install_location = '$(DEPTH)/%s' % mozpath.join(target, path)
+             if objdir_files:
+                 tier = 'export' if obj.install_target == 'dist/include' else 'misc'
+                 self._add_install_target(backend_file, target_var, tier,
+-                                         '$(DEPTH)/%s' % mozpath.join(target, path),
+-                                         objdir_files)
++                                         install_location, objdir_files)
++            if absolute_files:
++                # Unfortunately, we can't use _add_install_target because on
++                # Windows, the absolute file paths that we want to install
++                # from often have spaces.  So we write our own rule.
++                self._no_skip['misc'].add(backend_file.relobjdir)
++                backend_file.write('misc::\n%s\n' %
++                                   '\n'.join(
++                                       '\t$(INSTALL) %s %s' % (
++                                           make_quote(shell_quote(f)), install_location)
++                                       for f in absolute_files))
+ 
+     def _process_final_target_pp_files(self, obj, files, backend_file, name):
+         # Bug 1177710 - We'd like to install these via manifests as
+         # preprocessed files. But they currently depend on non-standard flags
+         # being added via some Makefiles, so for now we just pass them through
+         # to the underlying Makefile.in.
+         #
+         # Note that if this becomes a manifest, OBJDIR_PP_FILES will likely

+ 46 - 0
bug1240930-253/mozilla/1642032-3-79a1.patch

@@ -0,0 +1,46 @@
+# HG changeset patch
+# User Nathan Froyd <froydnj@mozilla.com>
+# Date 1591823220 0
+# Node ID 7bc89fd272217c7a94ae32184c1d9c99f78e1bd4
+# Parent  167519caa6fea866d42b3ec4818255df816dcf13
+Bug 1642032 - ignore d3dcompiler_47.dll in dependentlibs determination; r=firefox-build-system-reviewers,rstewart
+
+We moved the installation of shared libraries, such as
+`d3dcompiler_47.dll` to the `misc` tier with the idea of making sure
+they weren't taken into account during the computation of the
+`dependentlibs.list`.  Unfortunately, `dependentlibs.list` is itself
+computed during `misc`, so we have an unfortunate race condition where
+sometimes libraries might wind up in the list and sometimes they won't.
+
+For this particular case, we can follow what we already do for ICU and
+ignore the library, especially since we're dynamically loading the
+library anyway.
+
+Differential Revision: https://phabricator.services.mozilla.com/D79147
+
+diff --git a/toolkit/library/dependentlibs.py b/toolkit/library/dependentlibs.py
+--- a/toolkit/library/dependentlibs.py
++++ b/toolkit/library/dependentlibs.py
+@@ -107,18 +107,20 @@ def dependentlibs(lib, libpaths, func):
+         if dep in deps or os.path.isabs(dep):
+             continue
+         for dir in libpaths:
+             deppath = os.path.join(dir, dep)
+             if os.path.exists(deppath):
+                 deps.update(dependentlibs(deppath, libpaths, func))
+                 # Black list the ICU data DLL because preloading it at startup
+                 # leads to startup performance problems because of its excessive
+-                # size (around 10MB).
+-                if not dep.startswith("icu"):
++                # size (around 10MB).  Same thing with d3dcompiler_47.dll, but
++                # to a lesser extent, and we were going to dynamically load it
++                # anyway.
++                if not dep.startswith(("icu", "d3dcompiler_47")):
+                     deps[dep] = deppath
+                 break
+ 
+     return deps
+ 
+ def gen_list(output, lib):
+     libpaths = [os.path.join(substs['DIST'], 'bin')]
+     binary_type = get_type(lib)

+ 19 - 0
bug1240930-253/mozilla/series-append

@@ -0,0 +1,19 @@
+1459597-62a1.patch
+1443208-1only-62a1.patch
+1455504-62a1.patch
+1454912-2no1-62a1.patch
+1454912-3-62a1.patch
+1454912-4-62a1.patch
+1461881-62a1.patch
+1298328-61a1.patch
+1461383-62a1.patch
+1470552-62a1.patch
+1469067-62a1.patch
+1642032-1-79a1.patch
+1642032-2-79a1.patch
+1642032-3-79a1.patch
+1464128-62a1.patch
+1464381-62a1.patch
+1437942-62a1.patch
+1240930-80a1.patch
+1457321-1only-62a1.patch

Some files were not shown because too many files changed in this diff