@@ -50,14 +50,13 @@ def should_build(self, host_target):
50
50
return True
51
51
52
52
def build (self , host_target ):
53
- run_build_script_helper ('build' , host_target , self , self . args )
53
+ self . run_build_script_helper ('build' , host_target )
54
54
55
55
def should_test (self , host_target ):
56
56
return self .args .test_indexstoredb
57
57
58
58
def test (self , host_target ):
59
- run_build_script_helper ('test' , host_target , self , self .args ,
60
- self .args .test_indexstoredb_sanitize_all )
59
+ self .run_build_script_helper ('test' , host_target )
61
60
62
61
def should_install (self , host_target ):
63
62
return False
@@ -82,63 +81,33 @@ def get_dependencies(cls):
82
81
swiftsyntax .SwiftSyntax ]
83
82
84
83
85
- def run_build_script_helper (action , host_target , product , args ,
86
- sanitize_all = False , clean = False ):
87
- script_path = os .path .join (
88
- product .source_dir , 'Utilities' , 'build-script-helper.py' )
89
-
90
- install_destdir = product .host_install_destdir (host_target )
91
- toolchain_path = product .native_toolchain_path (host_target )
92
- is_release = product .is_release ()
93
- configuration = 'release' if is_release else 'debug'
94
- helper_cmd = [
95
- script_path ,
96
- action ,
97
- '--package-path' , product .source_dir ,
98
- '--build-path' , product .build_dir ,
99
- '--configuration' , configuration ,
100
- '--toolchain' , toolchain_path ,
101
- '--ninja-bin' , product .toolchain .ninja ,
102
- '--multiroot-data-file' , MULTIROOT_DATA_FILE_PATH ,
103
- ]
104
- if args .verbose_build :
105
- helper_cmd .append ('--verbose' )
106
-
107
- if sanitize_all :
108
- helper_cmd .append ('--sanitize-all' )
109
- elif args .enable_asan :
110
- helper_cmd .extend (['--sanitize' , 'address' ])
111
- elif args .enable_ubsan :
112
- helper_cmd .extend (['--sanitize' , 'undefined' ])
113
- elif args .enable_tsan :
114
- helper_cmd .extend (['--sanitize' , 'thread' ])
115
-
116
- if clean :
117
- helper_cmd .append ('--clean' )
118
-
119
- # Pass Cross compile host info unless we're testing.
120
- # It doesn't make sense to run tests of the cross compile host.
121
- if product .has_cross_compile_hosts () and action != 'test' :
122
- if product .is_darwin_host (host_target ):
123
- if len (args .cross_compile_hosts ) != 1 :
124
- raise RuntimeError ("Cross-Compiling indexstoredb to multiple " +
125
- "targets is not supported" )
126
- helper_cmd += ['--cross-compile-host' , args .cross_compile_hosts [0 ]]
127
- elif product .is_cross_compile_target (host_target ):
128
- helper_cmd .extend (['--cross-compile-host' , host_target ])
129
- build_toolchain_path = install_destdir + args .install_prefix
130
- resource_dir = '%s/lib/swift' % build_toolchain_path
131
- helper_cmd += [
132
- '--cross-compile-config' ,
133
- targets .StdlibDeploymentTarget .get_target_for_name (host_target ).platform
134
- .swiftpm_config (args , output_dir = build_toolchain_path ,
135
- swift_toolchain = toolchain_path ,
136
- resource_path = resource_dir )
137
- ]
138
-
139
- if action == 'install' and product .product_name () == "sourcekitlsp" :
140
- helper_cmd .extend ([
141
- '--prefix' , install_destdir + args .install_prefix
142
- ])
143
-
144
- shell .call (helper_cmd )
84
+ def run_build_script_helper (self , action , host_target ):
85
+ script_path = os .path .join (
86
+ self .source_dir , 'Utilities' , 'build-script-helper.py' )
87
+
88
+ install_destdir = self .host_install_destdir (host_target )
89
+ toolchain_path = self .native_toolchain_path (host_target )
90
+ configuration = 'release' if self .is_release () else 'debug'
91
+ helper_cmd = [
92
+ script_path ,
93
+ action ,
94
+ '--package-path' , self .source_dir ,
95
+ '--build-path' , self .build_dir ,
96
+ '--configuration' , configuration ,
97
+ '--toolchain' , toolchain_path ,
98
+ '--ninja-bin' , self .toolchain .ninja ,
99
+ '--multiroot-data-file' , MULTIROOT_DATA_FILE_PATH ,
100
+ ]
101
+ if self .args .verbose_build :
102
+ helper_cmd .append ('--verbose' )
103
+
104
+ if self .args .test_indexstoredb_sanitize_all :
105
+ helper_cmd .append ('--sanitize-all' )
106
+ elif self .args .enable_asan :
107
+ helper_cmd .extend (['--sanitize' , 'address' ])
108
+ elif self .args .enable_ubsan :
109
+ helper_cmd .extend (['--sanitize' , 'undefined' ])
110
+ elif self .args .enable_tsan :
111
+ helper_cmd .extend (['--sanitize' , 'thread' ])
112
+
113
+ shell .call (helper_cmd )
0 commit comments