Bug 1560044 - Make Xcode checks macOS host only. r=nalexander
☠☠ backed out by 53b7325a470a ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 02 Jul 2019 17:24:04 +0000
changeset 481045 1271940e91e86515e9e4f0429206b98475931c5c
parent 481044 a5bbaa8c100159f823919c02c76c4dfb8dcca01a
child 481046 91919cdf9159737bab4281246b3c8625645219f3
push id89047
push usermh@glandium.org
push dateTue, 02 Jul 2019 22:40:53 +0000
treeherderautoland@1271940e91e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1560044
milestone69.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 1560044 - Make Xcode checks macOS host only. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D36559
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -199,59 +199,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)
 
 
-# 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)
+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)
 
 
 # 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.