|
1 |
| -#!/usr/bin/env python |
2 |
| - |
3 |
| -from __future__ import print_function |
| 1 | +#!/usr/bin/env python3 |
4 | 2 |
|
5 | 3 | import argparse
|
6 | 4 | from distutils import file_util
|
@@ -66,10 +64,10 @@ def swiftpm(action, swift_exec, swiftpm_args, env=None):
|
66 | 64 | subprocess.check_call(cmd, env=env)
|
67 | 65 |
|
68 | 66 | def swiftpm_bin_path(swift_exec, swiftpm_args, env=None):
|
69 |
| - swiftpm_args = list(filter(lambda arg: arg != '-v' and arg != '--verbose', swiftpm_args)) |
| 67 | + swiftpm_args = [arg for arg in swiftpm_args if arg != '-v' and arg != '--verbose'] |
70 | 68 | cmd = [swift_exec, 'build', '--show-bin-path'] + swiftpm_args
|
71 | 69 | print(' '.join(cmd))
|
72 |
| - return subprocess.check_output(cmd, env=env).strip() |
| 70 | + return subprocess.check_output(cmd, env=env).strip().decode("UTF-8") |
73 | 71 |
|
74 | 72 | def get_swiftpm_options(args):
|
75 | 73 | swiftpm_args = [
|
@@ -121,7 +119,7 @@ def get_swiftpm_options(args):
|
121 | 119 |
|
122 | 120 | def install_binary(file, source_dir, install_dir, verbose):
|
123 | 121 | print('Installing %s into: %s' % (file, install_dir))
|
124 |
| - cmd = ['rsync', '-a', os.path.join(source_dir.decode('UTF-8'), file), install_dir] |
| 122 | + cmd = ['rsync', '-a', os.path.join(source_dir, file), install_dir] |
125 | 123 | if verbose:
|
126 | 124 | print(' '.join(cmd))
|
127 | 125 | subprocess.check_call(cmd)
|
@@ -153,12 +151,7 @@ def add_rpath(rpath, binary, verbose):
|
153 | 151 | print(stdout)
|
154 | 152 |
|
155 | 153 | def should_test_parallel():
|
156 |
| - if platform.system() == 'Linux': |
157 |
| - distro = platform.linux_distribution() |
158 |
| - if distro[0] != 'Ubuntu': |
159 |
| - # Workaround hang in Process.run() that hasn't been tracked down yet. |
160 |
| - return False |
161 |
| - return True |
| 154 | + return platform.system() != 'Linux' |
162 | 155 |
|
163 | 156 | def handle_invocation(args):
|
164 | 157 | swiftpm_args = get_swiftpm_options(args)
|
@@ -308,9 +301,8 @@ def install_libraries(args, build_dir, universal_lib_dir, toolchain_lib_dir, tar
|
308 | 301 | delete_rpath(driver_lib_dir_path, lib_path, args.verbose)
|
309 | 302 |
|
310 | 303 | # Fixup the TSC and llbuild rpaths
|
311 |
| - driver_libs = map(lambda d: os.path.join('lib', d), ['libSwiftDriver', 'libSwiftOptions', 'libSwiftDriverExecution']) |
312 |
| - tsc_libs = map(lambda d: os.path.join('dependencies', 'swift-tools-support-core', 'lib', d), |
313 |
| - ['libTSCBasic', 'libTSCLibc', 'libTSCUtility']) |
| 304 | + driver_libs = [os.path.join('lib', d) for d in ['libSwiftDriver', 'libSwiftOptions', 'libSwiftDriverExecution']] |
| 305 | + tsc_libs = [os.path.join('dependencies', 'swift-tools-support-core', 'lib', d) for d in ['libTSCBasic', 'libTSCLibc', 'libTSCUtility']] |
314 | 306 | for lib in driver_libs + tsc_libs:
|
315 | 307 | for target in targets:
|
316 | 308 | lib_path = os.path.join(build_dir, target,
|
|
0 commit comments