Search Unity

Burst Fails When Compiling from within a Package?

Discussion in 'Burst' started by ickydime, Jul 12, 2022.

  1. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    110
    I am trying to port another developer's library into a project. When I build their test project using the same properties/unity version (2020.3.30f1) it works fine. When I bring it over to my project as a package and asmdef file it gives the following exception on build:

    Burst.Compiler.IL.Helpers.MethodDecoderException: Unable to decode `AprilTag.ImageConverter, XXX Platform - MRTK, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::BurstConvert(UnityEngine.Color32*, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Byte*, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)` ---> Burst.Compiler.IL.Helpers.MethodDecoderException: Unexpected char `P` while decoding function name, expecting `::` instead of `Platform - MRTK, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::BurstConvert(UnityEngine.Color32*, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Byte*, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)

    It seems to think the function name is "AprilTag.ImageConverter, XXX Platform - MRTK..."

    Any ideas how to prevent that?

    Their project uses burst 1.6.5 and this one uses 1.6.6
     
  2. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    Is the assembly name supposed to be "XXX Platform - MRTK". If so, it looks like there may be a bug in Burst when handling assemblies with spaces in their name. We'll investigate.
     
  3. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    110
    Removing the spaces fixed it. Cheers!
     
  4. vuthang

    vuthang

    Joined:
    Mar 7, 2017
    Posts:
    50
    I get this error:
    BuildFailedException: Burst compiler (1.6.6) failed running

    stdout:
    Overriding backend due to platform constraints : 'burst-llvm-10'
    An unexpected exception occurred:
    stderr:
    Burst.Compiler.IL.Helpers.MethodDecoderException: Unable to decode `Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[????+PostUpdatePhysicsJob, MagicaCloth, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(????+PostUpdatePhysicsJob&, MagicaCloth, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)` ---> Burst.Compiler.IL.Helpers.MethodDecoderException: Unexpected char `?` while decoding identifier `????+PostUpdatePhysicsJob, MagicaCloth, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(????+PostUpdatePhysicsJob&, MagicaCloth, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)`
    at Burst.Compiler.IL.Helpers.CecilInterop+MethodParser.DecodeTypeName () [0x00038] in <ed7d93ab72ae4d469fc9027b31698d75>:0
    at Burst.Compiler.IL.Helpers.CecilInterop+MethodParser.DecodeType () [0x00000] in <ed7d93ab72ae4d469fc9027b31698d75>:0
    at Burst.Compiler.IL.Helpers.CecilInterop+MethodParser.DecodeGenericType (System.String typeName) [0x00054] in <ed7d93ab72ae4d469fc9027b31698d75>:0
    at Burst.Compiler.IL.Helpers.CecilInterop+MethodParser.DecodeType () [0x00027] in <ed7d93ab72ae4d469fc9027b31698d75>:0
    at Burst.Compiler.IL.Helpers.CecilInterop+MethodParser.DecodeMethod () [0x00006] in <ed7d93ab72ae4d469fc9027b31698d75>:0
    at Burst.Compiler.IL.Helpers.CecilInterop.DecodeMethodFromString (System.String fullMethodName) [0x00017] in <ed7d93ab72ae4d469fc9027b31698d75>:0
    --- End of inner exception stack trace ---
    at Burst.Bcl.BclApp.CompileAndLink (System.Collections.Generic.List`1[T] libraryCompilationRequests) [0x001a0] in <bb46234c1fc843108523ff783f680f0a>:0
    at Burst.Bcl.Program.BuildTheThing (Burst.Bcl.BclOptions options, System.Diagnostics.Stopwatch& individualTimer) [0x00262] in <bb46234c1fc843108523ff783f680f0a>:0
    at Burst.Bcl.Program.Main (System.String[] args) [0x0029d] in <bb46234c1fc843108523ff783f680f0a>:0
    Please help me fix this.
     
  5. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    Hi @vuthang - please could you try upgrading to Burst 1.8.3 and seeing if the error still happens?

    If it does, please could you submit a bug report via Help > Report a Bug, and let me know the bug number here, and we'll take a look.

    At first glance it looks like you have a type named "????", which is probably ofuscated, and possibly Burst doesn't recognise that as a type name. But a repro / bug report would help a lot.
     
    vuthang likes this.
  6. vuthang

    vuthang

    Joined:
    Mar 7, 2017
    Posts:
    50
    Thank for support. I use Obfuscator for encrypt and this encrypt plugin Magica Cloth. I add MagicaCloth to ignore and build not error