#Unity 2022.3.6f1 LTS: Burst errors when building game, works fine in editor

1 messages · Page 1 of 1 (latest)

quaint trail
#

I've received a suite of errors under this header:
Building Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\wqp6nauqn0ae.obj failed with output:, attached as a text file here. (I added some line separators to help identify individual errors)

They all seem like weird burst internal errors to me, like...

'bool EntityManager_HasBuffer_TisSideEffectBufferData_tD937F0ABF9C5DD69F0992563AAFD0C3E95146288_m5187EBAA5A0817E6EC50E2F489351106C8B2BD53(EntityManager_t245CC8C15DD62AF5BA0B385CF94EA7CD0B3F4C91 *,Entity_t56176FC78C475061A82383D9E0CEE352C6C52ABD,const RuntimeMethod *)': cannot convert argument 2 from 'int32_t' to 'Entity_t56176FC78C475061A82383D9E0CEE352C6C52ABD'

wtf lol

I recently made some big changes to how my game uses ECS (to better utilise Burst and job scheduling). The game used Unity 2022.2.0f1 when I started making the changes, and some mysterious errors (in editor, not in build) led to me upgrading to Unity 2022.3.6f1 to successfully resolve them.

Unfortunately that means there's a LOT of changes in between now and when the game was last building successfully so it's not really possible for me to bisect and find the exact moment it went from building <-> not building 😦

Any tips on how to go about dealing with these build errors?

#

Looking at each of the apparent issues showing up there:

  • EntityManager_HasBuffer_TisSideEffectBufferData
    SideEffectBufferData is a very simple blittable buffer type. Although, not sure if relevant, it has [InternalBufferCapacity(0)] 🤔 Is 0 not supported? I do use 0 capacity with two other buffer types that aren't showing up any errors though, and this was not one of the new changes so it worked fine before
#
  • Stats_RegisterGlobalSideEffects

Stats is a struct with a big bunch of containers and helper methods that I pass around my ECS. I have quite a few other similar structs like this, and I don't see anything standing out about Stats.RegisterGlobalSideEffects to make it cause any issue 🤔 Takes a struct ref, and an entity, as parameters, which seems very standard.

#
  • 'void NullCheck(void *)': cannot convert argument 1 from 'Receipt_t312951EFC68719291293A06BBD86FF567335B989' to 'void *'
    ??? Absolutely no idea what's going on here
#
  • InventorySystem_AddSelectedRewardToInventory
    That's an instance method on the InventorySystem with nothing else special about it 🤔

cannot convert argument 1 from 'Receipt_t312951EFC68719291293A06BBD86FF567335B989' to 'InventorySystem_t9B7877FC8DC35E7EC1A58B00CEC4748606DDA2D9 *'
Looks like it's failing to convert the class instance parameter here? No idea...

#
  • KeyInfoItem
    I dunno why Burst is looking at this data type at all. It's a class, and is not used by Burst or the entire ECS ecosystem at all - it's used by the UI layer (MonoBehaviour and UI Toolkit-driven). It kind of explains why ___Type and ___Subtype wouldn't exist, but why is Burst even processing this type?
#
  • ObjectDataAuthoring_CreateBoon
    ObjectDataAuthoring is a MonoBehaviour. It has a suite of static CreateX methods, and CreateBoon is one of those statics. Like the other methods above, I don't see anything special about this one to explain any such behaviour.
#

Well that's all of them. I don't have any leads to go down 😦

I tried clearing the Library / Temp / obj/Debug folders and kicking it off all over again and the same errors popped up, so there's something consistent about them.

dusky matrix
#

these are all il2cpp errors, not burst errors

#

so you're telling me you were making il2cpp builds successfully on 22.3.0? i'm pretty surprised since il2cpp is really quite well tested

#

and it's really quite rare for it to generate cpp that doesn't compile (which is what you're seeing here)

#

it kind of makes me suspect your version of visual studio c++ is weird, or something?

quaint trail
#

Oh of course 🤦‍♂️ il2cpp errors!

#

Actually I think it was non-il2cpp on 22.2.0f1, before I upgraded 🤔 Probably because I was getting some other mysterious bug back then so I just dropped it to Mono

#

I can try switching back to Mono again to confirm. Then try re-installing the C++ stuff that Unity uses? Should I do that via Unity Hub or is there a better way?

I'm deving in Rider so I'm happy to completely nuke and re-install any Visual Studio stuff

dusky matrix
#

not via hub, via visual studio installer

#

manual says For development: IL2CPP scripting backend requires Visual Studio 2015 with C++ Tools component or later and Windows 10+ SDK.

quaint trail
#

Right. I have VS 2022 with a bunch of C++ related things installed - I don't see any specifically called "C++ Tools" which makes it a little harder to know if I'm missing something or not. Also have Windows 10 SDK (10.0.19041.0)

#

If I tick the "Game development with Unity" workload box, it shows "Visual Studio Tools for Unity" and "C# and Visual Basic" as the modules that would be installed 🤔 Looks like this would be a good place to add all of the relevant dependencies in future?

#

It did build successfully with Mono 👍

dusky matrix
#

desktop development with c++, maybe?

#

visual studio tools for unity (VSTU) is the thing that lets you debug c# in the editor and players with visual studio

quaint trail
#

I did already have Desktop development with C++ installed

dusky matrix
#

is it possible you have a lambda inside of an entities.foreach

#

if so, you should a) not use entities.foreach because it destroys iteration time, but b) if you must do that, try removing the lambda and see if it fixes it

#

because i guess that causes us to lose our minds in some way

quaint trail
#

Hmm no lambdas inside entities.foreach

  • Closest things are: Job.WithCode with a lambda
  • I use local functions in some places, but not jobs or entities.foreach
golden stirrup
#

Local functions have randomly broken for years in EFE JWC

#

I thought they recently disallowed them

#

Entities.ForEach and Job.WithCode now generate an error if their lambda contains other lambdas or local functions. This never fully worked or was fully implemented. Instead, try using APIs, like SystemAPI.Query, IJobEntity and IJobChunk. These all work with both local functions and lambdas.

#

yeah 1.0.10 fully disallowed you doing

#

because they've just been broken for years

quaint trail
#

Yep I had to remove all local functions when from foreach and jobs when I updated that 👍

#

but I still have them in some other places

golden stirrup
#

oh sorry i see you dont have them in efe

#

misread