Bug 1502457 - Move MOZ_APP_VERSION{,_DISPLAY} to python configure. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 16 Nov 2018 01:15:35 +0000 (2018-11-16)
changeset 446943 f28ea3184e5ca7be89bfa62802af63c5dfe8f7e8
parent 446942 c62948fc14e698a9a987b8d8ec229d3f464bedb1
child 446944 fd205107b0f4beac469995f809b7c77d6bddde0a
push id35061
push userebalazs@mozilla.com
push dateMon, 19 Nov 2018 09:27:38 +0000 (2018-11-19)
treeherdermozilla-central@88ba9f723934 [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 MOZ_APP_VERSION{,_DISPLAY} to python configure. r=nalexander Depends on D11983 Differential Revision: https://phabricator.services.mozilla.com/D11984
browser/confvars.sh
build/moz.configure/init.configure
embedding/ios/confvars.sh
extensions/confvars.sh
js/src/old-configure.in
mobile/android/confvars.sh
old-configure.in
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -26,19 +26,16 @@ if test "$OS_ARCH" = "WINNT"; then
       fi
     fi
   fi
 fi
 
 # Enable building ./signmar and running libmar signature tests
 MOZ_ENABLE_SIGNMAR=1
 
-MOZ_APP_VERSION=$FIREFOX_VERSION
-MOZ_APP_VERSION_DISPLAY=$FIREFOX_VERSION_DISPLAY
-
 if [ "${MOZ_BROWSER_XHTML}" = "1" ]; then
   BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml
 else
   BROWSER_CHROME_URL=chrome://browser/content/browser.xul
 fi
 
 # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
 # MOZ_BRANDING_DIRECTORY is the default branding directory used when none is
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -1038,35 +1038,50 @@ add_old_configure_assignment('MOZ_BUILD_
 
 # set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in
 # 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, build_project, '--help')
 @imports(_from='__builtin__', _import='open')
+@imports('os')
 @imports('re')
 def milestone(build_env, build_project, _):
     versions = []
     paths = ['config/milestone.txt']
     if build_project == 'js':
         paths = paths * 3
     else:
         paths += [
             'browser/config/version.txt',
             'browser/config/version_display.txt',
         ]
+    for f in ('version.txt', 'version_display.txt'):
+        f = os.path.join(build_project, f)
+        if not os.path.exists(os.path.join(build_env.topsrcdir, f)):
+            break
+        paths.append(f)
+
     for p in paths:
         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(p))
             versions.append(content[-1])
 
-    milestone, firefox_version, firefox_version_display = versions
+    milestone, firefox_version, firefox_version_display = versions[:3]
+
+    # version.txt content from the project directory if there is one, otherwise
+    # the firefox version.
+    app_version = versions[3] if len(versions) > 3 else firefox_version
+    # version_display.txt content from the project directory if there is one,
+    # otherwise version.txt content from the project directory, otherwise the
+    # firefox version for display.
+    app_version_display = versions[-1] if len(versions) > 3 else firefox_version_display
 
     is_nightly = is_release_or_beta = None
 
     if 'a1' in milestone:
         is_nightly = True
     elif 'a' not in milestone:
         is_release_or_beta = True
 
@@ -1079,18 +1094,18 @@ def milestone(build_env, build_project, 
     #
     # 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,
-                     firefox_version=firefox_version,
-                     firefox_version_display=firefox_version_display)
+                     app_version=app_version,
+                     app_version_display=app_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)
@@ -1100,20 +1115,19 @@ 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)
+set_config('MOZ_APP_VERSION', milestone.app_version)
+set_config('MOZ_APP_VERSION_DISPLAY', milestone.app_version_display)
+add_old_configure_assignment('MOZ_APP_VERSION', milestone.app_version)
 
 # 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/embedding/ios/confvars.sh
+++ b/embedding/ios/confvars.sh
@@ -1,9 +1,8 @@
 #! /bin/sh
 # 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/.
 
 MOZ_APP_NAME=geckoembed
 MOZ_APP_DISPLAYNAME=GeckoEmbed
 MOZ_UPDATER=
-MOZ_APP_VERSION=$MOZILLA_VERSION
--- a/extensions/confvars.sh
+++ b/extensions/confvars.sh
@@ -1,8 +1,7 @@
 #! /bin/sh
 # 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/.
 
 MOZ_APP_NAME=mozilla
 MOZ_APP_DISPLAYNAME=Mozilla
-MOZ_APP_VERSION=$MOZILLA_VERSION
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -1700,17 +1700,16 @@ AC_SUBST(PKG_SKIP_STRIP)
 AC_SUBST(INCREMENTAL_LINKER)
 
 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
 
 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
 
 AC_SUBST(MOZ_APP_NAME)
 AC_SUBST(MOZ_APP_DISPLAYNAME)
-AC_SUBST(MOZ_APP_VERSION)
 
 AC_SUBST(MOZ_PKG_SPECIAL)
 
 dnl ========================================================
 dnl ECMAScript Internationalization API Support (uses ICU)
 dnl ========================================================
 
 dnl top-level configure may override this with --without-intl-api
@@ -1820,17 +1819,16 @@ dnl ====================================
 MOZ_CHECK_ALLOCATOR
 
 AC_CHECK_FUNCS(localeconv)
 
 AC_SUBST(ac_configure_args)
 
 if test -n "$JS_STANDALONE"; then
 MOZ_APP_NAME="mozjs"
-MOZ_APP_VERSION="$MOZILLA_SYMBOLVERSION"
 JS_LIBRARY_NAME="mozjs-$MOZILLA_SYMBOLVERSION"
 else
 JS_LIBRARY_NAME="mozjs"
 fi
 JS_CONFIG_LIBS="$NSPR_LIBS $LIBS"
 if test -n "$GNU_CC"; then
 JS_CONFIG_MOZ_JS_LIBS='-L${libdir} -l${JS_LIBRARY_NAME}'
 else
--- a/mobile/android/confvars.sh
+++ b/mobile/android/confvars.sh
@@ -1,17 +1,15 @@
 # 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/.
 
 MOZ_APP_BASENAME=Fennec
 MOZ_APP_VENDOR=Mozilla
 
-MOZ_APP_VERSION=$FIREFOX_VERSION
-MOZ_APP_VERSION_DISPLAY=$FIREFOX_VERSION_DISPLAY
 MOZ_APP_UA_NAME=Firefox
 
 BROWSER_CHROME_URL=chrome://browser/content/browser.xul
 
 MOZ_BRANDING_DIRECTORY=mobile/android/branding/unofficial
 MOZ_OFFICIAL_BRANDING_DIRECTORY=mobile/android/branding/official
 # MOZ_APP_DISPLAYNAME is set by branding/configure.sh
 
--- a/old-configure.in
+++ b/old-configure.in
@@ -3954,19 +3954,16 @@ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
 # versions of a given application (e.g. Aurora and Firefox both use
 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
 # for application.ini's "Name" field, which controls profile location in
 # the absence of a "Profile" field (see below), and various system
 # integration hooks (Unix remoting, Windows MessageWindow name, etc.)
 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
 # Mac Bundle name, Updater, Installer), it is typically used for nightly
 # builds (e.g. Aurora for Firefox).
-# - MOZ_APP_VERSION: Defines the application version number.
-# - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
-# in the "About" window. If not set, defaults to MOZ_APP_VERSION.
 # - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
 # defaults to a lowercase form of MOZ_APP_BASENAME.
 # - MOZ_APP_REMOTINGNAME: Used for the internal program name, which affects
 # profile name and remoting. If not set, defaults to MOZ_APP_NAME.
 # - MOZ_APP_PROFILE: When set, used for application.ini's
 # "Profile" field, which controls profile location.
 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
 # crash reporter server url.
@@ -3976,28 +3973,33 @@ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
 # build ID.
 # - MOZ_ANDROID_SHARED_ID: On Android, "android:sharedUserId" for all Android
 # packages produced.
 # - MOZ_ANDROID_GCM_SENDERID: On Android, the Android GCM Sender ID used.  GCM
 # sender IDs are not sensitive: see, http://stackoverflow.com/a/18216063.
 # - MOZ_MMA_GCM_SENDERID: This GCM Sender ID is used for MMA integration.
 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
 
+# The following environment variables used to have an effect, but don't anymore:
+# - MOZ_APP_VERSION: Defines the application version number. This was replaced with
+# the contents from the version.txt file in the application directory, or
+# browser/config/version.txt if there isn't one.
+# - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
+# in the "About" window. This was replaced with the contents from the
+# version_display.txt or version.txt in the application directory, or
+# browser/config/version_display.txt.
+
 if test -z "$MOZ_APP_NAME"; then
    MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
 fi
 
 if test -z "$MOZ_APP_REMOTINGNAME"; then
    MOZ_APP_REMOTINGNAME=$MOZ_APP_NAME
 fi
 
-if test -z "$MOZ_APP_VERSION_DISPLAY"; then
-   MOZ_APP_VERSION_DISPLAY=$MOZ_APP_VERSION
-fi
-
 if test -z "$ANDROID_PACKAGE_NAME" ; then
    # When we got rid of the Aurora channel we decided to replace the old
    # Nightly ANDROID_PACKAGE_NAME with Aurora. To make sure this is inherited
    # by all mozilla-central based branches we make this the new "default"
    # for Fennec. Non mozilla-central based branches set ANDROID_PACKAGE_NAME
    # in their mozconfig, so they will never get this. If there are ever
    # non-Fennec builds for Android, they will fall into the else block
    # and use their own default name.
@@ -4048,18 +4050,16 @@ AC_SUBST(MOZ_ANDROID_SHARED_ID)
 AC_SUBST(MOZ_ANDROID_GCM_SENDERID)
 AC_SUBST(MOZ_MMA_GCM_SENDERID)
 AC_SUBST(MAR_CHANNEL_ID)
 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
 AC_SUBST(MOZ_PROFILE_MIGRATOR)
 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
 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_SUBST(MOZ_UA_OS_AGNOSTIC)
 if test -n "$MOZ_UA_OS_AGNOSTIC"; then
   AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
 fi