Search Issue Tracker

Active

Votes

19

Found in

2020.3.31f1

Issue ID

1412113

Regression

No

[WebGL][BuildError] Constant il2cpp build error after OSX 12.3 Upgrade

Web Platform

-

Repro:
On a macOS computer with macOS 12.3:
1. Create a new empty 3D project
2. Switch platform to WebGL
3. Build

What happens: the following build error occurs:
When building for WebGL target, constantly get the error
System.ComponentModel.Win32Exception (2): No such file or directory
at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Unity.IL2CPP.Shell.SetupAndStart(ExecuteContext context, Boolean asyncMode) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 423

Repro on 2020.3.31f1
Not repro on trunk 2022.2.0a9

Only repro on macOS 12.3
Not repro on Windows

Comments (5)

  1. 37f8eddb50e0914ad3ea2fa085289f1e?d=mm

    CengageJermAker

    Apr 12, 2022 17:09

    Python 3.10.2 installed via Homebrew and this fixed mine:
    Environment.SetEnvironmentVariable("EMSDK_PYTHON", "/usr/local/Cellar/python@3.10/3.10.2/Frameworks/Python.framework/Versions/3.10/bin/python3.10");

  2. Ba731d3a486107b0777c1d5717e78e80?d=mm

    simon_zappar

    Apr 01, 2022 20:22

    Thanks for the hint Dmitrov.

    So the issue is macOS 12.3 dropped the /usr/bin/python executable.

    The version of emscripten in 2020.3 is pretty old but does support python2 or python3.

    So the fix for me was to open /Applications/Unity/Hub/Editor/2020.3.31f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc in a text editor, and change the first line to: #!/usr/bin/env python3

  3. 1b0002ee319a421a56ef94c199382fb7?d=mm

    dimitroff

    Mar 29, 2022 11:22

    For a temporary fix, install python 2.7 and then make a pre-build editor script to set the EMSDK_PYTHON env variable.

    In my case it looks like this:

    public class PreBuildProcessing : IPreprocessBuildWithReport
    {
    public int callbackOrder => 1;

    public void OnPreprocessBuild(BuildReport report)
    {
    System.Environment.SetEnvironmentVariable("EMSDK_PYTHON", "/Library/Frameworks/Python.framework/Versions/2.7/bin/python");
    }
    }

  4. 19f8bd98468bf416cc579cbd5f78cf91?d=mm

    adowtatepmar

    Mar 25, 2022 19:03

    Not fixed after installing python 2.7

  5. A4b8e92fb3b9239735c1bfada5190dea?d=mm

    M_R_Antonio

    Mar 25, 2022 07:06

    Exact same happening here

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.