Bug 1549886 - Move MOZ_TELEMETRY_REPORTING to python configure. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 08 May 2019 14:33:54 +0000
changeset 531959 db318bbb7517c815d85df318f955747dbdb8d698
parent 531958 a9dab8054a98402f14ce37e40cf9e4fdeed0b95d
child 531960 07774a40d1f6ea04cbe74c17b7bbcb4d4f112e4c
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1549886
milestone68.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 1549886 - Move MOZ_TELEMETRY_REPORTING to python configure. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D30335
build/moz.configure/init.configure
mobile/android/moz.configure
old-configure.in
toolkit/moz.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -1224,16 +1224,24 @@ set_config('MOZILLA_SYMBOLVERSION', mile
 # 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('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)
 
+
+# Dummy function for availability in toolkit/moz.configure. Overridden in
+# mobile/android/moz.configure.
+@depends(milestone.is_nightly)
+def fennec_nightly(is_nightly):
+    return is_nightly
+
+
 # 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/mobile/android/moz.configure
+++ b/mobile/android/moz.configure
@@ -111,16 +111,22 @@ set_config('MOZ_ANDROID_MOZILLA_ONLINE',
 option(env='FENNEC_NIGHTLY',
        help='Enable experimental code for Fennec Nightly users. NOTE: This is *not* equivalent '
             'to the NIGHTLY_BUILD flag set during configure.',
        default=False)
 
 set_config('FENNEC_NIGHTLY', depends_if('FENNEC_NIGHTLY')(lambda _: True))
 set_define('FENNEC_NIGHTLY', depends_if('FENNEC_NIGHTLY')(lambda _: True))
 
+
+@depends('FENNEC_NIGHTLY')
+def fennec_nightly(nightly):
+    return bool(nightly)
+
+
 imply_option('MOZ_SERVICES_HEALTHREPORT', True)
 imply_option('MOZ_ANDROID_HISTORY', True)
 imply_option('--enable-small-chunk-size', True)
 
 @depends(target)
 def check_target(target):
     if target.os != 'Android':
         log.error('You must specify --target=arm-linux-androideabi (or some '
--- a/old-configure.in
+++ b/old-configure.in
@@ -3113,25 +3113,16 @@ if test "$MOZILLA_OFFICIAL"; then
 fi
 
 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
 # explicitly set the repository and changeset information in.
 AC_SUBST(MOZ_SOURCE_REPO)
 AC_SUBST(MOZ_SOURCE_CHANGESET)
 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
 
-if test "$MOZ_TELEMETRY_REPORTING"; then
-    AC_DEFINE(MOZ_TELEMETRY_REPORTING)
-
-    # Enable Telemetry by default for nightly and aurora channels
-    if test -z "$RELEASE_OR_BETA" || test -n "$FENNEC_NIGHTLY"; then
-      AC_DEFINE(MOZ_TELEMETRY_ON_BY_DEFAULT)
-    fi
-fi
-
 dnl If we have any service that uploads data (and requires data submission
 dnl policy alert), set MOZ_DATA_REPORTING.
 dnl We need SUBST for build system and DEFINE for xul preprocessor.
 if test -n "$MOZ_TELEMETRY_REPORTING" || test -n "$MOZ_SERVICES_HEALTHREPORT" || test -n "$MOZ_CRASHREPORTER"; then
   MOZ_DATA_REPORTING=1
   AC_DEFINE(MOZ_DATA_REPORTING)
   AC_SUBST(MOZ_DATA_REPORTING)
 fi
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -635,16 +635,33 @@ def legacy_extensions(value):
 set_config('MOZ_ALLOW_LEGACY_EXTENSIONS', legacy_extensions)
 set_define('MOZ_ALLOW_LEGACY_EXTENSIONS', legacy_extensions)
 
 @depends('MOZ_PLACES', 'MOZ_ANDROID_HISTORY')
 def check_places_and_android_history(places, android_history):
     if places and android_history:
         die('Cannot use MOZ_ANDROID_HISTORY alongside MOZ_PLACES.')
 
+
+option(env='MOZ_TELEMETRY_REPORTING',
+       help='Enable telemetry reporting')
+
+set_define('MOZ_TELEMETRY_REPORTING', True, when='MOZ_TELEMETRY_REPORTING')
+add_old_configure_assignment(
+    'MOZ_TELEMETRY_REPORTING', True, when='MOZ_TELEMETRY_REPORTING')
+
+
+@depends('MOZ_TELEMETRY_REPORTING', milestone.is_nightly, fennec_nightly)
+def telemetry_on_by_default(reporting, is_nightly, fennec_nightly):
+    return reporting and (is_nightly or fennec_nightly)
+
+
+set_define('MOZ_TELEMETRY_ON_BY_DEFAULT', True, when=telemetry_on_by_default)
+
+
 # gpsd support
 # ==============================================================
 option('--enable-gpsd', env='MOZ_GPSD',
        help='Enable gpsd support')
 
 @depends('--enable-gpsd')
 def gpsd(value):
     return bool(value)