Bug 1384936 - Remove weave_version definition and directly replace the constant in modules/constants.js in the gecko migration script, to avoid the need for the preprocessor in modules/constants.js. r=rnewman,rail
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Thu, 27 Jul 2017 16:22:53 +0200
changeset 420290 0d580486af34eb697ae8de1610c6e92cddb361fb
parent 420289 89d41dea484774cae73fbf594d32659c94ed6c18
child 420291 1b1cbbf483f6a05e4525e532a253259003b7e006
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, rail
bugs1384936
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1384936 - Remove weave_version definition and directly replace the constant in modules/constants.js in the gecko migration script, to avoid the need for the preprocessor in modules/constants.js. r=rnewman,rail
services/sync/modules/constants.js
services/sync/moz.build
testing/mozharness/scripts/merge_day/gecko_migration.py
--- a/services/sync/modules/constants.js
+++ b/services/sync/modules/constants.js
@@ -1,18 +1,19 @@
-#filter substitution
 /* 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/. */
 
 // Process each item in the "constants hash" to add to "global" and give a name
 this.EXPORTED_SYMBOLS = [];
 for (let [key, val] of Object.entries({
 
-WEAVE_VERSION:                         "@weave_version@",
+// Don't manually modify this line, as it is automatically replaced on merge day
+// by the gecko_migration.py script.
+WEAVE_VERSION: "1.58.0",
 
 // Sync Server API version that the client supports.
 SYNC_API_VERSION:                      "1.5",
 
 // Version of the data format this client supports. The data format describes
 // how records are packaged; this is separate from the Server API version and
 // the per-engine cleartext formats.
 STORAGE_VERSION:                       5,
--- a/services/sync/moz.build
+++ b/services/sync/moz.build
@@ -19,40 +19,33 @@ EXTRA_COMPONENTS += [
 EXTRA_JS_MODULES['services-sync'] += [
     'modules/addonsreconciler.js',
     'modules/addonutils.js',
     'modules/bookmark_repair.js',
     'modules/bookmark_validator.js',
     'modules/browserid_identity.js',
     'modules/collection_repair.js',
     'modules/collection_validator.js',
+    'modules/constants.js',
     'modules/doctor.js',
     'modules/engines.js',
     'modules/keys.js',
     'modules/main.js',
     'modules/policies.js',
     'modules/record.js',
     'modules/resource.js',
     'modules/rest.js',
     'modules/service.js',
     'modules/status.js',
     'modules/SyncedTabs.jsm',
     'modules/telemetry.js',
     'modules/UIState.jsm',
     'modules/util.js',
 ]
 
-EXTRA_PP_JS_MODULES['services-sync'] += [
-    'modules/constants.js',
-]
-
-# Definitions used by constants.js
-DEFINES['weave_version'] = '1.58.0'
-DEFINES['weave_id'] = '{340c2bbc-ce74-4362-90b5-7c26312808ef}'
-
 EXTRA_JS_MODULES['services-sync'].engines += [
     'modules/engines/addons.js',
     'modules/engines/bookmarks.js',
     'modules/engines/clients.js',
     'modules/engines/extension-storage.js',
     'modules/engines/forms.js',
     'modules/engines/history.js',
     'modules/engines/passwords.js',
--- a/testing/mozharness/scripts/merge_day/gecko_migration.py
+++ b/testing/mozharness/scripts/merge_day/gecko_migration.py
@@ -305,19 +305,19 @@ class GeckoMigration(MercurialScript, Ba
         # only applicable for m-c
         if bump_major:
             self.replace(
                 os.path.join(cwd, "xpcom/components/Module.h"),
                 "static const unsigned int kVersion = %s;" % curr_version,
                 "static const unsigned int kVersion = %s;" % next_version
             )
             self.replace(
-                os.path.join(cwd, "services/sync/moz.build"),
-                "DEFINES['weave_version'] = '1.%s.0'" % curr_weave_version,
-                "DEFINES['weave_version'] = '1.%s.0'" % next_weave_version
+                os.path.join(cwd, "services/sync/modules/constants.js"),
+                'WEAVE_VERSION: "1.%s.0"' % curr_weave_version,
+                'WEAVE_VERSION: "1.%s.0"' % next_weave_version
             )
 
     # Branch-specific workflow helper methods {{{1
     def central_to_beta(self, end_tag):
         """ mozilla-central -> mozilla-beta behavior.
 
             We could have all of these individually toggled by flags, but
             by separating into workflow methods we can be more precise about