Bug 1502457 - Move FIREFOX_VERSION to python configure. r=nalexander
☠☠ backed out by 1abdc7367834 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 15 Nov 2018 23:23:53 +0000
changeset 503117 0e283ddc6c3b4b941c11004d65efd5a4c463bb70
parent 503116 638fa025112322a1b58fce8992e8413c68faaad6
child 503118 b172bda6e983e58470112700f5ca0d7d9d67edb9
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1502457
milestone65.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 1502457 - Move FIREFOX_VERSION to python configure. r=nalexander Depends on D11982 Differential Revision: https://phabricator.services.mozilla.com/D11983
build/moz.configure/init.configure
old-configure.in
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -1040,21 +1040,29 @@ add_old_configure_assignment('MOZ_BUILD_
 # The logic works like this:
 # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
 # - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora
 # - otherwise, we're building Release/Beta (define RELEASE_OR_BETA)
 @depends(check_build_environment, '--help')
 @imports(_from='__builtin__', _import='open')
 @imports('re')
 def milestone(build_env, _):
-    milestone_path = os.path.join(build_env.topsrcdir,
-                                  'config',
-                                  'milestone.txt')
-    with open(milestone_path, 'r') as fh:
-        milestone = fh.read().splitlines()[-1]
+    versions = []
+    for p in (
+        ('config', 'milestone.txt'),
+        ('browser', 'config', 'version.txt'),
+        ('browser', 'config', 'version_display.txt'),
+    ):
+        with open(os.path.join(build_env.topsrcdir, *p), 'r') as fh:
+            content = fh.read().splitlines()
+            if not content:
+                die('Could not find a version number in {}'.format(os.path.join(*p)))
+            versions.append(content[-1])
+
+    milestone, firefox_version, firefox_version_display = versions
 
     is_nightly = is_release_or_beta = None
 
     if 'a1' in milestone:
         is_nightly = True
     elif 'a' not in milestone:
         is_release_or_beta = True
 
@@ -1066,17 +1074,19 @@ def milestone(build_env, _):
     # patch leve (bugs 572659 and 870868).
     #
     # Only expose major milestone and alpha version in the symbolversion
     # string; as the name suggests, we use it for symbol versioning on Linux.
     return namespace(version=milestone,
                      uaversion='%s.0' % major_version,
                      symbolversion='%s%s' % (major_version, ab_patch),
                      is_nightly=is_nightly,
-                     is_release_or_beta=is_release_or_beta)
+                     is_release_or_beta=is_release_or_beta,
+                     firefox_version=firefox_version,
+                     firefox_version_display=firefox_version_display)
 
 
 set_config('GRE_MILESTONE', milestone.version)
 set_config('NIGHTLY_BUILD', milestone.is_nightly)
 set_define('NIGHTLY_BUILD', milestone.is_nightly)
 add_old_configure_assignment('NIGHTLY_BUILD', milestone.is_nightly)
 set_config('RELEASE_OR_BETA', milestone.is_release_or_beta)
 set_define('RELEASE_OR_BETA', milestone.is_release_or_beta)
@@ -1086,16 +1096,21 @@ set_define('MOZILLA_VERSION', depends(mi
 set_config('MOZILLA_VERSION', milestone.version)
 set_define('MOZILLA_VERSION_U', milestone.version)
 set_define('MOZILLA_UAVERSION', depends(milestone)(lambda m: '"%s"' % m.uaversion))
 set_config('MOZILLA_SYMBOLVERSION', milestone.symbolversion)
 # JS configure still wants to look at these.
 add_old_configure_assignment('MOZILLA_VERSION', milestone.version)
 add_old_configure_assignment('MOZILLA_SYMBOLVERSION', milestone.symbolversion)
 
+set_config('FIREFOX_VERSION', milestone.firefox_version)
+set_define('FIREFOX_VERSION', milestone.firefox_version)
+add_old_configure_assignment('FIREFOX_VERSION', milestone.firefox_version)
+add_old_configure_assignment('FIREFOX_VERSION_DISPLAY', milestone.firefox_version_display)
+
 # The app update channel is 'default' when not supplied. The value is used in
 # the application's confvars.sh (and is made available to a project specific
 # moz.configure).
 option('--enable-update-channel',
        nargs=1,
        help='Select application update channel',
        default='default')
 
--- a/old-configure.in
+++ b/old-configure.in
@@ -684,28 +684,16 @@ case "$host" in
     ;;
 
 *)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
     ;;
 esac
 
-dnl Get version of various core apps from the version files.
-FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
-FIREFOX_VERSION_DISPLAY=`cat $_topsrcdir/browser/config/version_display.txt`
-
-if test -z "$FIREFOX_VERSION"; then
-    AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.])
-fi
-
-if test -z "$FIREFOX_VERSION_DISPLAY"; then
-    AC_MSG_ERROR([FIREFOX_VERSION_DISPLAY is unexpectedly blank.])
-fi
-
 MOZ_DOING_LTO(lto_is_enabled)
 
 dnl ========================================================
 dnl System overrides of the defaults for target
 dnl ========================================================
 
 case "$target" in
 *-darwin*)
@@ -4066,18 +4054,16 @@ AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MO
 AC_SUBST(MOZ_APP_UA_NAME)
 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
 AC_SUBST(MOZ_APP_VERSION)
 AC_SUBST(MOZ_APP_VERSION_DISPLAY)
 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
 
 AC_SUBST(MOZ_APP_MAXVERSION)
-AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIREFOX_VERSION)
-AC_SUBST(FIREFOX_VERSION)
 AC_SUBST(MOZ_UA_OS_AGNOSTIC)
 if test -n "$MOZ_UA_OS_AGNOSTIC"; then
   AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
 fi
 
 AC_SUBST(MOZ_PKG_SPECIAL)
 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)