Skip to content

Commit 6359e9a

Browse files
committed
Specify encoding when running a ninja invocation
This makes the error messages show up properly in the logs instead of as a binary string.
1 parent 661d59f commit 6359e9a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Utilities/build-script-helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def swiftpm_bin_path(swift_exec, swiftpm_args, env=None):
6767
swiftpm_args = [arg for arg in swiftpm_args if arg != '-v' and arg != '--verbose']
6868
cmd = [swift_exec, 'build', '--show-bin-path'] + swiftpm_args
6969
print(' '.join(cmd))
70-
return subprocess.check_output(cmd, env=env).strip().decode("UTF-8")
70+
return subprocess.check_output(cmd, env=env, encoding='utf-8').strip()
7171

7272
def get_swiftpm_options(args):
7373
swiftpm_args = [
@@ -586,7 +586,8 @@ def cmake_build(args, swiftc_exec, cmake_args, swift_flags, source_path,
586586
ninjaProcess = subprocess.Popen(ninja_cmd, cwd=build_dir,
587587
stdout=subprocess.PIPE,
588588
stderr=subprocess.PIPE,
589-
env = os.environ)
589+
env = os.environ,
590+
encoding='utf-8')
590591
stdout, stderr = ninjaProcess.communicate()
591592
if ninjaProcess.returncode != 0:
592593
print(stdout)

0 commit comments

Comments
 (0)