8000 Added build flag to optionally disable the sandbox when building swif… · swiftlang/swift-syntax@7b7a977 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7b7a977

Browse files
author
Ross Bayer
committed
Added build flag to optionally disable the sandbox when building swift-syntax with Swift PM.
(cherry picked from commit 3803d55)
1 parent 25f7358 commit 7b7a977

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

build-script.py

Lines changed: 13 additions & 2 deletions
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)
0