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.
  2. Dismiss Notice

Build fails on M1 (burst errors in console)

Discussion in 'Burst' started by antonkudin, Jan 14, 2022.

  1. antonkudin

    antonkudin

    Joined:
    Aug 4, 2014
    Posts:
    32
    Getting strange errors with burst (1.6.4) and unity 2022.1.0b3 and build fails.

    Code (CSharp):
    1. System.TypeInitializationException: The type initializer for 'Burst.Backend.UnmanagedLibrary' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /Applications/Unity/Hub/Editor/2022.1.0b3/Unity.app/Contents/MonoBleedingEdge/lib/../lib/libmono-native.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
    2.   at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
    3.   at Interop+Sys..cctor () [0x00000] in <3cc0041a7bf849d5a824197f18576c2b>:0
    and

    Code (CSharp):
    1. BuildFailedException: Burst compiler (1.6.4) failed running
    2.  
    3. stdout:
    4. stderr:
    5.  
    6. Unhandled Exception:
    7. System.TypeInitializationException: The type initializer for 'Burst.Backend.UnmanagedLibrary' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /Applications/Unity/Hub/Editor/2022.1.0b3/Unity.app/Contents/MonoBleedingEdge/lib/../lib/libmono-native.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
    8.   at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
    9.   at Interop+Sys..cctor () [0x00000] in <3cc0041a7bf849d5a824197f18576c2b>:0
    10.    --- End of inner exception stack trace ---
    11.   at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <3cc0041a7bf849d5a824197f18576c2b>:0
    12.   at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <3cc0041a7bf849d5a824197f18576c2b>:0
    13.   at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <3cc0041a7bf849d5a824197f18576c2b>:0
    14.   at System.IO.Directory.Exists (System.String path) [0x0001e] in <3cc0041a7bf849d5a824197f18576c2b>:0
    15.   at Burst.Backend.UnmanagedLibrary.GetUnmanagedLibraryHandler () [0x00015] in <122cdbb72f9747f781e51b10f77175d4>:0
    16.   at Burst.Backend.UnmanagedLibrary..cctor () [0x00000] in <122cdbb72f9747f781e51b10f77175d4>:0
    17.    --- End of inner exception stack trace ---
    18.   at Burst.Compiler.IL.NativeCompilerOptions..ctor (Burst.Backend.TargetCpu target, System.UInt32 optLevel) [0x0007b] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    19.   at Burst.Compiler.IL.Aot.AotCompilerOptions..ctor (Burst.Backend.TargetCpu target, System.UInt32 optLevel) [0x00007] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    20.   at Burst.Compiler.IL.Aot.AotCompilerOptions..ctor (Burst.Backend.TargetCpu target) [0x00000] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    21.   at Burst.Compiler.IL.Aot.AotCompilerOptions..ctor () [0x00000] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    22.   at Burst.Bcl.BclOptions..ctor () [0x00024] in <c60ef2a4ff2641f19147feca944da0c0>:0
    23.   at Burst.Bcl.Program.Main (System.String[] args) [0x00012] in <c60ef2a4ff2641f19147feca944da0c0>:0
    24. [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Burst.Backend.UnmanagedLibrary' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /Applications/Unity/Hub/Editor/2022.1.0b3/Unity.app/Contents/MonoBleedingEdge/lib/../lib/libmono-native.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
    25.   at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
    26.   at Interop+Sys..cctor () [0x00000] in <3cc0041a7bf849d5a824197f18576c2b>:0
    27.    --- End of inner exception stack trace ---
    28.   at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <3cc0041a7bf849d5a824197f18576c2b>:0
    29.   at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <3cc0041a7bf849d5a824197f18576c2b>:0
    30.   at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <3cc0041a7bf849d5a824197f18576c2b>:0
    31.   at System.IO.Directory.Exists (System.String path) [0x0001e] in <3cc0041a7bf849d5a824197f18576c2b>:0
    32.   at Burst.Backend.UnmanagedLibrary.GetUnmanagedLibraryHandler () [0x00015] in <122cdbb72f9747f781e51b10f77175d4>:0
    33.   at Burst.Backend.UnmanagedLibrary..cctor () [0x00000] in <122cdbb72f9747f781e51b10f77175d4>:0
    34.    --- End of inner exception stack trace ---
    35.   at Burst.Compiler.IL.NativeCompilerOptions..ctor (Burst.Backend.TargetCpu target, System.UInt32 optLevel) [0x0007b] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    36.   at Burst.Compiler.IL.Aot.AotCompilerOptions..ctor (Burst.Backend.TargetCpu target, System.UInt32 optLevel) [0x00007] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    37.   at Burst.Compiler.IL.Aot.AotCompilerOptions..ctor (Burst.Backend.TargetCpu target) [0x00000] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    38.   at Burst.Compiler.IL.Aot.AotCompilerOptions..ctor () [0x00000] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    39.   at Burst.Bcl.BclOptions..ctor () [0x00024] in <c60ef2a4ff2641f19147feca944da0c0>:0
    40.   at Burst.Bcl.Program.Main (System.String[] args) [0x00012] in <c60ef2a4ff2641f19147feca944da0c0>:0
    41.  
    42. Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.6.4/Editor/BurstAotCompiler.cs:1451)
    43. Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.6.4/Editor/BurstAotCompiler.cs:1316)
    44. Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunManagedProgram (System.String exe, System.String args, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.6.4/Editor/BurstAotCompiler.cs:1291)
    45. Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLsImpl (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.6.4/Editor/BurstAotCompiler.cs:548)
    46. Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.6.4/Editor/BurstAotCompiler.cs:208)
    47. UnityEditor.Build.BuildPipelineInterfaces.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:541)
    48. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
    49.  

    posted in beta forum (previous versions, but same issue):
    https://forum.unity.com/threads/build-issue.1216383/#post-7782606
     
  2. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    This looks to be an Apple macOS M1 specific issue - we've alerted the relevant teams here at Unity to this and your other forum thread. Hopefully they'll respond before too long with an update!
     
    antonkudin likes this.
  3. ifightnoman

    ifightnoman

    Joined:
    Jan 15, 2022
    Posts:
    13
    Different flavor but same root problem. Major blocker!

    System.TypeInitializationException: The type initializer for 'System.Random' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /Applications/Unity/Hub/Editor/2022.1.0b3/Unity.app/Contents/MonoBleedingEdge/lib/../lib/libmono-native.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
    at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
    at Interop+Sys..cctor () [0x00000] in <3cc0041a7bf849d5a824197f18576c2b>:0
     
  4. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    191
    Same on b4.2571
     
  5. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    191
    Same on beta5 ... could you link the other thread @sheredom here please ? I couldn't find it.
     
  6. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
  7. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    191
  8. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    I'm asking around for a precise ETA on this one and I'll report back once I know more!
     
    onefoxstudio likes this.
  9. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    Ok I can confirm that there are people here currently looking at this issue, once I know more I'll let you know.
     
    onefoxstudio likes this.
  10. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    191
    Thank you !
     
  11. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    Update - there is a fix in flight for this, as soon as I know when and where it'll appear in Unity versions I'll update you.
     
  12. Edwios

    Edwios

    Joined:
    Nov 27, 2018
    Posts:
    4
    Exact same error on 2022.1.0b6.2664
     
  13. hoanganhtran1010

    hoanganhtran1010

    Joined:
    Nov 25, 2021
    Posts:
    7
    Hi, is there any update on this issue?
     
  14. Alex-Thibodeau

    Alex-Thibodeau

    Unity Technologies

    Joined:
    Apr 18, 2013
    Posts:
    27