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

WebAssembly build error.

Discussion in '5.6 Beta' started by Pontik, Feb 10, 2017.

  1. Pontik

    Pontik

    Joined:
    Feb 26, 2014
    Posts:
    17
    WebGL Build (empty project) using Webassembly fails with following error if strip engine conde is off:


    @"....\WebAssemblyTest\WebAssemblyTest\Assets\..\Temp\emcc_arguments.resp"

    stdout:
    stderr:WARNING:root:--separate-asm works best when compiling to HTML. otherwise, you must yourself load the '.asm.js' file that is emitted separately, and must do so before loading the main '.js` file
    warning: unresolved symbol: glGetInternalformativwarning: unresolved symbol: _ZN4FMOD13DSPConnection6setMixEfwarning: unresolved symbol: glUnmapBufferwarning: unresolved symbol: glMapBufferRangewarning: unresolved symbol: glFlushMappedBufferRangeTraceback (most recent call last):
    File "C:\Program Files\Unity 5.6.0b7\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc", line 13, in <module>
    emcc.run()
    File "C:\Program Files\Unity 5.6.0b7\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc.py", line 2029, in run
    subprocess.check_call(cmd, stdout=open(wasm_text_target, 'w'))
    File "C:\Program Files\Unity 5.6.0b7\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\lib\subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '[u'C:\\Program Files\\Unity 5.6.0b7\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\binaryen\\bin\\asm2wasm', '.....\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.asm.js', '--total-memory=524288000', '-O3', '--mem-init=...........\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.js.mem', '--mem-base=1024', '--wasm-only']' returned non-zero exit status -1073740791
    UnityEditor.HostView:OnGUI()


    Exception: Failed building WebGL Player.
    UnityEditor.WebGL.ProgramUtils.StartProgramChecked (System.Diagnostics.ProcessStartInfo p) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/ProgramUtils.cs:48)
    UnityEditor.WebGL.WebGlBuildPostprocessor.EmscriptenLink (BuildPostProcessArgs args, Boolean wasmBuild, System.String sourceFiles, System.String sourceFilesHash) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:391)
    UnityEditor.WebGL.WebGlBuildPostprocessor.LinkBuild (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:440)
    UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:870)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:186)
    UnityEditor.HostView:OnGUI()



    if strip engine code is enabled:

    -Build is successful but runing on firefox-nightly with webassembly option enabled stops with error:
    CompileError: wasm validation error: at offset 432: non-fallthrough instruction must be followed by end or else

    with webassembly option disabled scene load, but i think it doest use webassemly, only asm.js
     
  2. Pontik

    Pontik

    Joined:
    Feb 26, 2014
    Posts:
    17
    i have used unity version 5.6.0.b6 and 5.6.0.b7. Same problems.
     
  3. Hagn

    Hagn

    Joined:
    Apr 1, 2013
    Posts:
    10
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Pontik likes this.
  5. Pontik

    Pontik

    Joined:
    Feb 26, 2014
    Posts:
    17
    Update for 5.6.0b9:

    strip engine conde is off (other error as before):

    Failed running "C:\Program Files\Unity 5.6.0b9\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe" "C:\Program Files\Unity 5.6.0b9\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc" @"D:\...\Assets\..\Temp\emcc_arguments.resp"

    stdout:WARNING: sanity check failed to run [Errno 13] Permission denied: 'C:\\Program Files\\Unity 5.6.0b9\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\emscripten.config_sanity'
    stderr:WARNING:root:did not see a source tree above or next to the LLVM root directory (guessing based on directory of C:\Program Files\Unity 5.6.0b9\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\llc), could not verify version numbers match
    INFO:root:(Emscripten: Running sanity checks)
    WARNING:root:java does not seem to exist, required for closure compiler, which is optional (define JAVA in C:\Program Files\Unity 5.6.0b9\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config if you want it)
    WARNING:root:closure compiler will not be available
    WARNING:root:--separate-asm works best when compiling to HTML. otherwise, you must yourself load the '.asm.js' file that is emitted separately, and must do so before loading the main '.js` file
    warning: unresolved symbol: glGetInternalformativwarning: unresolved symbol: _ZN4FMOD13DSPConnection6setMixEfwarning: unresolved symbol: glUnmapBufferwarning: unresolved symbol: glMapBufferRangewarning: unresolved symbol: glFlushMappedBufferRangeTraceback (most recent call last):
    File "C:\Program Files\Unity 5.6.0b9\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc", line 13, in <module>
    emcc.run()
    File "C:\Program Files\Unity 5.6.0b9\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc.py", line 2029, in run
    subprocess.check_call(cmd, stdout=open(wasm_text_target, 'w'))
    File "C:\Program Files\Unity 5.6.0b9\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\lib\subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '[u'C:\\Program Files\\Unity 5.6.0b9\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\binaryen\\bin\\asm2wasm', 'D:\\....\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.asm.js', '--total-memory=268435456', '-O3', '--mem-init=D:\\....\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.js.mem', '--mem-base=1024', '--wasm-only']' returned non-zero exit status -1073740791

    build fails exactly if wasm build process going over 2k memory usage


    strip engine code is enabled(other error):

    Instead of: CompileError: wasm validation error: at offset 432: non-fallthrough instruction must be followed by end or else

    fireforx nightly browser console:

    Use of nsIFile in content process is deprecated. loader.js:278:6
    Successfully compiled asm.js code (total compilation time 5ms; not stored in cache (too small to benefit)) UnityLoader.js
    Successfully compiled asm.js code (total compilation time 4ms; not stored in cache (too small to benefit)) UnityLoader.js
    IndexedDB UnknownErr: ActorsParent.cpp:596 (unbekannt)
    failed to instantiate wasm module: LinkError: imported Memory with incompatible size UnityLoader.js:1
    Memory size incompatibility issues may be due to changing TOTAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set TOTAL_MEMORY at runtime to something smaller than it was at compile time). UnityLoader.js:1
    IndexedDB is not available. Data will not persist in cache and PlayerPrefs will not be saved. c2574eeb-aa39-412d-b24a-7dc0a57a1a09:355
    Invoking error handler due to
    TypeError: __GLOBAL__sub_I_runtime_animation_lump_cpp is not a function

    I dont change TOTAL_MEMORY at all. reducing TOTAL_MEMORY has no effect - same error.
     
  6. Pontik

    Pontik

    Joined:
    Feb 26, 2014
    Posts:
    17
    Error alerted in browser:
    An error occured running the Unity content on this page. See your browser JavaScript console for more info. The error was:
    TypeError: __GLOBAL__sub_I_runtime_animation_lump_cpp is not a function