File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -152,10 +152,11 @@ if config.test_exec_root is None:
152
152
# name: The name of this test suite.
153
153
config .name = 'Swift(%s)' % config .variant_suffix [1 :]
154
154
155
- # Tweak the environment appropriately for various platforms.
155
+ # Respect the TOOLCHAINS environment variable when deciding the xcrun
156
+ # toolchain for Darwin platforms.
156
157
if platform .system () == 'Darwin' :
157
- # Prefer the latest version of the Xcode tools.
158
- config . environment [ 'TOOLCHAINS' ] = 'default'
158
+ config . environment [ 'TOOLCHAINS' ] = \
159
+ os . environ . get ( 'TOOLCHAINS' , config . darwin_xcrun_toolchain )
159
160
160
161
# testFormat: The test format to use to interpret tests.
161
162
config .test_format = swift_test .SwiftTest (coverage_mode = config .coverage_mode )
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import platform
18
18
import sys
19
19
import time
20
20
21
+ from build_swift import defaults
21
22
from build_swift import driver_arguments
22
23
23
24
from swift_build_support .swift_build_support import (
@@ -1041,6 +1042,13 @@ def main_normal():
1041
1042
shell .dry_run = args .dry_run
1042
1043
1043
1044
# Prepare and validate toolchain
1045
+ if args .darwin_xcrun_toolchain is None :
1046
+ xcrun_toolchain = os .environ .get ('TOOLCHAINS' ,
1047
+ defaults .DARWIN_XCRUN_TOOLCHAIN )
1048
+
1049
+ diagnostics .note ('Using toolchain {}' .format (xcrun_toolchain ))
1050
+ args .darwin_xcrun_toolchain = xcrun_toolchain
1051
+
1044
1052
toolchain = host_toolchain (xcrun_toolchain = args .darwin_xcrun_toolchain )
1045
1053
os .environ ['TOOLCHAINS' ] = args .darwin_xcrun_toolchain
1046
1054
Original file line number Diff line number Diff line change @@ -314,7 +314,6 @@ def create_argument_parser():
314
314
help = 'the number of parallel build jobs to use' )
315
315
316
316
option ('--darwin-xcrun-toolchain' , store ,
317
- default = defaults .DARWIN_XCRUN_TOOLCHAIN ,
318
317
help = 'the name of the toolchain to use on Darwin' )
319
318
option ('--cmake' , store_path (executable = True ),
320
319
help = 'the path to a CMake executable that will be used to build '
Original file line number Diff line number Diff line change 107
107
defaults .DARWIN_DEPLOYMENT_VERSION_TVOS ,
108
108
'darwin_deployment_version_watchos' :
109
109
defaults .DARWIN_DEPLOYMENT_VERSION_WATCHOS ,
110
- 'darwin_xcrun_toolchain' :
111
- defaults .DARWIN_XCRUN_TOOLCHAIN ,
110
+ 'darwin_xcrun_toolchain' : None ,
112
111
'distcc' : False ,
113
112
'dry_run' : False ,
114
113
'enable_asan' : False ,
You can’t perform that action at this time.
0 commit comments