Skip to content

[Build Script Helper] Distinguish between swift executable used to build and frontend used by tests #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Utilities/build-script-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def should_test_parallel():
return True


def handle_invocation(swift_exec, args):
def handle_invocation(swift_exec, swift_frontend_exec, args):
swiftpm_args = get_swiftpm_options(args)

env = os.environ
Expand All @@ -108,7 +108,8 @@ def handle_invocation(swift_exec, args):
if args.action == 'build':
swiftpm('build', swift_exec, swiftpm_args, env)
elif args.action == 'test':
env['SWIFT_DRIVER_SWIFT_FRONTEND_EXEC'] = '%sc' % (swift_exec)
env['SWIFT_DRIVER_SWIFT_FRONTEND_EXEC'] = '%s' % (swift_frontend_exec)
env['SWIFT_EXEC'] = '%sc' % (swift_exec)
test_args = swiftpm_args
if should_test_parallel():
test_args += ['--parallel']
Expand Down Expand Up @@ -150,11 +151,13 @@ def add_common_args(parser):
args.toolchain = os.path.abspath(args.toolchain)

if args.toolchain:
swift_exec = os.path.join(args.toolchain, 'bin', 'swift-frontend')
swift_exec = os.path.join(args.toolchain, 'bin', 'swift')
swift_frontend_exec = os.path.join(args.toolchain, 'bin', 'swift-frontend')
else:
swift_exec = 'swift'
swift_frontend_exec = 'swift-frontend'

handle_invocation(swift_exec, args)
handle_invocation(swift_exec, swift_frontend_exec, args)

if __name__ == '__main__':
main()