Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

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

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

  1. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    103
    Did you try the 6 beta?
     
  2. Saeed-Barari

    Saeed-Barari

    Joined:
    Jul 12, 2021
    Posts:
    68
    2022.3.25f1 fixed. be careful though, building with LTO will significantly increase the build size, that's *normal* and not a bug, and also note that a clean build takes a lot longer than an incremental build.
     
  3. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,175
    I will confirm however, speed of hard disk has a significant play.. I had a normal nvme disk, i was running low in space, so i bought me a twice as fast twice as big one, build time has gone down significantly.
     
    Saeed-Barari likes this.
  4. Oyshoboy

    Oyshoboy

    Joined:
    Jan 6, 2017
    Posts:
    23
    Sam issue here, unity version 2022.3.27f1 (Mac, Apple Silicone)
    upload_2024-5-29_17-46-48.png
     
  5. Zarod

    Zarod

    Joined:
    Jan 20, 2016
    Posts:
    69
    unfortunately, even with the improvements that process is sadly very slow and memory intensive.

    I would hope a Unity engeneer confirms or rectifies the following, but even with Unity 6, for the web it is pretty much mandatory to use the non-optimized build framework, from beginning to end.

    I fear Unity assumes that master and optimized builds are being done on giant server farms or unity cloud.

    But in humble setups like laptops, all optimization must happen BEFORE the build process.

    Strip everything, build all features from scratch and code with methods that do not rely on specific hardware, so no GPU stuff :(

    The difference is minimal, and the game is pretty much universally compatible.

    I don't know how else to solve this ... it's sad to not use the new stuff, but people made games like this for 30 years, so at least you keep alive the tradition xD
     
    Saeed-Barari likes this.
  6. Saeed-Barari

    Saeed-Barari

    Joined:
    Jul 12, 2021
    Posts:
    68
    This is not entirely true. While it's important to optimize the game prior to building it, it's not specifically a massive time saver on building WebGL in Unity. What I've noticed in my own machines is that the build time is just VERY LONG when targeting disk size, around 20 minutes on a cold build, and some 10 minutes on a patch/incremental build. So, what I usually do (and recommend others to do) is to just not use the disk optimization for testing; use that only for the final build and let it run for some half an hour in the background while you tend to other matters. And DO NOT use the LTO feature at all; that one doesn't have a 100% same result as the other options, takes hours to build, and it's totally incompatible with a lot of small features you might use in your project. I had my share of "but it works on my machine" when I sent LTO for the final build and used non-LTO locally

    + as an alternative to LTO, you can use the brotli compression which hugely optimizes the disk space, without any underlying issues with various Unity features (since it's just a compression)
     
    kaioduarte likes this.
  7. unity_IyUGgpbSnQsBrA

    unity_IyUGgpbSnQsBrA

    Joined:
    Jun 19, 2020
    Posts:
    1
    I'm using Unity 6000.0.4f1 and its still not fixed...
     
  8. kaioduarte

    kaioduarte

    Joined:
    May 20, 2016
    Posts:
    3
    Same on 6000.0.5f1

    EDIT: changing build optimization to a non-disk-size target as pointed by Saeed-Barari worked
     
    Last edited: Jun 12, 2024 at 12:37 PM