focus-creative-games / hybridclr_unity

Unity package for HybridCLR
https://code-philosophy.com/
MIT License
753 stars 131 forks source link

CleanIl2CppBuildCache 被多线程调用,导致报错 #21

Closed AlanLiu90 closed 1 year ago

AlanLiu90 commented 1 year ago

执行Generate -> MethodBridge时,有概率出现下面的报错:

== output:E:\xxx\yyy\Client/HybridCLRData/LocalIl2CppData-WindowsEditor/il2cpp/libil2cpp/hybridclr/generated/MethodBridge_Arm64.cpp ==

== output:E:\xxx\yyy\Client/HybridCLRData/LocalIl2CppData-WindowsEditor/il2cpp/libil2cpp/hybridclr/generated/MethodBridge_Universal64.cpp ==

DirectoryNotFoundException: Could not find a part of the path 'E:\xxx\yyy\Client\Library\Il2cppBuildCache\Windows\x64\il2cppOutput\Data'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource].CommonInit () (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler`1[TSource] resultHandler, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.InternalGetDirectories (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.GetDirectories (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.RecursiveDelete (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.RecursiveDelete (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.RecursiveDelete (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.RecursiveDelete (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.RecursiveDelete (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.Delete (System.String path, System.Boolean recursive) (at <695d1cc93cca45069c528c15c9fdd749>:0)
HybridCLR.Editor.Commands.MethodBridgeGeneratorCommand.CleanIl2CppBuildCache () (at Library/PackageCache/com.focus-creative-games.hybridclr_unity@eee3dbaa69/Editor/Commands/MethodBridgeGeneratorCommand.cs:28)
HybridCLR.Editor.Commands.MethodBridgeGeneratorCommand.GenerateMethodBridgeCppFile (HybridCLR.Editor.MethodBridge.Analyzer analyzer, HybridCLR.Editor.ABI.PlatformABI platform, System.String templateCode, System.String outputFile) (at Library/PackageCache/com.focus-creative-games.hybridclr_unity@eee3dbaa69/Editor/Commands/MethodBridgeGeneratorCommand.cs:45)
HybridCLR.Editor.Commands.MethodBridgeGeneratorCommand+<>c__DisplayClass3_2.<GenerateMethodBridge>b__0 () (at Library/PackageCache/com.focus-creative-games.hybridclr_unity@eee3dbaa69/Editor/Commands/MethodBridgeGeneratorCommand.cs:80)
System.Threading.Tasks.Task.InnerInvoke () (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Threading.Tasks.Task.Execute () (at <695d1cc93cca45069c528c15c9fdd749>:0)
Rethrow as AggregateException: One or more errors occurred.
System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks, System.Int32 millisecondsTimeout) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks) (at <695d1cc93cca45069c528c15c9fdd749>:0)
HybridCLR.Editor.Commands.MethodBridgeGeneratorCommand.GenerateMethodBridge (System.Boolean compileDll) (at Library/PackageCache/com.focus-creative-games.hybridclr_unity@eee3dbaa69/Editor/Commands/MethodBridgeGeneratorCommand.cs:83)
HybridCLR.Editor.Commands.MethodBridgeGeneratorCommand.GenerateMethodBridge () (at Library/PackageCache/com.focus-creative-games.hybridclr_unity@eee3dbaa69/Editor/Commands/MethodBridgeGeneratorCommand.cs:51)
pirunxi commented 1 year ago

已修复。非常感谢!!!