Skip to content

Commit 20990f3

Browse files
authored
Merge pull request #182 from artemcm/BuildScriptHelperDriverSelector
[Build Script Helper] Distinguish between swift executable used to build and frontend used by tests
2 parents fd3f559 + a3b2611 commit 20990f3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Utilities/build-script-helper.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def should_test_parallel():
9191
return True
9292

9393

94-
def handle_invocation(swift_exec, args):
94+
def handle_invocation(swift_exec, swift_frontend_exec, args):
9595
swiftpm_args = get_swiftpm_options(args)
9696

9797
env = os.environ
@@ -108,7 +108,8 @@ def handle_invocation(swift_exec, args):
108108
if args.action == 'build':
109109
swiftpm('build', swift_exec, swiftpm_args, env)
110110
elif args.action == 'test':
111-
env['SWIFT_DRIVER_SWIFT_FRONTEND_EXEC'] = '%sc' % (swift_exec)
111+
env['SWIFT_DRIVER_SWIFT_FRONTEND_EXEC'] = '%s' % (swift_frontend_exec)
112+
env['SWIFT_EXEC'] = '%sc' % (swift_exec)
112113
test_args = swiftpm_args
113114
if should_test_parallel():
114115
test_args += ['--parallel']
@@ -150,11 +151,13 @@ def add_common_args(parser):
150151
args.toolchain = os.path.abspath(args.toolchain)
151152

152153
if args.toolchain:
153-
swift_exec = os.path.join(args.toolchain, 'bin', 'swift-frontend')
154+
swift_exec = os.path.join(args.toolchain, 'bin', 'swift')
155+
swift_frontend_exec = os.path.join(args.toolchain, 'bin', 'swift-frontend')
154156
else:
155157
swift_exec = 'swift'
158+
swift_frontend_exec = 'swift-frontend'
156159

157-
handle_invocation(swift_exec, args)
160+
handle_invocation(swift_exec, swift_frontend_exec, args)
158161

159162
if __name__ == '__main__':
160163
main()

0 commit comments

Comments
 (0)