Skip to content

Commit 8ff6eab

Browse files
authored
Merge pull request swiftlang#43 from Rostepher/disable-sandbox
[Build System] Added flag to disable Swift PM sandboxes.
2 parents 9004282 + 3803d55 commit 8ff6eab

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: build-script.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,17 @@ def get_swiftpm_invocation(spm_exec, build_dir, release):
161161

162162

163163
def build_swiftsyntax(swift_build_exec, swiftc_exec, build_dir, build_test_util, release,
164-
verbose):
164+
verbose, disable_sandbox=False):
165165
print('** Building SwiftSyntax **')
166166

167167
swiftpm_call = get_swiftpm_invocation(spm_exec=swift_build_exec,
168168
build_dir=build_dir,
169169
release=release)
170170
swiftpm_call.extend(['--product', 'SwiftSyntax'])
171171

172+
if disable_sandbox:
173+
swiftpm_call.append('--disable-sandbox')
174+
172175
# Only build lit-test-helper if we are planning to run tests
173176
if build_test_util:
174177
swiftpm_call.extend(['--product', 'lit-test-helper'])
@@ -392,6 +395,13 @@ def main():
392395
help='''
393396
The directory to where the .swiftmodule should be installed.
394397
''')
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+
395405
testing_group = parser.add_argument_group('Testing')
396406
testing_group.add_argument('-t', '--test', action='store_true',
397407
help='Run tests')
@@ -453,7 +463,8 @@ def main():
453463
build_dir=args.build_dir,
454464
build_test_util=args.test,
455465
release=args.release,
456-
verbose=args.verbose)
466+
verbose=args.verbose,
467+
disable_sandbox=args.disable_sandbox)
457468
except subprocess.CalledProcessError as e:
458469
printerr('Error: Building SwiftSyntax failed')
459470
printerr('Executing: %s' % ' '.join(e.cmd))

0 commit comments

Comments
 (0)