Backed out 5 changesets (bug 1528314, bug 1560044) for build bustages on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Wed, 03 Jul 2019 02:20:15 +0300
changeset 481048 53b7325a470a96c4ec659d57d6465308dba02020
parent 481047 4a544cd4b035b01becd39f11224614cf37616e2d
child 481049 42a9ef2a777fb841ab9918e10e2629902c7bd28e
push id89049
push userapavel@mozilla.com
push dateTue, 02 Jul 2019 23:20:54 +0000
treeherderautoland@53b7325a470a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1528314, 1560044
milestone69.0a1
backs out4a544cd4b035b01becd39f11224614cf37616e2d
91919cdf9159737bab4281246b3c8625645219f3
1271940e91e86515e9e4f0429206b98475931c5c
a5bbaa8c100159f823919c02c76c4dfb8dcca01a
7ae0d606f1c6610e7493581a3cf0c0533e48c088
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
Backed out 5 changesets (bug 1528314, bug 1560044) for build bustages on a CLOSED TREE Backed out changeset 4a544cd4b035 (bug 1528314) Backed out changeset 91919cdf9159 (bug 1528314) Backed out changeset 1271940e91e8 (bug 1560044) Backed out changeset a5bbaa8c1001 (bug 1560044) Backed out changeset 7ae0d606f1c6 (bug 1560044)
build/moz.configure/java.configure
build/moz.configure/toolchain.configure
python/mozboot/mozboot/android.py
python/mozboot/mozboot/osx.py
--- a/build/moz.configure/java.configure
+++ b/build/moz.configure/java.configure
@@ -19,20 +19,16 @@ def java_search_paths(host, path):
         return path
     # With no path specified, look for javac and jar in $JAVA_HOME (if set),
     # JDK registery on Windows, and $PATH.
     if 'JAVA_HOME' in environ:
         return [os.path.join(environ['JAVA_HOME'], 'bin')]
     if host.os == 'WINNT':
         for x in get_registry_values(r'HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.8\JavaHome', get_32_and_64_bit=True):
             return [os.path.join(x[0], 'bin')]
-    if host.os == 'OSX':
-        home = check_cmd_output('/usr/libexec/java_home', '-v', '1.8', onerror=lambda: '').rstrip()
-        if home:
-            return [os.path.join(home, 'bin')]
     return [environ.get('PATH')]
 
 # Finds the given java tool, failing with a custom error message if we can't
 # find it.
 
 
 @template
 def check_java_tool(tool):
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -118,74 +118,54 @@ with only_when(target_is_osx):
             # Ensure every compiler process we spawn uses this value.
             environ['MACOSX_DEPLOYMENT_TARGET'] = value[0]
             return value[0]
 
 
     set_config('MACOSX_DEPLOYMENT_TARGET', macos_target)
     add_old_configure_assignment('MACOSX_DEPLOYMENT_TARGET', macos_target)
 
-
-@depends(host)
-def host_is_osx(host):
-    if host.os == 'OSX':
-        return True
-
-
-with only_when(host_is_osx | target_is_osx):
     # MacOS SDK
     # =========
+
     js_option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
            help='Location of platform SDK to use')
 
-    @depends('--with-macos-sdk', host)
+    @depends_if('--with-macos-sdk')
     @imports(_from='os.path', _import='isdir')
     @imports(_from='biplist', _import='readPlist')
-    def macos_sdk(sdk, host):
+    def macos_sdk(value):
         sdk_min_version = Version('10.11')
         sdk_max_version = Version('10.14')
 
-        if sdk:
-            sdk = sdk[0]
-        elif host.os == 'OSX':
-            sdk = check_cmd_output('xcrun', '--show-sdk-path', onerror=lambda: '').rstrip()
-            if not sdk:
-                die('Could not find the macOS SDK. Please use --with-macos-sdk to give '
-                    'the path to a macOS SDK.')
-        else:
-            die('Need a macOS SDK when targeting macOS. Please use --with-macos-sdk '
-                'to give the path to a macOS SDK.')
-
-        if not isdir(sdk):
+        if not isdir(value[0]):
             die('SDK not found in %s. When using --with-macos-sdk, you must specify a '
                 'valid SDK. SDKs are installed when the optional cross-development '
                 'tools are selected during the Xcode/Developer Tools installation.'
-                % sdk)
-        obj = readPlist(os.path.join(sdk, 'SDKSettings.plist'))
+                % value[0])
+        obj = readPlist(os.path.join(value[0], 'SDKSettings.plist'))
         if not obj:
-            die('Error parsing SDKSettings.plist in the SDK directory: %s' % sdk)
+            die('Error parsing SDKSettings.plist in the SDK directory: %s' % value[0])
         if 'Version' not in obj:
-            die('Error finding Version information in SDKSettings.plist from the SDK: %s' % sdk)
+            die('Error finding Version information in SDKSettings.plist from the SDK: %s' % value[0])
         version = Version(obj['Version'])
         if version < sdk_min_version:
             die('SDK version "%s" is too old. Please upgrade to at least %s. '
                 'You may need to point to it using --with-macos-sdk=<path> in your '
                 'mozconfig. Various SDK versions are available from '
                 'https://github.com/phracker/MacOSX-SDKs' % (version, sdk_min_version))
         if version > sdk_max_version:
             die('SDK version "%s" is unsupported. Please downgrade to version '
                 '%s. You may need to point to it using --with-macos-sdk=<path> in '
                 'your mozconfig. Various SDK versions are available from '
                 'https://github.com/phracker/MacOSX-SDKs' % (version, sdk_max_version))
-        return sdk
+        return value[0]
 
     set_config('MACOS_SDK_DIR', macos_sdk)
 
-
-with only_when(target_is_osx):
     with only_when(cross_compiling):
         option('--with-macos-private-frameworks',
                env="MACOS_PRIVATE_FRAMEWORKS_DIR", nargs=1,
                help='Location of private frameworks to use')
 
         @depends_if('--with-macos-private-frameworks')
         @imports(_from='os.path', _import='isdir')
         def macos_private_frameworks(value):
@@ -199,59 +179,59 @@ with only_when(target_is_osx):
     def macos_private_frameworks(value):
         if value:
             return value
         return '/System/Library/PrivateFrameworks'
 
     set_config('MACOS_PRIVATE_FRAMEWORKS_DIR', macos_private_frameworks)
 
 
-with only_when(host_is_osx):
-    # Xcode state
-    # ===========
-    js_option('--disable-xcode-checks',
-	      help='Do not check that Xcode is installed and properly configured')
-
-
-    @depends(host, '--disable-xcode-checks')
-    def xcode_path(host, xcode_checks):
-	if host.kernel != 'Darwin' or not xcode_checks:
-	    return
-
-	# xcode-select -p prints the path to the installed Xcode. It
-	# should exit 0 and return non-empty result if Xcode is installed.
-
-	def bad_xcode_select():
-	    die('Could not find installed Xcode; install Xcode from the App '
-		'Store, run it once to perform initial configuration, and then '
-		'try again; in the rare case you wish to build without Xcode '
-		'installed, add the --disable-xcode-checks configure flag')
-
-	xcode_path = check_cmd_output('xcode-select', '--print-path',
-				      onerror=bad_xcode_select).strip()
-
-	if not xcode_path:
-	    bad_xcode_select()
-
-	# Now look for the Command Line Tools.
-	def no_cltools():
-	    die('Could not find installed Xcode Command Line Tools; '
-		'run `xcode-select --install` and follow the instructions '
-		'to install them then try again; if you wish to build without '
-		'Xcode Command Line Tools installed, '
-		'add the --disable-xcode-checks configure flag')
-
-	check_cmd_output('pkgutil', '--pkg-info',
-			 'com.apple.pkg.CLTools_Executables',
-			 onerror=no_cltools)
-
-	return xcode_path
-
-
-    set_config('XCODE_PATH', xcode_path)
+# Xcode state
+# ===========
+
+js_option('--disable-xcode-checks',
+          help='Do not check that Xcode is installed and properly configured')
+
+
+@depends(host, '--disable-xcode-checks')
+def xcode_path(host, xcode_checks):
+    if host.kernel != 'Darwin' or not xcode_checks:
+        return
+
+    # xcode-select -p prints the path to the installed Xcode. It
+    # should exit 0 and return non-empty result if Xcode is installed.
+
+    def bad_xcode_select():
+        die('Could not find installed Xcode; install Xcode from the App '
+            'Store, run it once to perform initial configuration, and then '
+            'try again; in the rare case you wish to build without Xcode '
+            'installed, add the --disable-xcode-checks configure flag')
+
+    xcode_path = check_cmd_output('xcode-select', '--print-path',
+                                  onerror=bad_xcode_select).strip()
+
+    if not xcode_path:
+        bad_xcode_select()
+
+    # Now look for the Command Line Tools.
+    def no_cltools():
+        die('Could not find installed Xcode Command Line Tools; '
+            'run `xcode-select --install` and follow the instructions '
+            'to install them then try again; if you wish to build without '
+            'Xcode Command Line Tools installed, '
+            'add the --disable-xcode-checks configure flag')
+
+    check_cmd_output('pkgutil', '--pkg-info',
+                     'com.apple.pkg.CLTools_Executables',
+                     onerror=no_cltools)
+
+    return xcode_path
+
+
+set_config('XCODE_PATH', xcode_path)
 
 
 # Compiler wrappers
 # ==============================================================
 # Normally, we'd use js_option and automatically have those variables
 # propagated to js/src, but things are complicated by possible additional
 # wrappers in CC/CXX, and by other subconfigures that do not handle those
 # options and do need CC/CXX altered.
--- a/python/mozboot/mozboot/android.py
+++ b/python/mozboot/mozboot/android.py
@@ -287,20 +287,25 @@ def ensure_android_packages(sdkmanager_t
         cmd = args[0]
         e = subprocess.CalledProcessError(retcode, cmd)
         e.output = output
         raise e
 
     print(output)
 
 
-def suggest_mozconfig(os_name, artifact_mode=False):
+def suggest_mozconfig(os_name, artifact_mode=False, java_bin_path=None):
     moz_state_dir, sdk_path, ndk_path = get_paths(os_name)
 
     extra_lines = []
+    if java_bin_path:
+        extra_lines += [
+            '# With the following java:',
+            'ac_add_options --with-java-bin-path="{}"'.format(java_bin_path),
+        ]
     if extra_lines:
         extra_lines.append('')
 
     if artifact_mode:
         template = MOBILE_ANDROID_ARTIFACT_MODE_MOZCONFIG_TEMPLATE
     else:
         template = MOBILE_ANDROID_MOZCONFIG_TEMPLATE
 
--- a/python/mozboot/mozboot/osx.py
+++ b/python/mozboot/mozboot/osx.py
@@ -375,17 +375,19 @@ class OSXBootstrapper(BaseBootstrapper):
         self.ensure_java()
         from mozboot import android
 
         android.ensure_android('macosx', artifact_mode=artifact_mode,
                                no_interactive=self.no_interactive)
 
     def suggest_homebrew_mobile_android_mozconfig(self, artifact_mode=False):
         from mozboot import android
-        android.suggest_mozconfig('macosx', artifact_mode=artifact_mode)
+        # Path to java from the homebrew/cask-versions/adoptopenjdk8 cask.
+        android.suggest_mozconfig('macosx', artifact_mode=artifact_mode,
+                                  java_bin_path=JAVA_PATH)
 
     def _ensure_macports_packages(self, packages):
         self.port = self.which('port')
         assert self.port is not None
 
         installed = set(self.check_output([self.port, 'installed']).split())
 
         missing = [package for package in packages if package not in installed]