Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Remote agent WebGL builds failing

Discussion in 'Web' started by ckairis, Aug 19, 2020.

  1. ckairis

    ckairis

    Joined:
    Jan 13, 2020
    Posts:
    1
    I recently just upgraded to Unity Editor v2020.1.0f1 and ever since then my Azure pipeline's remote WebGL builds have been failing when they get to the step of:
    Failed running "C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe" -E "C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\Emscripten\emcc" @"D:\a\1\s\Assets\..\Temp\emcc_arguments.resp"

    Usually there is a helpful stderr message, but this error only prints the command + args that failed to run.
    stderr:ERROR:root:'C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\Emscripten_FastComp_Win\binaryen\bin\asm2wasm D:\a\1\s\Temp\StagingArea\Data\linkresult_wasm\build.temp.asm.js --total-memory=33554432 --trap-mode=allow -O3 --mem-init=D:\a\1\s\Temp\StagingArea\Data\linkresult_wasm\build.js.mem --mem-base=1024 --wasm-only --symbolmap=D:\a\1\s\Temp\StagingArea\Data\linkresult_wasm\build.js.symbols -o D:\a\1\s\Temp\StagingArea\Data\linkresult_wasm\build.wasm' failed

    I am using a custom build script to build local addressables prior to starting the WebGL build. I've attached both the build logs and the custom build script.

    Any insight is appreciated!
     

    Attached Files:

    mjglatzmaier likes this.
  2. delphinius81

    delphinius81

    Joined:
    Mar 6, 2012
    Posts:
    57
    Did you ever figure out why things were failing? My team is encountering a very similar problem, but using 2019.4 in the azure devops pipeline. Other unity build targets work fine (UWP/Standalone/Android) but webgl fails, and with an almost identical error message.

    The only webgl platform specific call we make has to do with stopping webgl from capturing all input on the page
    (WebGLInput.captureAllKeyboardInput = false).
     
  3. codykairis

    codykairis

    Joined:
    Sep 22, 2020
    Posts:
    1
    We never heard anything from Unity, but we were able to get consistent WebGL builds by using an Azure self-hosted agent. https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops

    Has been working consistently for weeks now after switching over to using this agent. Hope it all goes well for you.
     
  4. gdcomtois

    gdcomtois

    Joined:
    Aug 28, 2018
    Posts:
    1
    After experimenting more with the issue my conclusions are :

    1. There is no link between any API calls (WebGLInput.captureAllKeyboardInput = false) and this bug.

    2. This issue is caused by the process asm2wasm crashing. My strongest guess is that the machine runs out of ram.
    https://developercommunity.visualst...lines-windows-hosted-instances-run-out-o.html
    Reading on the forums it looks like the build machine has 7gb of ram with 1.2 being used by the os.
    this does not leave much for the build since locally, asm2wasm takes up to ~5.5gb, so adding unity.exe on top of it we are blowing the available ram.

    We have moved our builds to a self hosted agent as well.
     
  5. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Running out of RAM is possible. If it is a multicore agent, setting a global environment variable EMCC_CORES=1 may help alleviate the RAM usage.

    When our next toolchain update lands, it will take away the whole asm2wasm.exe conversion process, so that should reduce memory usage at that step (and also speed up compilation)