Building Assetbundles hangs indefinitely while building on a mac with the -batchmode option set

We're trying to setup a mac mini to use as a secondary buildstation. Our current jenkins setup works on windows, but after our adjustements for mac environment, we've had jobs being stuck on the bundle building process.
While trying to inspect where this behavior comes from, we tried to remove the -batchmode option, but with that unset the builds never hang anymore.

Unfortunately, while that fixes our builds, it's not a viable solution as we can always have some popup blocking execution. Is this a known issue?

Do you have any editor logs? do you know which part of the process hangs?

Yeah, all our build logs end like this :

Script Compilation Pipeline Post Process Assets time: 0.000011s
Assembly Updater Post Process Assets time: 0.000013s

Hashing assets (1 files)... 0.000 seconds
  file read: 0.000 seconds (0.001 MB)
  wait for write: 0.000 seconds (I/O thread blocked by consumer, aka CPU bound)
  wait for read: 0.000 seconds (CPUT thread waiting for I/O thread, aka disk bound)
  hash: 0.000 seconds
Connect to CacheServer unity-cache.mds.com:8126
Script Compilation Pipeline Post Process Assets time: 0.000007s
Assembly Updater Post Process Assets time: 0.000017s
Unloading 907 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 0.61 GB.
System memory in use after: 0.61 GB.

Unloading 1354 unused Assets to reduce memory usage. Loaded Objects now: 13123.
Total: 20.412698 ms (FindLiveObjects: 1.578099 ms CreateObjectMapping: 0.828326 ms MarkObjects: 17.017840 ms  DeleteObjects: 0.987366 ms)

Disconnect from CacheServer
Refreshing native plugins compatible for Editor in 20.14 ms, found 3 plugins.
Preloading 1 native plugins for Editor in 0.95 ms.
DisplayProgressbar: Switch To Build Platform
DisplayProgressbar: Rebuild Sprite Atlas Cache
- Collect Sprites to Pack : (SequentialAtlasing : 0)
[    153 MB ]- Grouping sprites using the selected SpritePackerPolicy.
[    337 MB ]-     Atlas "Credits" with 48 sprites assigned.
[    338 MB ]-     Atlas "FMLogos" with 9 sprites assigned.
[    338 MB ]-     Atlas "MobileHUD" with 26 sprites assigned.
[    338 MB ]-     Atlas "MobileLevel" with 10 sprites assigned.
[    338 MB ]-     Atlas "OptionsButtons" with 13 sprites assigned.
[    338 MB ]-     Atlas "PauseButtons" with 1 sprites assigned.
[    338 MB ]-     Atlas "PhotoMode" with 3 sprites assigned.
[    338 MB ]-     Atlas "RewiredControlMapper" with 6 sprites assigned.
[    338 MB ]-     Atlas "RewiredTouchControls" with 19 sprites assigned.
[    338 MB ]-     Atlas "SCLogos" with 5 sprites assigned.
[    338 MB ]-     Atlas "TTLogos" with 9 sprites assigned.
[    338 MB ]-     Atlas "UWLogos" with 5 sprites assigned.
[    338 MB ]- Completed grouping sprites to Atlas.
[    337 MB ]- Build Sprite Atlas.
[    338 MB ]- Packing 12 atlases.
[    338 MB ]- Atlas (Credits) file (9d4ef739a61812b025c5ef88a8f0ef1a) found. Mapping.
[    338 MB ]- Atlas (FMLogos) file (3b290c2ddc903581b6d9002ea451b0a9) found. Mapping.
[    338 MB ]- Atlas (MobileHUD) file (f33d20fe0d1eec2021a6fa8c30815a10) found. Mapping.
[    338 MB ]- Atlas (MobileLevel) file (1ce2b69f119a2a729361eb84673beb65) found. Mapping.
[    338 MB ]- Atlas (OptionsButtons) file (0e20c3669114f610264ea5f3415bf1b2) found. Mapping.
[    338 MB ]- Atlas (PauseButtons) file (961576b59ab91aa39a01a4105c14b823) found. Mapping.
[    338 MB ]- Atlas (PhotoMode) file (7b3a43539a31e9ed5b60be43811be271) found. Mapping.
[    338 MB ]- Atlas (RewiredControlMapper) file (5432541406f533b2540dd8e2c8d900a9) found. Mapping.
[    338 MB ]- Atlas (RewiredTouchControls) file (4999311b2d168d19c811666a5cea57cc) found. Mapping.
[    338 MB ]- Atlas (SCLogos) file (28ea1d1268b114efc64bba5ba5751300) found. Mapping.
[    338 MB ]- Atlas (TTLogos) file (fb12a045c559fc3df3b329d050b301a0) found. Mapping.
[    338 MB ]- Atlas (UWLogos) file (66bdefea8a90296756e4f0a91c33d044) found. Mapping.
[    338 MB ]- Packing completed.
[    337 MB ]- Update Sprites and Cleanup.
[    337 MB ]DisplayProgressbar: Build Player Scripts
- Starting compile Library/ScriptAssemblies/Unity.ResourceManager.dll
- Starting compile Library/ScriptAssemblies/Unity.Analytics.DataPrivacy.dll
- Starting compile Library/ScriptAssemblies/Unity.MemoryProfiler.dll
- Starting compile Library/ScriptAssemblies/Unity.ScriptableBuildPipeline.dll
- Starting compile Library/ScriptAssemblies/Unity.PackageManagerUI.Editor.dll
- Starting compile Library/ScriptAssemblies/UnityEditor.CacheServer.dll
- Starting compile Library/ScriptAssemblies/Unity.EditorCoroutines.Editor.dll

This is when the assetbundle are starting their actual building, as far as I know (last message we have is from Addressables working on creating the content catalog).

So it never finish to compile any dll, but it manages to do actual builds if we make it skip the bundle part.

@MagicDesignEmerick I glad to see someone else having this issue !
Is it random or a 100 repro case ?

@liortal from our side it seems to hang at a similar place than them. In the "Starting compile" part.

It seems quite similar to one of mine link in this post :
https://discussions.unity.com/t/749451

On our side it's totally random and not due to asset bundles sadly but it really looks like the same issue !
At least maybe if we are at least 2 some unity guys will check this and if you have a 100% repro case it could be super !

So I have some questions :
Which MacOS do you have ?
Which Unity version do you use ?

I don't think it's due to Unity version cause it's happening on all our 2018 testing version. But just in case I prefer to mention it again here.


We have this every time, as long as we're on batchmode.

We're on Unity 2018.3.13f1, on Mojave 10.14.6.

1 Like

If you have a 100% repro don't hesitate to send their the bug report with your project and the explanation to recreate your case.
From our side it's quite random so it's barely impossible to create a bug report that would be valid for Unity QA :/

If someone does have a repro and submits a bug report, please post the bug report number here, so we can follow up.

@ElvisAlistar from my side it's too random to create a repro with 100% but if @MagicDesignEmerick can give you a 100% it could be perfect cause it looks like to our random bug during automation process.

Has there been any updates to this? Or a link to the bug?

I'm on Unity 2018.4.12f1. I'm suspecting it has to do with Addressables since this is the first project where I make use of it and I haven't encountered this issue before.

To my knowledge, we still don't have a bug report on this or a clear way to repro. @ if you have a clear way to show the bug, please submit a bug report and let me know the case number you get back when you do that.

FYI, still finding this infinite hang on 2019.4.8f1 with addressables 1.14.1.

The same is happen to us building in PC. The asset bundle creation process never end. Sprite Atlas packing starts and ends indefinitely. We tested in 2019.4.14f1 and 2019.4.15f1. In 2019.4.9f1 don't happen.

We have similiar issue on the Mac OS 11.6.1, Unity 2018.4.10f1
When we building without -batchmode, all is ok - bundle builds take no more than 30 minutes
When we build with -batchmode, many build attempts hangs forever.

If we were able to make a repro project, we will submit a bug