Search Unity

Bug ScriptableBuildPipeline - BuildCache type load error fails the build

Discussion in 'Asset Bundles' started by OndrejP, Aug 9, 2021.

  1. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    169
    When some type changes and becomes unavailable in subsequent build, BuildCache has a problems with that and throws exceptions, which causes build to fail several steps later.

    In this case whole assembly has gone missing, I've created asmdef file for all scripts, so Assembly-CSharp.dll is no longer there.

    @Ryanc_unity
    I'd expect it would simply consider cache entry a miss and continue.

    Code (CSharp):
    1. InvalidDataException: Could not create Type for 'Slideshow, Assembly-CSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
    2.   at UnityEditor.Build.Pipeline.Utilities.USerialize.DeSerializer.ReadObject (System.Int32 depth) [0x005a9] in C:\Data\Projects\Volcanoids\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.1\Editor\Utilities\USerialize\DeSerializer.cs:447
    3.   at UnityEditor.Build.Pipeline.Utilities.USerialize.DeSerializer.ReadObject (System.Int32 depth) [0x006aa] in C:\Data\Projects\Volcanoids\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.1\Editor\Utilities\USerialize\DeSerializer.cs:468
    4.   at UnityEditor.Build.Pipeline.Utilities.USerialize.DeSerializer.DeSerialize[ClassType] (System.IO.Stream stream) [0x0006e] in C:\Data\Projects\Volcanoids\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.1\Editor\Utilities\USerialize\DeSerializer.cs:154
    5.   at UnityEditor.Build.Pipeline.Utilities.BuildCache+<>c__DisplayClass28_1.<LoadCachedData>b__0 (System.Int32 index) [0x0005d] in C:\Data\Projects\Volcanoids\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.1\Editor\Utilities\BuildCache.cs:368
    6. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    7. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    8. UnityEngine.Logger:LogException(Exception, Object)
    9. UnityEngine.Debug:LogException(Exception)
    10. UnityEditor.Build.Pipeline.Utilities.BuildLogger:LogException(Exception) (at C:\Data\Projects\Volcanoids\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.1\Editor\Utilities\BuildLogger.cs:134)
    11. UnityEditor.Build.Pipeline.Utilities.<>c__DisplayClass28_1:<LoadCachedData>b__0(Int32) (at C:\Data\Projects\Volcanoids\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.1\Editor\Utilities\BuildCache.cs:378)
    12. System.Threading.Tasks.<>c__DisplayClass17_0`1:<ForWorker>b__1()
    13. System.Threading.Tasks.Task:InnerInvoke()
    14. System.Threading.Tasks.Task:InnerInvokeWithArg(Task)
    15. System.Threading.Tasks.<>c__DisplayClass178_0:<ExecuteSelfReplicating>b__0(Object)
    16. System.Threading.Tasks.Task:InnerInvoke()
    17. System.Threading.Tasks.Task:Execute()
    18. System.Threading.Tasks.Task:ExecutionContextCallback(Object)
    19. System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    20. System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
    21. System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
    22. System.Threading.Tasks.Task:ExecuteEntry(Boolean)
    23. System.Threading.Tasks.Task:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    24. System.Threading.ThreadPoolWorkQueue:Dispatch()
    25. System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
    26.  
    27. (Filename: C:/Data/Projects/Volcanoids/Library/PackageCache/com.unity.scriptablebuildpipeline@1.19.1/Editor/Utilities/USerialize/DeSerializer.cs Line: 447)
    28.  
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    324
    Already ahead of you, this exact issue will be fixed in 1.19.2
    Additionally to this point:
    > I'd expect it would simply consider cache entry a miss and continue.
    We agree and working on changes to ensure this is true, probably won't make 1.19.2, so probably the version after.
     
  3. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    169
    nice, thanks! :)
     
unityunity