Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Hilarious WebGL error on OS X

Discussion in 'Unity 5 Pre-order Beta' started by orb, Oct 27, 2014.

  1. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    No need to bother with WebGL on a Mac for now, I guess ;)

    (Yes, I've reported it. But I'd be really surprised if UT don't already know this!)
     
  2. peter_on

    peter_on

    Joined:
    Jan 8, 2009
    Posts:
    63
    Yup, runs well with win8.

    On OSX, an empty scene errors :

    Failed to run python
    UnityEngine.Debug:LogError(Object)
    NativeCompiler:RunProgram(ProcessStartInfo)
    NativeCompiler:Execute(String, String)
    UnityEditor.WebGL.Il2Cpp.EmscriptenCompiler:CompileDynamicLibrary(String, IEnumerable`1, IEnumerable`1, IEnumerable`1, IEnumerable`1)
    UnityEditorInternal.IL2CPPBuilder:Run()
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    Will find another machine w/o unity4 to try again....
     
  3. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    Which versions of OS X are you guys running?
     
  4. peter_on

    peter_on

    Joined:
    Jan 8, 2009
    Posts:
    63
    10.7.x, 10.8.x. Which version of osx u got it running ?
     
  5. Alex-Lian

    Alex-Lian

    Guest

    Known bug on OSX 10.7 only.
     
  6. peter_on

    peter_on

    Joined:
    Jan 8, 2009
    Posts:
    63
    So far only get it to work on win8.
    Give it another run. Re-installed on OSX 10.8.5, create an empty scene and export to WebGL.
    Reported to support this error :

    Error building Player: Exception: Failed building WebGL Player: python "/Applications/Unity/Unity.app/Contents/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" @"/Users/admin/Desktop/unity5/demoWebGL/emptyTest/Assets/../Temp/emcc_arguments.resp"
     
  7. v16Studios

    v16Studios

    Joined:
    Mar 1, 2013
    Posts:
    9
    No joy on Windows 7 with my project either... Similar error to OP:

    Code (generic):
    1. Error building Player: Win32Exception: ApplicationName='"C:\Program Files\Unity 5.0.0b9\Editor\Data\PlaybackEngines\webglsupport/BuildTools/Emscripten_Win/python/2.7.5.3_64bit/python.exe"',
    2.  
    3. CommandLine='"C:\Program Files\Unity 5.0.0b9\Editor\Data\PlaybackEngines\webglsupport/BuildTools/Emscripten/emcc" -Oz -s NO_EXIT_RUNTIME=1 -o "D:/R&D/U5/Viewer/Assets/../Temp/StagingArea/Data\Native\UserAssembly.bc" @"C:\Users\<usr>\AppData\Local\Temp\tmp1cda64c9.tmp"',
    4.  
    5. CurrentDirectory='D:/R&D/U5/Viewer/Assets/../Temp/EmscriptenWork'
    6.  
     
  8. RalphH

    RalphH

    Administrator

    Joined:
    Dec 22, 2011
    Posts:
    592
    Please file bugs through the bugreporter so we can look at this.
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It's fine on OS X 10.9, although builds kinda take forever, even with it set to the lowest optimization/fastest builds.

    --Eric
     
  10. v16Studios

    v16Studios

    Joined:
    Mar 1, 2013
    Posts:
    9
    Done! :) Thanks.
     
  11. RalphH

    RalphH

    Administrator

    Joined:
    Dec 22, 2011
    Posts:
    592
    Do you have a bug # for me ?
     
  12. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    Builds do take forever. Much longer than any other platform (even Flash).
    Curious as if it takes as long on Windows?
     
  13. RalphH

    RalphH

    Administrator

    Joined:
    Dec 22, 2011
    Posts:
    592
    Builds do take longer, but enabling assembly stripping in the playersettings, while doing a development build (here actually having full optimizations can make things faster), should give you the fastest turnaround time. We'll improve on this where we can, but most time is actually spent in Emscripten. They are aware of these issues and have prioritized it accordingly.

    What you can use in the beta today is already an order of magnitude faster then earlier versions, so expect improvement both from us and the Emscripten parts.
     
    made-on-jupiter and sluice like this.
  14. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    And Yosemite, which is what I have :)

    My issue number is 642980.
     
  15. RalphH

    RalphH

    Administrator

    Joined:
    Dec 22, 2011
    Posts:
    592
    To everyone reporting back on WebGL in this thread; These are likely seperate issues, so please don't report every WebGL issue you have in this threads as it pollutes the thread. If it's not likely related to this issue, either start a new thread, or just file a bug report. (this doesn't mean that for you, orb, of course).
     
  16. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Still happening on beta 11. Case 645017.
     
  17. peter_on

    peter_on

    Joined:
    Jan 8, 2009
    Posts:
    63
    Background : for my case, somehow it did not work on these environments 10.7.x, 10.8.x, upgraded 10.10. Simple angrybot and empty scene will trigger the phyton enscripten errors.

    If you are dead beaten like me to get it working at all costs. Suggest getting a new HDD and install a clean copy of Yosemite, and it has been working like a charm for 5.0.9 and 5.0.11.

    Note : it's not applicable for migrating projects from 4.x to 5.x.
     
    Last edited: Nov 4, 2014
  18. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    I AM on Yosemite. I've only ever tested Unity 5 on Yosemite :)
     
  19. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    With some help from @orb I believe that we have tracked down the cause of this problem.

    The code we were using to detect which build tool chain to use for Emscripten was a bit fragile. It assumed that the "/proc" directory does not exist on OSX. If that directory does exist, it would incorrectly assume that the OS was not OSX, and fall back to the Windows build toolchain.

    So as a temporary work-around for anyone experiencing this problem in 5.0b9 or 5.0b11, you can rename or remove the "/proc" directory (if possible). I've merged a fix for the problem today that won't require this work around, but it may take a bit of time to show up in a beta release. I'll respond here when I know which beta version will have the proper fix.

    If anyone else is seeing the same error that @orb reported, but does not have a "/proc" directory on OSX, please let me know.
     
    jashan likes this.
  20. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    This fix should be in 5.0b13. Thanks.
     
  21. jforder

    jforder

    Joined:
    Jun 30, 2012
    Posts:
    22
    Hi there,

    I'm still getting this error in the 5.0b13 build:

    Error building Player: Exception: Failed building WebGL Player: python

    I've just upgraded to Yosemite and my scene is just a cube with a rotate around script.

    You mention the "/proc" directory 2 posts up, I'm not sure I have that. Where would I find that exactly?

    Thanks
     
  22. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    In /proc - that's the full path ;)

    I very much doubt you have it, but use Terminal to make sure ("ls /").
     
    Last edited: Nov 18, 2014
  23. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    Python is used to run a number of the different build tools in the WebGL toolchain, so this error message doesn't provide too much specific information. I doubt it is the same issue as @orb originally mentioned, since 5.0b13 should not check for the existence of the /proc directory in any case.

    Can you provide more information about the error message? That might help us track down the cause.
     
  24. jforder

    jforder

    Joined:
    Jun 30, 2012
    Posts:
    22
    Thanks for the responses, here is the Error from the console:

    Error building Player: Exception: Failed building WebGL Player: python "/Applications/Unity5.0b13 /Unity.app/Contents/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" @"/Users/jonathanforder/Documents/Unity3d/MobileGyroTest/Assets/../Temp/emcc_arguments.resp"

    Hopefully that helps.

    Thanks!
     
  25. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    Unfortunately, this message does not provide enough information to track down the cause of the problem. Can you submit a bug or provide the entire contents of the editor log here? A simple cube should work, but he project may have some third-party assemblies that we don't handle correctly in the build. Thanks.
     
  26. jforder

    jforder

    Joined:
    Jun 30, 2012
    Posts:
    22
    Ok, I've submitted a bug report.

    Thanks
     
  27. MRKane

    MRKane

    Joined:
    Oct 4, 2012
    Posts:
    54
    We're running into the same problem in both OSX and Windows - figure it's something to do with some of our scripts but have been unable to get any *useful* information out of the errors. We've a rather large project (at about 12GB) so submitting the project and a bug report is a bit redundant. It's a shame that the errors cannot supply the developer with more information :(
     
  28. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    I agree, we need to improve the errors reported from the WebGL build toolchain. With that said, I might be able to help in this specific case even without a repro project. Can you provide the full Editor.log here? That should include all of the build errors, and it might give us a hint about the cause of the problem. Thanks.
     
  29. MRKane

    MRKane

    Joined:
    Oct 4, 2012
    Posts:
    54
    I'll try to get something up shortly - I've broken the project down into test cases so I can work through it and found one issue at least. One value:
    const double M_PI = 3.1415 etc.​
    which was causing the build process to crash out, but changing the name to m_Pi or MPI built successfully I'll keep picking through the project as the day goes and will report anything I do find least it's helpful :)

    Ok, we got through the other issue the main of which turned out to be an enum that had a state as NAN, changing that to NOTN allowed the build to go through to compile. Long story short I'm not sure if the conversion from c# is case sensitive and can be a little niggly. There were also problems with some dll files and something in the StandardAssets, which in their own right were a few versions old, but I couldn't say which as I brutally stripped the project down to bare bones.

    So that's the first part through I suppose, will keep posting anything I find and I do hope it helps someone out there!
     
    Last edited: Nov 25, 2014
  30. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    I don't *think* that IL2CPP will use the name M_PI anywhere (at least, I quick check of our source code doesn't turn up anything). The casing of names in your C# code should not matter. If you can get a repro project down to a reasonable size, I would appreciate it though. It seems odd that these changes you have made should be necessary. Thanks.
     
  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I'm getting an error like this in beta 18:

    Failed to run python

    Program: python Args: "/Applications/Unity5/Unity.app/Contents/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" -Oz -std=c++11 -Wno-unused-value -Wno-invalid-offsetof -I-I"/Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/Libraries/bdwgc/include" -I"/Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/Libraries/libil2cpp/include" -I"/Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/il2cppOutput" -nostdinc -c @"/var/folders/pg/vqp5lh5x5_b_yngv7411zdv40000gp/T/tmp79cbb285.tmp"

    WARNING root: [33m-I or -L of an absolute path "-I/Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/Libraries/libil2cpp/include" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass '-Wno-warn-absolute-paths' to emcc to hide this warning.[0m
    In file included from /Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Arrays_10.cpp:3:
    /Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/Libraries/libil2cpp/include/codegen/il2cpp-codegen.h:136:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
    }
    ^
    1 warning generated.
    In file included from /Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Arrays_8.cpp:3:
    /Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/Libraries/libil2cpp/include/codegen/il2cpp-codegen.h:136:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
    }
    ^
    1 warning generated.

    rogram: python Args: "/Applications/Unity5/Unity.app/Contents/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" -Oz -std=c++11 -Wno-unused-value -Wno-invalid-offsetof -I-I"/Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/Libraries/bdwgc/include" -I"/Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/Libraries/libil2cpp/include" -I"/Users/jbooth/star_trek/client/Assets/../Temp/StagingArea/Data/il2cppOutput" -nostdinc -c @"/var/folders/pg/vqp5lh5x5_b_yngv7411zdv40000gp/T/tmp72afbf4c.tmp"

    Failed to run python
    UnityEngine.Debug:LogError(Object)
    NativeCompiler:RunProgram(ProcessStartInfo) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/NativeCompiler.cs:57)
    NativeCompiler:Execute(String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/NativeCompiler.cs:23)
    UnityEditor.WebGL.Il2Cpp.EmscriptenCompiler:CompileDynamicLibrary(String, IEnumerable`1, IEnumerable`1, IEnumerable`1, IEnumerable`1)
    UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:277)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:204)
    UnityEditor.HostView:OnGUI()
     
  32. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    Please file a bug with your project attached.
     
  33. yunspace

    yunspace

    Joined:
    Nov 8, 2010
    Posts:
    41
    I also got exactly the same issue as @jbooth using beta18 on my MacBook Pro. Just to confirm I don't have /proc directory and the level I'm building is a standard demo scene from UFPS.

    I raised bug 660163 with my project attached.

    A side question, is it common practice to raise bugs with a version control link instead of attachment? If so, is there a Unity support user I can invite to my github/bitbucket repository so that I don't need to make it public? Just that it took me several hours to zip up and send my 4GB project (we got pretty terrible Broadband speeds in Australia)
     
  34. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    I had Beta 13 installed as of today, and my project compiled, although Arrow key input (Input.GetKey) was not recognised.

    I then installed Beta 18, to see if the arrow key issue was fixed, and then I now have the same the Python issue, so it seems we took a step backwards :rolleyes:

    Failed to run "C:\Program Files\Unity 5.0.0b18\Editor\Data\PlaybackEngines\webglsupport/BuildTools/Emscripten_Win/python/2.7.5.3_64bit/python.exe"

    I am using Windows 8 Bit, 64 bit editor.
     
  35. RalphH

    RalphH

    Administrator

    Joined:
    Dec 22, 2011
    Posts:
    592
    Our reporting of what is going wrong isn't very clear, sorry.

    There is no such thing as a "python" issue, although it looks that way because we haven't yet spent time of extracting a clearer error from the emscripten compiler invocation we do. What's happening is that some code that is generated from your C# code (or libraries that you pulled in) isn't compiling through the emscripten c++ compiler. Please file a bug with the project.
     
  36. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Sorry for the confusion.
    I have logged a bug for my issue.

    Case 660437
     
  37. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    Issue also occurs in case 672778 on OSX. Reported with all debug output from the failed build.