Skip to content

Specify encoding when running a ninja invocation #1358

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
May 9, 2023
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
5 changes: 3 additions & 2 deletions Utilities/build-script-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def swiftpm_bin_path(swift_exec, swiftpm_args, env=None):
swiftpm_args = [arg for arg in swiftpm_args if arg != '-v' and arg != '--verbose']
cmd = [swift_exec, 'build', '--show-bin-path'] + swiftpm_args
print(' '.join(cmd))
return subprocess.check_output(cmd, env=env).strip().decode("UTF-8")
return subprocess.check_output(cmd, env=env, encoding='utf-8').strip()

def get_swiftpm_options(args):
swiftpm_args = [
Expand Down Expand Up @@ -586,7 +586,8 @@ def cmake_build(args, swiftc_exec, cmake_args, swift_flags, source_path,
ninjaProcess = subprocess.Popen(ninja_cmd, cwd=build_dir,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env = os.environ)
env = os.environ,
encoding='utf-8')
stdout, stderr = ninjaProcess.communicate()
if ninjaProcess.returncode != 0:
print(stdout)
Expand Down