Skip to content
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

最新のEMSDKでビルドができない #2

Closed
nokotan opened this issue Feb 24, 2020 · 2 comments
Closed

最新のEMSDKでビルドができない #2

nokotan opened this issue Feb 24, 2020 · 2 comments

Comments

@nokotan
Copy link
Owner

nokotan commented Feb 24, 2020

最新のEMSDKを使うと次のエラーが出てビルドができません。

Traceback (most recent call last):
  File "\*\*\*/emsdk/upstream/emscripten/emcc.py", line 3905, in <module>
    sys.exit(run(sys.argv))
  File "\*\*\*/emsdk/upstream/emscripten/emcc.py", line 2373, in run
    final = do_emscripten(final, shared.replace_or_append_suffix(target, '.mem'))
  File "\*\*\*/emsdk/upstream/emscripten/emcc.py", line 475, in do_emscripten
    emscripten.run(infile, outfile, memfile)
  File "\*\*\*/emsdk/upstream/emscripten/emscripten.py", line 2794, in run
    return temp_files.run_and_clean(lambda: emscripter(
  File "\*\*\*/emsdk/upstream/emscripten/tools/tempfiles.py", line 105, in run_and_clean
    return func()
  File "\*\*\*/emsdk/upstream/emscripten/emscripten.py", line 2795, in <lambda>
    infile, outfile_obj, memfile, temp_files, shared.DEBUG)
  File "\*\*\*/emsdk/upstream/emscripten/emscripten.py", line 2207, in emscript_wasm_backend
    glue, forwarded_data = compile_settings(temp_files)
  File "\*\*\*/emsdk/upstream/emscripten/emscripten.py", line 773, in compile_settings
    cwd=path_from_root('src'), env=env)
  File "\*\*\*/emsdk/upstream/emscripten/tools/jsrun.py", line 100, in run_js_tool
    return shared.check_call(command, *args, **kw).stdout
  File "\*\*\*/emsdk/upstream/emscripten/tools/shared.py", line 200, in check_call
    return run_process(cmd, *args, **kw)
  File "\*\*\*/emsdk/upstream/emscripten/tools/shared.py", line 181, in run_process
    ret = subprocess.run(cmd, check=check, input=input, *args, **kw)
  File "D:/obj/windows-release/37amd64_Release/msi_python/zip_amd64/subprocess.py", line 474, in run
  File "D:/obj/windows-release/37amd64_Release/msi_python/zip_amd64/subprocess.py", line 926, in communicate
UnicodeDecodeError: 'cp932' codec can't decode byte 0x86 in position 24221: illegal multibyte sequence
ターミナルの処理が終了しました (終了コード: 1)
@nokotan
Copy link
Owner Author

nokotan commented Feb 24, 2020

最近のEMSDKのバックエンドとなるPythonが2.xから3.xに更新されて、エンコーディングの取り扱いが変わったのが原因だと判明しました。
手元のビルド環境で数か所変更を加えることでビルドが成功することを確認しています。
近々EMSDKにもissueを立てるのでしばらくお待ちください。

変更箇所は次の通りです。
shared.py (180)

  if hasattr(subprocess, "run"):
    ret = subprocess.run(cmd, check=check, input=input, encoding="utf-8", *args, **kw)
    logger.debug(debug_text)
    return ret

shared.py (3430)

  out = open(stdout, 'r', encoding="utf-8").read()

@nokotan
Copy link
Owner Author

nokotan commented Apr 6, 2021

emscripten Issues に報告済み、こちら側の Issue は閉じます。

@nokotan nokotan closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant