Skip to content

Commit bb2ce16

Browse files
authored
Merge pull request swiftlang#337 from buttaface/droid
[build-script-helper] make it run under Python 3 and run tests in parallel on Android
2 parents 7a36a51 + 8deb6e4 commit bb2ce16

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

Utilities/build-script-helper.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def swiftpm_bin_path(swift_exec, swiftpm_args, env=None):
1818
swiftpm_args = list(filter(lambda arg: arg != '-v' and arg != '--verbose', swiftpm_args))
1919
cmd = [swift_exec, 'build', '--show-bin-path'] + swiftpm_args
2020
print(' '.join(cmd))
21-
return subprocess.check_output(cmd, env=env).strip()
21+
return subprocess.check_output(cmd, env=env, universal_newlines=True).strip()
2222

2323
def get_swiftpm_options(args):
2424
swiftpm_args = [
@@ -86,15 +86,6 @@ def delete_rpath(rpath, binary):
8686
subprocess.check_call(cmd)
8787

8888

89-
def should_test_parallel():
90-
if platform.system() == 'Linux':
91-
distro = platform.linux_distribution()
92-
if distro[0] != 'Ubuntu':
93-
# Workaround hang in Process.run() that hasn't been tracked down yet.
94-
return False
95-
return True
96-
97-
9889
def handle_invocation(swift_exec, args):
9990
swiftpm_args = get_swiftpm_options(args)
10091

@@ -129,8 +120,10 @@ def handle_invocation(swift_exec, args):
129120
print('Cleaning ' + tests)
130121
shutil.rmtree(tests, ignore_errors=True)
131122
test_args = swiftpm_args
132-
if should_test_parallel():
133-
test_args += ['--parallel']
123+
# Running the tests concurrently doesn't work with glibc 2.24 because of a
124+
# bug with posix_spawn called from Foundation, so it'll need to be disabled
125+
# or fixed when used there, according to @benlangmuir.
126+
test_args += ['--parallel']
134127
swiftpm('test', swift_exec, test_args, env)
135128
elif args.action == 'install':
136129
bin_path = swiftpm_bin_path(swift_exec, swiftpm_args, env)

0 commit comments

Comments
 (0)