Bug 1509572 - Part 2: Don't pass --console=plain and --continue through to Gradle. r=snorp
☠☠ backed out by 79ae8ec996e6 ☠ ☠
authorNick Alexander <nalexander@mozilla.com>
Mon, 26 Nov 2018 19:17:24 +0000
changeset 507332 bd0729ff0bbc9dfcd109f2fb430361b1ea81b1cc
parent 507331 c4087e8ea340050a45994f4d4f938bb5076a8d5f
child 507333 bc6911d14ae0612c7f78858ca2ee3e4472911317
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1509572
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 1509572 - Part 2: Don't pass --console=plain and --continue through to Gradle. r=snorp --console=plain is critical in automation, but it's not always helpful locally. Let's try without it for a while. --continue tries to build additional tasks even after the first failing task. It can be useful in automation ('cuz you might see more errors) but it can also be confusing (because the build fails but produces additional output). Let's try without it, too. Depends on D12790 Differential Revision: https://phabricator.services.mozilla.com/D12791
mobile/android/mach_commands.py
--- a/mobile/android/mach_commands.py
+++ b/mobile/android/mach_commands.py
@@ -63,17 +63,17 @@ class MachCommands(MachCommandBase):
         pass
 
     @SubCommand('android', 'assemble-app',
                 """Assemble Firefox for Android.
         See http://firefox-source-docs.mozilla.org/build/buildsystem/toolchains.html#firefox-for-android-with-gradle""")  # NOQA: E501
     @CommandArgument('args', nargs=argparse.REMAINDER)
     def android_assemble_app(self, args):
         ret = self.gradle(self.substs['GRADLE_ANDROID_APP_TASKS'] +
-                          ['-x', 'lint', '--continue'] + args, verbose=True)
+                          ['-x', 'lint'] + args, verbose=True)
 
         return ret
 
     @SubCommand('android', 'generate-sdk-bindings',
                 """Generate SDK bindings used when building GeckoView.""")
     @CommandArgument('inputs', nargs='+', help='config files, '
                      'like [/path/to/ClassName-classes.txt]+')
     @CommandArgument('args', nargs=argparse.REMAINDER)
@@ -135,17 +135,17 @@ class MachCommands(MachCommandBase):
         return ret
 
     @SubCommand('android', 'test',
                 """Run Android local unit tests.
                 See https://developer.mozilla.org/en-US/docs/Mozilla/Android-specific_test_suites#android-test""")  # NOQA: E501
     @CommandArgument('args', nargs=argparse.REMAINDER)
     def android_test(self, args):
         ret = self.gradle(self.substs['GRADLE_ANDROID_TEST_TASKS'] +
-                          ["--continue"] + args, verbose=True)
+                          args, verbose=True)
 
         ret |= self._parse_android_test_results('public/app/unittest',
                                                 'gradle/build/mobile/android/app',
                                                 (self.substs['GRADLE_ANDROID_APP_VARIANT_NAME'],))
 
         ret |= self._parse_android_test_results('public/geckoview/unittest',
                                                 'gradle/build/mobile/android/geckoview',
                                                 (self.substs['GRADLE_ANDROID_GECKOVIEW_VARIANT_NAME'],))  # NOQA: E501
@@ -235,17 +235,17 @@ class MachCommands(MachCommandBase):
     @CommandArgument('args', nargs=argparse.REMAINDER)
     def android_test_ccov(self, args):
         enable_ccov = '-Penable_code_coverage'
 
         # Don't care if the tests are failing, we only want the coverage information.
         self.android_test([enable_ccov])
 
         self.gradle(self.substs['GRADLE_ANDROID_TEST_CCOV_REPORT_TASKS'] +
-                    ['--continue', enable_ccov] + args, verbose=True)
+                    [enable_ccov] + args, verbose=True)
         self._process_jacoco_reports()
         return 0
 
     def _process_jacoco_reports(self):
         def run_grcov(grcov_path, input_path):
             args = [grcov_path, input_path, '-t', 'lcov']
             return subprocess.check_output(args)
 
@@ -263,17 +263,17 @@ class MachCommands(MachCommandBase):
                 z.writestr('grcov_lcov_output.info', grcov_output)
 
     @SubCommand('android', 'lint',
                 """Run Android lint.
                 See https://developer.mozilla.org/en-US/docs/Mozilla/Android-specific_test_suites#android-lint""")  # NOQA: E501
     @CommandArgument('args', nargs=argparse.REMAINDER)
     def android_lint(self, args):
         ret = self.gradle(self.substs['GRADLE_ANDROID_LINT_TASKS'] +
-                          ["--continue"] + args, verbose=True)
+                          args, verbose=True)
 
         # Android Lint produces both HTML and XML reports.  Visit the
         # XML report(s) to report errors and link to the HTML
         # report(s) for human consumption.
         import xml.etree.ElementTree as ET
 
         root_url = self._root_url(
             artifactdir='public/android/lint',
@@ -311,17 +311,17 @@ class MachCommands(MachCommandBase):
         return ret
 
     @SubCommand('android', 'checkstyle',
                 """Run Android checkstyle.
                 See https://developer.mozilla.org/en-US/docs/Mozilla/Android-specific_test_suites#android-checkstyle""")  # NOQA: E501
     @CommandArgument('args', nargs=argparse.REMAINDER)
     def android_checkstyle(self, args):
         ret = self.gradle(self.substs['GRADLE_ANDROID_CHECKSTYLE_TASKS'] +
-                          ["--continue"] + args, verbose=True)
+                          args, verbose=True)
 
         # Checkstyle produces both HTML and XML reports.  Visit the
         # XML report(s) to report errors and link to the HTML
         # report(s) for human consumption.
         import xml.etree.ElementTree as ET
 
         f = open(os.path.join(self.topobjdir,
                               'gradle/build/mobile/android/app/reports/checkstyle/checkstyle.xml'),
@@ -367,17 +367,17 @@ class MachCommands(MachCommandBase):
         return ret
 
     @SubCommand('android', 'findbugs',
                 """Run Android findbugs.
                 See https://developer.mozilla.org/en-US/docs/Mozilla/Android-specific_test_suites#android-findbugs""")  # NOQA: E501
     @CommandArgument('args', nargs=argparse.REMAINDER)
     def android_findbugs(self, dryrun=False, args=[]):
         ret = self.gradle(self.substs['GRADLE_ANDROID_FINDBUGS_TASKS'] +
-                          ["--continue"] + args, verbose=True)
+                          args, verbose=True)
 
         # Findbug produces both HTML and XML reports.  Visit the
         # XML report(s) to report errors and link to the HTML
         # report(s) for human consumption.
         import xml.etree.ElementTree as ET
 
         root_url = self._root_url(
             artifactdir='public/android/findbugs',
@@ -438,27 +438,27 @@ class MachCommands(MachCommandBase):
         return 0
 
     @SubCommand('android', 'archive-coverage-artifacts',
                 """Archive compiled classfiles to be used later in generating code
         coverage reports. See https://firefox-source-docs.mozilla.org/mobile/android/fennec/testcoverage.html""")  # NOQA: E501
     @CommandArgument('args', nargs=argparse.REMAINDER)
     def android_archive_classfiles(self, args):
         self.gradle(self.substs['GRADLE_ANDROID_ARCHIVE_COVERAGE_ARTIFACTS_TASKS'] +
-                    ["--continue"] + args, verbose=True)
+                    args, verbose=True)
 
         return 0
 
     @SubCommand('android', 'archive-geckoview',
                 """Create GeckoView archives.
         See http://firefox-source-docs.mozilla.org/build/buildsystem/toolchains.html#firefox-for-android-with-gradle""")  # NOQA: E501
     @CommandArgument('args', nargs=argparse.REMAINDER)
     def android_archive_geckoview(self, args):
         ret = self.gradle(
-            self.substs['GRADLE_ANDROID_ARCHIVE_GECKOVIEW_TASKS'] + ["--continue"] + args,
+            self.substs['GRADLE_ANDROID_ARCHIVE_GECKOVIEW_TASKS'] + args,
             verbose=True)
 
         if ret != 0:
             return ret
 
         # The zip archive is passed along in CI to ship geckoview onto a maven repo
         _craft_maven_zip_archive(self.topobjdir)
 
@@ -612,18 +612,21 @@ class MachCommands(MachCommandBase):
         # It's not even enough to set the encoding just for Gradle; it
         # needs to be for JVMs spawned by Gradle as well.  This
         # happens during the maven deployment generating the GeckoView
         # documents; this works around "error: unmappable character
         # for encoding ASCII" in exoplayer2.  See
         # https://discuss.gradle.org/t/unmappable-character-for-encoding-ascii-when-building-a-utf-8-project/10692/11  # NOQA: E501
         # and especially https://stackoverflow.com/a/21755671.
 
+        if self.substs.get('MOZ_AUTOMATION'):
+            gradle_flags += ['--console=plain']
+
         return self.run_process(
-            [self.substs['GRADLE']] + gradle_flags + ['--console=plain'] + args,
+            [self.substs['GRADLE']] + gradle_flags + args,
             append_env={
                 'GRADLE_OPTS': '-Dfile.encoding=utf-8',
                 'JAVA_HOME': java_home,
                 'JAVA_TOOL_OPTIONS': '-Dfile.encoding=utf-8',
             },
             pass_thru=True,  # Allow user to run gradle interactively.
             ensure_exit_code=False,  # Don't throw on non-zero exit code.
             cwd=mozpath.join(self.topsrcdir))