Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question WebGL build "linking build.js (wasm)" takes forever

Discussion in 'Editor & General Support' started by doodler345, Jul 28, 2022.

  1. doodler345

    doodler345

    Joined:
    Dec 30, 2021
    Posts:
    23
    Hey guys,

    the build is always working... But at "linking build.js (wasm)" I always have to wait 5 minutes.
    Why is that? It worked without problems all the time till yesterday.



    I rebooted already of course.

    This says the editor log:

    [BUSY 6s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 16s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 26s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 36s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 46s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 56s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 66s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 76s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 86s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 96s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 106s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 116s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 126s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 136s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 146s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 156s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 166s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 176s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 186s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 196s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 206s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 216s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 226s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 236s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 246s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 256s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 266s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 276s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 286s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 296s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 306s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 316s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 326s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [BUSY 336s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
    [442/447 342s] Link_WebGL_wasm Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js (+wasm)
     
    Last edited: Aug 5, 2022
  2. FranktheGame

    FranktheGame

    Joined:
    May 9, 2018
    Posts:
    5
    Did you ever solve this? My build was taking 2 min, but now it's taking over 20 each time. It always gets stuck at linking build.js (wasm), and I get the same Busy Bee logs just like yours.
     
  3. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    151
    I have the same problem, have anybody solved this?
     
  4. scottvermast

    scottvermast

    Joined:
    Mar 16, 2021
    Posts:
    1
    Having the same problem :( Takes forever to build for WebGL because of that step!
     
  5. FranktheGame

    FranktheGame

    Joined:
    May 9, 2018
    Posts:
    5
    In case it's helpful to narrow down the issue....I tried deleting my Library Folder from my project, which is where all the Bee artifact folders are, but it just rebuilt them and had the same problem. I have also found that the long wait only happens if I make changes to a script since the previous build, even if only changing one line of code. If you guys have any bit of insight, please share.
     
  6. WindReiter

    WindReiter

    Joined:
    Jul 29, 2022
    Posts:
    7
    Same problem here! Kills my workflow when I have to build different versions out and wait for each one!
    Unity, please fix!
     
  7. Recky256

    Recky256

    Joined:
    Dec 1, 2014
    Posts:
    11
    Hi, I have the same problem on Unity 2022.2.0b16.
    It's fine on 2021LTS, 2022.1.23f1.

    Please fix Unity
     
    Last edited: Nov 21, 2022
  8. BlackSpider

    BlackSpider

    Joined:
    Oct 8, 2011
    Posts:
    34
    Looks like this is still not fixed in the latest 2022.2.0f1 release :( My last WebGL build took more then 26 minutes.

    Any update on this issue?

    upload_2022-12-9_1-52-39.png
     
    Last edited: Dec 9, 2022
  9. norekyansamvel

    norekyansamvel

    Joined:
    Aug 14, 2022
    Posts:
    2
    Hello people! Has anyone solved this problem?
     
  10. CSMZeT91

    CSMZeT91

    Joined:
    Sep 28, 2019
    Posts:
    1
    2022-12-10_101122.png 222.png 2022-12-10_101122.png In the latest version of 2021, I collected it in 100 - 150 seconds ...
     
    Last edited: Dec 10, 2022
  11. BlackSpider

    BlackSpider

    Joined:
    Oct 8, 2011
    Posts:
    34
    I think I found the issue, i think the issue is that Unity 2022.2.0f1 is shipped with a newer version of Emscripten. When I replace it with the version that is inside Unity 2022.1.23f1 it builds for me within a few minutes. Emscripten can be found here:

    2022.2.0f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten

    Most likely it is only the wasm-ld.exe that is faulty. But I just replaced the complete Emscripten folder to be sure confirm.

    I think only replacing the llvm folder inside the Emscripten folder is enough. But I could be wrong.

    The faulty version is: 14.0.1.0
    The working version is: 13.0.0.0

    Can anyone reproduce this same behavior?
     
    Last edited: Dec 15, 2022
  12. hieunguyen52ent

    hieunguyen52ent

    Joined:
    Oct 5, 2016
    Posts:
    4
    I confirmed that replacing Emscripten folder from 2022.1.22f1 also fixed this issue
     
    BlackSpider likes this.
  13. peturdarri

    peturdarri

    Joined:
    Mar 19, 2016
    Posts:
    14
    I can confirm that just swapping out wasm-ld.exe is enough to fix this issue. Scratch that, I get a build error. I'm trying out swapping out the whole folder.

    EDIT: Replacing the whole folder worked. Nice find!
     
    Last edited: Dec 15, 2022
    BlackSpider likes this.
  14. KamilDA

    KamilDA

    Joined:
    May 21, 2020
    Posts:
    294
    Did any of you file a bug report? Nothing is being fixed without one FYI.

    Workarounds are great, but Unity forums are not the best medium to get things fixed.
     
  15. BlackSpider

    BlackSpider

    Joined:
    Oct 8, 2011
    Posts:
    34
    Created a bug report Wednesday. Didn't hear anything back yet. :( Will post update here when I hear something.
     
    Last edited: Dec 17, 2022
  16. Huynie

    Huynie

    Joined:
    Sep 28, 2021
    Posts:
    4
    I had replace folder emascripten, but when i change one line code and rebuild, it take > 5 minutes :( how i can fix it, my unity version is 2022.2.0f1
     
  17. MestreZ

    MestreZ

    Joined:
    Jul 24, 2020
    Posts:
    16
    Same issue in unity version is 2022.2.1f1
     
  18. Huynie

    Huynie

    Joined:
    Sep 28, 2021
    Posts:
    4
    Bạn đang dùng version nào của bản 2022 vậy
     
  19. hieunguyen52ent

    hieunguyen52ent

    Joined:
    Oct 5, 2016
    Posts:
    4
    I'm using Unity 2022.2.0f1
     
    Huynie likes this.
  20. Huynie

    Huynie

    Joined:
    Sep 28, 2021
    Posts:
    4
    Chỉ cần thay folder emascripten của 2022.1.23 cho cái version đang dùng là đc đúng k bạn
     
  21. hieunguyen52ent

    hieunguyen52ent

    Joined:
    Oct 5, 2016
    Posts:
    4
    yes, the folder locate at 2022.1.23/PlaybackEngines/WebGLSupport/BuildTools/Emscripten
     
  22. CheeryLee

    CheeryLee

    Joined:
    Feb 23, 2014
    Posts:
    16
    KamilDA likes this.
  23. BlackSpider

    BlackSpider

    Joined:
    Oct 8, 2011
    Posts:
    34
    I didn't hear anything back from my bug report yet. So the issue linked above isn't the issue that we are experiencing. That one is about wasm-ld not being terminated when canceling. Our bug is more about it taking a really long time. Vs the 2022.1.x releases.
     
  24. hieunguyen52ent

    hieunguyen52ent

    Joined:
    Oct 5, 2016
    Posts:
    4
    this workaround make the UIs on WebGL aren't raycasted anymore, so I decide to use 2022.1.22 to make build for WebGL, and 2022.2 for others
     
    BlackSpider likes this.
  25. BlackSpider

    BlackSpider

    Joined:
    Oct 8, 2011
    Posts:
    34
    Good to know this, which makes sense that Unity is not fixing this quickly.
     
  26. sofianehamza

    sofianehamza

    Joined:
    Feb 13, 2017
    Posts:
    19
    The same bug here with unity 2022.2
     
  27. xAdamQ

    xAdamQ

    Joined:
    Jul 23, 2016
    Posts:
    47
    I upvoted it, I just don't understand why it went release while it can't build? this is weird
     
  28. Huynie

    Huynie

    Joined:
    Sep 28, 2021
    Posts:
    4
    Do you have some solution for build webgl fast in unity?
     
  29. Destruxion

    Destruxion

    Joined:
    Jun 5, 2019
    Posts:
    19
    Looks like copying Emscripten from Unity 2022.1.24 to 2022.2.0 works. Trying the same with 2022.2.1 did throw Emscripten errors while building.

    Hope this issue gets sorted out with 2022.2.2. I'm glad we even have a workaround for now.
     
  30. Protocol107

    Protocol107

    Joined:
    Jan 2, 2023
    Posts:
    2
    I followed every steps as mentioned above as well as used the same editor versions but I'm getting some errors that looks something like these :

    - Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm (referenced by top-level compiled C/C++ code)

    - Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
    error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm (referenced by top-level compiled C/C++ code)

    - BuildFailedException: Incremental Player build failed!

    Does anyone know how to fix these ? I tired deleting the whole "Bee" folder as well as "Library" folder also but got the same errors.
     
  31. Destruxion

    Destruxion

    Joined:
    Jun 5, 2019
    Posts:
    19
    I am not sure if this is required for WebGL builds, but did you also empty the target build folder?

    I cannot exactly remember the build error I got when trying to use 2022.2.1 with the Empscripten replacement, but that undefined symbol output looks familiar.
     
  32. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    196
    Same problem here. Can someone post the link to the actual bug report so we can upvote it, please?
     
    elZach and francineW like this.
  33. Protocol107

    Protocol107

    Joined:
    Jan 2, 2023
    Posts:
    2
    Yes I am emptying the target build folder each time making a new build and I actually tried with 2022.2.1 version as well and got the same error.
     
  34. francineW

    francineW

    Joined:
    Sep 15, 2022
    Posts:
    10
    Noooo, I am also getting the same errors as Destruxion is seeing on 2022.2.1 !!! Anyone one have a solution for 2022.2 ?. I tried deleting everything I can think of !
     
    Last edited: Jan 3, 2023
  35. AdionN

    AdionN

    Joined:
    Nov 6, 2019
    Posts:
    12
    One more thing, disabling Decompression fallback in Publishing settings dramatically reduces the build time. (From 20 mins to 3 when building brotli compressed build).
     
  36. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    196
    We have Decompression fallback disabled and it is still getting stuck (or at least taking longer than 2 hours :) )
    We also tried Emscripting replacement on 2022.2.0 and still a no-go. The process goes on forever "linking build.js (wasm)" . Our clean build for us can take over 60 mins (2021), so not surprised that it is taking forever and appearing to get stuck for us.
     
  37. elZach

    elZach

    Joined:
    Apr 23, 2017
    Posts:
    48
    Can you post the issue number? Or hasn't it been entered into the issue tracker yet?

    Edit: I sent an additional bug report for good measure, and will update once it enters the issue tracker.
     
    Last edited: Jan 8, 2023
    fwalker and BlackSpider like this.
  38. BlackSpider

    BlackSpider

    Joined:
    Oct 8, 2011
    Posts:
    34
    I don't think there is a public issue number yet. I would assume it has something to do with the holidays and the Unity team being off. (Hence no new releases the past few weeks.) I assume next week it will start up again. And when I have a open issue ticket number I will share it here.

    I think it isn't bad to report the same problem twice. Then they also have more repro steps to look at.
     
  39. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    2,474
    Posting it can still help when staff sees this thread :p
     
    kimvasquez17 likes this.
  40. sdbang_unity

    sdbang_unity

    Joined:
    Jan 4, 2023
    Posts:
    1
    You're great guy. I have fixed this problem. So gooooooood ~.
    I changed the version of Unity for 2022.1.24f.
     
    Last edited: Jan 12, 2023
  41. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    196
    Has anyone heard anything on this bug? The emscripten substitution did not work for us. We are having to run the WebGL build overnight :(
     
  42. kimvasquez17

    kimvasquez17

    Joined:
    Dec 19, 2017
    Posts:
    22
    I'm also having this problem. It takes a long time to build. Hope unity will fix it.
     
  43. Fingerbob

    Fingerbob

    Joined:
    Sep 6, 2014
    Posts:
    24
    Same issue, I've moved back to 22.1.24f1 to resolve. If I get time, I'll try and slim down my project to do a bug submission, but please do pop up the link when you get it, @BlackSpider
     
  44. G33RT

    G33RT

    Joined:
    Dec 27, 2013
    Posts:
    46
    Same issues here. 2+h build time is simply not workable in a dev process... we are stuck with 2022.1.24
     
    Last edited: Jan 14, 2023
  45. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    2,474
    Fingerbob likes this.
  46. francineW

    francineW

    Joined:
    Sep 15, 2022
    Posts:
    10
    Any idea when 2022.2.3 will come out?
     
  47. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    2,474
    Guessing in 2 weeks
     
  48. qoqgames

    qoqgames

    Joined:
    Aug 23, 2020
    Posts:
    5
    Seems not fixed in 2022.2.3

    upload_2023-1-24_15-31-55.png

    Guess we need to wait 2022.2.4 ?
     
    fwalker likes this.
  49. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    2,474
    Hmmm it does say resolved in 22.2.3 in the issue tracker.

    Is that a cold or warm build?
    Maybe make a new report with 22.2.3 to be sure if it's a warm build?
    If you link the previous issue on the tracker they can check what to update etc
     
  50. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    196
    DevDunk what is a cold or warm build?