@@ -161,14 +161,17 @@ def get_swiftpm_invocation(spm_exec, build_dir, release):
161
161
162
162
163
163
def build_swiftsyntax (swift_build_exec , swiftc_exec , build_dir , build_test_util , release ,
164
- verbose ):
164
+ verbose , disable_sandbox = False ):
165
165
print ('** Building SwiftSyntax **' )
166
166
167
167
swiftpm_call = get_swiftpm_invocation (spm_exec = swift_build_exec ,
168
168
build_dir = build_dir ,
169
169
release = release )
170
170
swiftpm_call .extend (['--product' , 'SwiftSyntax' ])
171
171
172
+ if disable_sandbox :
173
+ swiftpm_call .append ('--disable-sandbox' )
174
+
172
175
# Only build lit-test-helper if we are planning to run tests
173
176
if build_test_util :
174
177
swiftpm_call .extend (['--product' , 'lit-test-helper' ])
@@ -392,6 +395,13 @@ def main():
392
395
help = '''
393
396
The directory to where the .swiftmodule should be installed.
394
397
''' )
398
+
399
+ build_group = parser .add_argument_group ('Build' )
400
+ build_group .add_argument ('--disable-sandbox' ,
401
+ action = 'store_true' ,
402
+ help = 'Disable sandboxes when building with '
403
+ 'Swift PM' )
404
+
395
405
testing_group = parser .add_argument_group ('Testing' )
396
406
testing_group .add_argument ('-t' , '--test' , action = 'store_true' ,
397
407
help = 'Run tests' )
@@ -453,7 +463,8 @@ def main():
453
463
build_dir = args .build_dir ,
454
464
build_test_util = args .test ,
455
465
release = args .release ,
456
- verbose = args .verbose )
466
+ verbose = args .verbose ,
467
+ disable_sandbox = args .disable_sandbox )
457
468
except subprocess .CalledProcessError as e :
458
469
printerr ('Error: Building SwiftSyntax failed' )
459
470
printerr ('Executing: %s' % ' ' .join (e .cmd ))
0 commit comments