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.

Official IL2CPP Build Time Improvements - Seeking Feedback

Discussion in '2021.2 Beta' started by joncham, Feb 24, 2021.

  1. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Last edited by a moderator: Sep 21, 2021
  2. Sponge2k

    Sponge2k

    Joined:
    Sep 22, 2021
    Posts:
    5
    A month ago I already started to have issues with Post-Processing and WebGL in 2021.2.x. Building works fine, but running it the browser gave a large exception error (indirect call signature mismatch).

    Today I dedicated to spend some time to finally figure out what the problem is by creating a new empty WebGL project and compare settings. I just discovered the setting "Faster (smaller) builds" breaks Post processing. You can even try it directly in the sample scene. It took quite some builds to figure out it was not a quality setting related.

    The good thing is that I finally got my forums account to work somehow, after experiencing more than a year a "username collision". Too bad the post history is gone however.
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Can you submit a bug report for this issue? That will help us understand it and track down the cause. Thanks!
     
  4. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    801
    @JoshPeterson might be the same issue - URP + Post processing breaks with "Faster (smaller) builds" with the exception being

    Code (CSharp):
    1. ========== OUTPUTTING STACK TRACE ==================
    2. WinPlayerBuildProgram\il2cppOutput\cpp\Generics.cpp:22985] ChangeEvent_1_get_previousValue_m979236E4E4139798B9B844A25577D791362D3078_gshared
    3. WinPlayerBuildProgram\il2cppOutput\cpp\Unity.RenderPipelines.Universal.Runtime3.cpp:29215] DepthOfField_IsActive_mAEEBA8A02BC313AA621C4C197CF4A8A0A7352C0E
    4. WinPlayerBuildProgram\il2cppOutput\cpp\Unity.RenderPipelines.Universal.Runtime4.cpp:33903] UniversalRenderPipeline_InitializeAdditionalCameraData_m6B27DC20D133F987A9E456F8005192D8316AD042
    5. WinPlayerBuildProgram\il2cppOutput\cpp\Unity.RenderPipelines.Universal.Runtime4.cpp:32767] UniversalRenderPipeline_InitializeCameraData_m524AC404A39354F0F854F5D6D16309CBB4A18A1D
    6. WinPlayerBuildProgram\il2cppOutput\cpp\Unity.RenderPipelines.Universal.Runtime4.cpp:32033] UniversalRenderPipeline_RenderCameraStack_mA6414421FB6C8AB0021F37D7928A45DC426D6CAC
    7. WinPlayerBuildProgram\il2cppOutput\cpp\Unity.RenderPipelines.Universal.Runtime4.cpp:30822] UniversalRenderPipeline_Render_m15A42AB44C14AB4DCA7EF0B915964D46B643D50E
    8. WinPlayerBuildProgram\il2cppOutput\cpp\UnityEngine.CoreModule3.cpp:11518] RenderPipelineManager_DoRenderLoop_Internal_m7FB9F81FF54E716454A4888990CE46220DBAD6CC
    9. D:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\vm\Runtime.cpp:576] il2cpp::vm::Runtime::InvokeWithThrow
    10. D:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\vm\Runtime.cpp:561] il2cpp::vm::Runtime::Invoke
    Reported as (Case 1371709) [IL2CPP] Immediate crash in build with URP postprocessing enabled
     
    Last edited: Oct 11, 2021
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Thanks, we will investigate this.
     
  6. Barkers-Crest

    Barkers-Crest

    Joined:
    Jun 19, 2013
    Posts:
    158
    Case 1372106. Faster (smaller) builds failing on Nintendo Switch.

    Code (CSharp):
    1. Unity.IL2CPP.Building.BuilderFailedException: Build failed with 0 successful nodes and 1 failed ones
    2. Annotation: IL2CPP_CodeGenAndCompile C:/TFS/GolfUnity/Project/Golf/SwitchIL2CPPCache/il2cpp_cache/buildstate/artifacts/il2cpp_conv_4rda.traceevents
    3. Cmdline: "C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\build\deploy\il2cpp.exe" --convert-to-cpp --compile-cpp --directory="C:/TFS/GolfUnity/Project/Golf/Temp/StagingArea/Managed" --data-folder="C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\Data" --generatedcppdir="C:/TFS/GolfUnity/Project/Golf/Library/Il2cppBuildCache/Switch/il2cppOutput" --symbols-folder="C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\Symbols" --additional-cpp="C:\TFS\GolfUnity\Project\Golf\Temp\StagingArea\SourcePlugins\lib_burst_generated.cpp" --additional-cpp="C:/TFS/GolfUnity/Project/Golf/Library/Il2cppBuildCache/Switch/additionalCppFiles/UnlinkedFunctions.cpp" --emit-null-checks --enable-stacktrace --enable-stats --enable-array-bounds-check --code-generation-option=EnableInlining --generics-option=None,EnableFullSharing --stats-output-dir="C:/TFS/GolfUnity/Project/Golf/Assets/../SwitchIL2CPPStats" --platform=Switch --architecture=ARM64 --outputpath="C:\TFS\GolfUnity\Project\Golf\Library/Il2cppBuildCache/Switch\Native\SwitchPlayer.nss" --dont-deploy-baselib --verbose --libil2cpp-static --baselib-directory="C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\PlaybackEngines\Switch\Native\develop" --avoid-dynamic-library-copy --additional-defines=DEBUGMODE=1 --additional-defines=UNITY_RELEASE=0 --additional-defines=IL2CPP_USE_SOCKET_MULTIPLEX_IO=1 --additional-include-directories="C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\PlaybackEngines\Switch\Tools/il2cpp\bdwgc/include" --additional-include-directories="C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\PlaybackEngines\Switch\Tools/il2cpp\libil2cpp/include" --plugin="C:/Program Files/Unity/Hub/Editor/2021.2.0b14/Editor/Data/PlaybackEngines/Switch/Tools\SwitchIl2CppPlugin.dll" --incremental-g-c-time-slice=3 --configuration=Release --linker-flags-file="C:/TFS/GolfUnity/Project/Golf/SwitchIL2CPPCache/il2cpp_cache/linkerflags/linkerflags.txt" --dotnetprofile=unityaot-linux --cachedirectory="C:/TFS/GolfUnity/Project/Golf/Assets/../SwitchIL2CPPCache/il2cpp_cache" --profiler-report --profiler-output-file="C:/TFS/GolfUnity/Project/Golf/SwitchIL2CPPCache/il2cpp_cache/buildstate/artifacts/il2cpp_conv_4rda.traceevents"
    4. ExitCode: 1
    5. Stdout:
    6. Building SwitchPlayer.nss with SwitchToolChain
    7.     Output directory: C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\Native
    8.     Cache directory: C:\TFS\GolfUnity\Project\Golf\SwitchIL2CPPCache\il2cpp_cache
    9. Error: Unity.IL2CPP.Building.BuilderFailedException: In file included from C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp:1:
    10. In file included from C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\pch\pch-cpp.hpp:6:
    11. In file included from C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen.h:10:
    12. In file included from C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-il2cpp.h:4:
    13. C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-common-big.h(295,9): warning: field 'm_seqPointStorage' will be initialized after field 'm_seqPoint' [-Wreorder-ctor]
    14.         m_seqPointStorage(seqPointStorage), m_seqPoint(seqPoint)
    15.         ^
    16. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(4564,3): warning: declaration does not declare anything [-Wmissing-declarations]
    17.                 struct
    18.                 ^
    19. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(4582,3): warning: declaration does not declare anything [-Wmissing-declarations]
    20.                 struct
    21.                 ^
    22. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(5281,3): warning: declaration does not declare anything [-Wmissing-declarations]
    23.                 struct
    24.                 ^
    25. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(5690,3): warning: declaration does not declare anything [-Wmissing-declarations]
    26.                 struct
    27.                 ^
    28. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(15549,1): warning: unused label 'FINALLY_003a' [-Wunused-label]
    29. FINALLY_003a:
    30. ^~~~~~~~~~~~~
    31. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(15780,1): warning: unused label 'FINALLY_006e' [-Wunused-label]
    32. FINALLY_006e:
    33. ^~~~~~~~~~~~~
    34. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(16478,1): warning: unused label 'FINALLY_0025' [-Wunused-label]
    35. FINALLY_0025:
    36. ^~~~~~~~~~~~~
    37. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(19318,1): warning: unused label 'FINALLY_012c' [-Wunused-label]
    38. FINALLY_012c:
    39. ^~~~~~~~~~~~~
    40. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(19368,1): warning: unused label 'FINALLY_010f_1' [-Wunused-label]
    41. FINALLY_010f_1:
    42. ^~~~~~~~~~~~~~~
    43. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(21278,1): warning: unused label 'FINALLY_0421' [-Wunused-label]
    44. FINALLY_0421:
    45. ^~~~~~~~~~~~~
    46. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(21981,1): warning: unused label 'FINALLY_0421' [-Wunused-label]
    47. FINALLY_0421:
    48. ^~~~~~~~~~~~~
    49. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(27514,1): warning: unused label 'FINALLY_003a' [-Wunused-label]
    50. FINALLY_003a:
    51. ^~~~~~~~~~~~~
    52. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(27797,1): warning: unused label 'FINALLY_003a' [-Wunused-label]
    53. FINALLY_003a:
    54. ^~~~~~~~~~~~~
    55. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(28949,3): error: no matching function for call to 'il2cpp_codegen_memcpy'
    56.                 il2cpp_codegen_memcpy(L_6, ((uintptr_t)(&V_0)), SizeOf_TEnum_tF110FEC5C6A5B037E988D84AF18BD7D476E5DAB5);
    57.                 ^~~~~~~~~~~~~~~~~~~~~
    58. C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-common-big.h(242,14): note: candidate function not viable: no known conversion from 'uintptr_t' (aka 'unsigned long') to 'const void *' for 2nd argument
    59. inline void* il2cpp_codegen_memcpy(void* dest, const void* src, size_t count)
    60.              ^
    61. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(28963,3): error: no matching function for call to 'il2cpp_codegen_memcpy'
    62.                 il2cpp_codegen_memcpy(L_9, ((uintptr_t)(&V_1)), SizeOf_TEnum_tF110FEC5C6A5B037E988D84AF18BD7D476E5DAB5);
    63.                 ^~~~~~~~~~~~~~~~~~~~~
    64. C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-common-big.h(242,14): note: candidate function not viable: no known conversion from 'uintptr_t' (aka 'unsigned long') to 'const void *' for 2nd argument
    65. inline void* il2cpp_codegen_memcpy(void* dest, const void* src, size_t count)
    66.              ^
    67. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(28977,3): error: no matching function for call to 'il2cpp_codegen_memcpy'
    68.                 il2cpp_codegen_memcpy(L_12, ((uintptr_t)(&V_2)), SizeOf_TEnum_tF110FEC5C6A5B037E988D84AF18BD7D476E5DAB5);
    69.                 ^~~~~~~~~~~~~~~~~~~~~
    70. C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-common-big.h(242,14): note: candidate function not viable: no known conversion from 'uintptr_t' (aka 'unsigned long') to 'const void *' for 2nd argument
    71. inline void* il2cpp_codegen_memcpy(void* dest, const void* src, size_t count)
    72.              ^
    73. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(28991,3): error: no matching function for call to 'il2cpp_codegen_memcpy'
    74.                 il2cpp_codegen_memcpy(L_15, ((uintptr_t)(&V_3)), SizeOf_TEnum_tF110FEC5C6A5B037E988D84AF18BD7D476E5DAB5);
    75.                 ^~~~~~~~~~~~~~~~~~~~~
    76. C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-common-big.h(242,14): note: candidate function not viable: no known conversion from 'uintptr_t' (aka 'unsigned long') to 'const void *' for 2nd argument
    77. inline void* il2cpp_codegen_memcpy(void* dest, const void* src, size_t count)
    78.              ^
    79. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(29223,1): warning: unused label 'FINALLY_005a' [-Wunused-label]
    80. FINALLY_005a:
    81. ^~~~~~~~~~~~~
    82. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(30481,1): warning: unused label 'FINALLY_0033' [-Wunused-label]
    83. FINALLY_0033:
    84. ^~~~~~~~~~~~~
    85. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(30578,1): warning: unused label 'FINALLY_0028' [-Wunused-label]
    86. FINALLY_0028:
    87. ^~~~~~~~~~~~~
    88. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(30792,1): warning: unused label 'FINALLY_0040' [-Wunused-label]
    89. FINALLY_0040:
    90. ^~~~~~~~~~~~~
    91. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(30974,1): warning: unused label 'FINALLY_002d' [-Wunused-label]
    92. FINALLY_002d:
    93. ^~~~~~~~~~~~~
    94. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(31832,1): warning: unused label 'FINALLY_0043' [-Wunused-label]
    95. FINALLY_0043:
    96. ^~~~~~~~~~~~~
    97. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(32525,1): warning: unused label 'FINALLY_0063' [-Wunused-label]
    98. FINALLY_0063:
    99. ^~~~~~~~~~~~~
    100. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(32827,1): warning: unused label 'FINALLY_003c' [-Wunused-label]
    101. FINALLY_003c:
    102. ^~~~~~~~~~~~~
    103. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(32913,1): warning: unused label 'FINALLY_00bb' [-Wunused-label]
    104. FINALLY_00bb:
    105. ^~~~~~~~~~~~~
    106. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(33182,1): warning: unused label 'FINALLY_00d6' [-Wunused-label]
    107. FINALLY_00d6:
    108. ^~~~~~~~~~~~~
    109. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(33396,1): warning: unused label 'FINALLY_01c9' [-Wunused-label]
    110. FINALLY_01c9:
    111. ^~~~~~~~~~~~~
    112. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(33820,1): warning: unused label 'FINALLY_0043' [-Wunused-label]
    113. FINALLY_0043:
    114. ^~~~~~~~~~~~~
    115. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(33938,1): warning: unused label 'FINALLY_001e' [-Wunused-label]
    116. FINALLY_001e:
    117. ^~~~~~~~~~~~~
    118. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(34039,1): warning: unused label 'FINALLY_0043' [-Wunused-label]
    119. FINALLY_0043:
    120. ^~~~~~~~~~~~~
    121. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(34363,1): warning: unused label 'FINALLY_003d' [-Wunused-label]
    122. FINALLY_003d:
    123. ^~~~~~~~~~~~~
    124. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(34446,1): warning: unused label 'FINALLY_006f' [-Wunused-label]
    125. FINALLY_006f:
    126. ^~~~~~~~~~~~~
    127. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(34624,1): warning: unused label 'FINALLY_005d' [-Wunused-label]
    128. FINALLY_005d:
    129. ^~~~~~~~~~~~~
    130. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(34746,1): warning: unused label 'FINALLY_0045' [-Wunused-label]
    131. FINALLY_0045:
    132. ^~~~~~~~~~~~~
    133. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(35655,1): warning: unused label 'FINALLY_0061' [-Wunused-label]
    134. FINALLY_0061:
    135. ^~~~~~~~~~~~~
    136. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(35803,1): warning: unused label 'FINALLY_0061' [-Wunused-label]
    137. FINALLY_0061:
    138. ^~~~~~~~~~~~~
    139. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(36024,1): warning: unused label 'FINALLY_006c' [-Wunused-label]
    140. FINALLY_006c:
    141. ^~~~~~~~~~~~~
    142. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(36176,1): warning: unused label 'FINALLY_0061' [-Wunused-label]
    143. FINALLY_0061:
    144. ^~~~~~~~~~~~~
    145. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(36556,1): warning: unused label 'FINALLY_00ae' [-Wunused-label]
    146. FINALLY_00ae:
    147. ^~~~~~~~~~~~~
    148. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(36680,1): warning: unused label 'FINALLY_003d' [-Wunused-label]
    149. FINALLY_003d:
    150. ^~~~~~~~~~~~~
    151. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(36958,1): warning: unused label 'FINALLY_005b' [-Wunused-label]
    152. FINALLY_005b:
    153. ^~~~~~~~~~~~~
    154. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(37116,1): warning: unused label 'FINALLY_0059' [-Wunused-label]
    155. FINALLY_0059:
    156. ^~~~~~~~~~~~~
    157. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(37312,1): warning: unused label 'FINALLY_006c' [-Wunused-label]
    158. FINALLY_006c:
    159. ^~~~~~~~~~~~~
    160. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(37558,1): warning: unused label 'FINALLY_00b7' [-Wunused-label]
    161. FINALLY_00b7:
    162. ^~~~~~~~~~~~~
    163. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(37969,1): warning: unused label 'FINALLY_0027' [-Wunused-label]
    164. FINALLY_0027:
    165. ^~~~~~~~~~~~~
    166. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(38175,1): warning: unused label 'FINALLY_00b3' [-Wunused-label]
    167. FINALLY_00b3:
    168. ^~~~~~~~~~~~~
    169. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(38528,1): warning: unused label 'FINALLY_00b3' [-Wunused-label]
    170. FINALLY_00b3:
    171. ^~~~~~~~~~~~~
    172. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(39941,1): warning: unused label 'FINALLY_0042' [-Wunused-label]
    173. FINALLY_0042:
    174. ^~~~~~~~~~~~~
    175. C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp(40332,1): warning: unused label 'FINALLY_004b' [-Wunused-label]
    176. FINALLY_004b:
    177. ^~~~~~~~~~~~~
    178. In file included from C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\GenericMethods.cpp:1:
    179. In file included from C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\pch\pch-cpp.hpp:6:
    180. In file included from C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen.h:10:
    181. In file included from C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-il2cpp.h:4:
    182. C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-common-big.h(290,26): warning: private field 'm_seqPoint' is not used [-Wunused-private-field]
    183.     Il2CppSequencePoint* m_seqPoint;
    184.                          ^
    185. C:\Program Files\Unity\Hub\Editor\2021.2.0b14\Editor\Data\il2cpp\libil2cpp\codegen/il2cpp-codegen-common-big.h(291,42): warning: private field 'm_seqPointStorage' is not used [-Wunused-private-field]
    186.     Il2CppSequencePointExecutionContext* m_seqPointStorage;
    187.                                          ^
    188. In file included from C:\TFS\GolfUnity\Project\Golf\Library\Il2cppBuildCache\Switch\il2cppOutput\<message truncated>
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Thanks for the details - we will investigate this.
     
    Barkers-Crest likes this.
  8. Somnesis

    Somnesis

    Joined:
    Feb 27, 2020
    Posts:
    22
    Hi

    All our builds are scripted. How does one use the "faster builds" option with
    BuildPipeline.BuildPlayer()
    ?

    Thanks
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    You should be able to use
    Code (CSharp):
    1. EditorUserBuildSettings.il2CppCodeGeneration
    to set this value. In Unity 2022.1 and later, this option has moved to the Player Settings, so it is available via
    Code (CSharp):
    1. PlayerSettings.SetIl2CppCodeGeneration
    .
     
    Somnesis likes this.
  10. Somnesis

    Somnesis

    Joined:
    Feb 27, 2020
    Posts:
    22
    Thanks!

    Since this is a setting, I guess whatever it's set to in the GUI will be used by BuildPipeline.BuildPlayer() ?

    Also, for PlayerSettings.SetIl2CppCodeGeneration, what does each option mean? I'm guessing:
    • Il2CppCompilerConfiguration.Debug = Faster builds
    • Il2CppCompilerConfiguration.Release = Faster runtime
    • Il2CppCompilerConfiguration.Master = Some setting not exposed in the GUI?
    Is that correct?
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    No, the Il2CppCompilerConfiguration option is completely separate from the SetIl2CppCodeGeneration option.

    The Il2CppCompilerConfiguration indicates the build options that should be provided to the C++ compiler and linker when generated code is compiled.

    The SetIl2CppCodeGeneration indicates to the IL2CPP code conversion utility how it should generate that C++ code.
     
    lanpartygamesstudio likes this.
  12. unity_IpxdANggCs1roQ

    unity_IpxdANggCs1roQ

    Joined:
    Feb 19, 2018
    Posts:
    43
    Code (CSharp):
    1. C:\Program Files\Unity\Hub\Editor\2021.2.5f1\Editor\Data\il2cpp\build\deploy\il2cpp.exe --convert-to-cpp --assembly=Library/Bee/artifacts/Android/ManagedStripped/Animancer.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Animancer.Examples.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Animancer.FSM.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Assembly-CSharp.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Cinemachine.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/clipper_library.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/MohuXtensions.Runtime.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Mono.Security.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/mscorlib.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.Configuration.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.Core.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.Xml.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UniTask.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.Burst.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.Burst.Unsafe.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.InputSystem.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.Mathematics.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.RenderPipeline.Universal.ShaderLibrary.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.RenderPipelines.Core.Runtime.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.RenderPipelines.Universal.Runtime.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.TextMeshPro.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.Timeline.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.AndroidJNIModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.AnimationModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.AssetBundleModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.AudioModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.CoreModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.DirectorModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.GridModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.IMGUIModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.InputLegacyModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.InputModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.JSONSerializeModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.ParticleSystemModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.Physics2DModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.PhysicsModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.SharedInternalsModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.SpriteShapeModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.SubsystemsModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TerrainModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TextCoreFontEngineModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TextCoreTextEngineModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TextRenderingModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TilemapModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UI.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UIElementsModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UIElementsNativeModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UIModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UnityWebRequestModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.VRModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.XRModule.dll --data-folder=D:/ProjectBQ/Damepoyo/Library/Bee/artifacts/Android/il2cppOutput/data --generatedcppdir=D:/ProjectBQ/Damepoyo/Library/Bee/artifacts/Android/il2cppOutput/cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile=unityaot-linux --profiler-report --profiler-output-file=D:/ProjectBQ/Damepoyo/Library/Bee/artifacts/il2cpp_conv_vowj.traceevents --print-command-line
    2. Error: IL2CPP error for type 'System.ValueTuple`2' in assembly 'D:\ProjectBQ\Damepoyo\Library\Bee\artifacts\Android\ManagedStripped\mscorlib.dll'
    3. System.InvalidOperationException: Attempted to lookup type that hasn't been created. FieldKey: System.ValueTuple`2<System.Object,System.Collections.Generic.IEnumerable`1<System.Object>>.Item1
    4.   at Unity.IL2CPP.DataModel.BuildLogic.Repositories.ReadonlyMemberStorageStrategy.ThrowFailedLookup[TKey](TKey elementType)
    5.   at Unity.IL2CPP.DataModel.BuildLogic.Repositories.ReadonlyMemberStorageStrategy.GetOrAdd[TKey,TDataModel](Dictionary`2 mapping, TKey elementType, IMemberStoreCreateCallbacks`2 callbacks)
    6.   at Unity.IL2CPP.DataModel.Creation.FullyConstructedTypeFactory.CreateFieldReference(TypeReference declaringType, FieldReference fieldReference)
    7.   at Unity.IL2CPP.TypeDefinitionWriter.MakeFieldWriteInstructionsForType(ReadOnlyContext context, TypeReference type, TypeDefinition typeDefinition, FieldType fieldType)
    8.   at Unity.IL2CPP.TypeDefinitionWriter.WriteFieldsWithAccessors(ReadOnlyContext context, IReadOnlyContextGeneratedCodeWriter writer, TypeReference type, Boolean isUnmanagedType, FieldType fieldType)
    9.   at Unity.IL2CPP.TypeDefinitionWriter.WriteTypeDefinitionFor(ReadOnlyContext context, TypeReference type, IReadOnlyContextGeneratedCodeWriter writer, TypeReference[]& typesRequiringInteropGuids)
    10.   at Unity.IL2CPP.CppDeclarations.CppDeclarationDataModelInitializers.BuildCacheData(ReadOnlyContext context, TypeReference type)
    11.   at Unity.IL2CPP.DataModel.TypeReference.Unity.IL2CPP.DataModel.InjectedInitialize.ITypeReferenceInjectedInitialize.GetCppDeclarationsData[TContext](TContext context, Func`3 initialize)
    12.   at Unity.IL2CPP.CppDeclarations.CppDeclarationDataModelInitializers.GetCppDeclarations(ReadOnlyContext context, ITypeReferenceInjectedInitialize type)
    13.   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
    14.   at Unity.IL2CPP.CppDeclarations.CppDeclarationsWriter.CollectDeclarations(SourceWritingContext context, ICppDeclarations declarationsIn, CppDeclarations& declarations)
    15.   at Unity.IL2CPP.CppDeclarations.CppDeclarationsWriter.Write(SourceWritingContext context, ICodeStream writer, ICppDeclarations declarationsIn, Boolean addInteropGuids)
    16.   at Unity.IL2CPP.CodeWriters.GeneratedCodeSourceCodeWriter.Dispose()
    17.   at Unity.IL2CPP.TableWriters.ScheduledTableWriterBaseChunkedTransform`3.PostProcessWorker(WorkItemData`3 data)
    18.   at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.WorkerLoop(Object data)
    An error has occurred regarding the ValueTuple (2021.2.5f1).
    It seems that similar bugs related to ValueTuple have already been fixed, but I believe that this problem is caused by a different reason.
    https://issuetracker.unity3d.com/is...when-unused-interface-has-specific-valuetuple
    I would like to identify which part of the code is causing the problem, so any hints would be appreciated.

    This project can be built without problems using MonoScriptingBackend.
     
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Unfortunately I cannot tell what might cause this error based on the error message. It might be worth submitting a new bug report for this issue so that we can investigate it.
     
    unity_IpxdANggCs1roQ likes this.
  14. unity_IpxdANggCs1roQ

    unity_IpxdANggCs1roQ

    Joined:
    Feb 19, 2018
    Posts:
    43
    When I changed all the multiple return values of ValueTuple to return by out parameters, the build passed.
    I also created a minimal bug report, but I could not reproduce this bug...
     
    JoshPeterson likes this.
  15. peturdarri

    peturdarri

    Joined:
    Mar 19, 2016
    Posts:
    22
    I had issues with builds suddenly failing during IL2CPP on 2020.3 and noticed the generated C++ code had reached over 9GB. After updating to 2021.2 and enabling Faster IL2CPP Code Generation, the generate code went down to around 500MB and I could build again.

    Build size didn't change as dramatically, about 8MB on an Android build. Didn't notice any significant improvement in build time, but that hasn't been an issue. Runtime performance hasn't dropped noticeably, but I haven't done any extensive comparison.

    All in all, I'm very happy with these improvements!

    I'm certain the reason the generated code got so inflated is because I have a lot of generic class and method instances for struct types, which I guess didn't share any code in IL2CPP until now.
     
    JoshPeterson likes this.
  16. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    613
    The build times in 2021.2.5 even with Faster (smaller) build is way longer than in 2021.1.12.
    It used to do for example in PS5 5 minutes and now it does 10. This is not good.
     
  17. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Can you find the profile.json file for both cases? That should let us compare the builds to understand the difference.
     
  18. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    89
    Hi,
    I'm using the `faster(smaller)builds` with the mirror-networking plugin, but it is stripping mirror networking weaver generated code out. Can we ignore this strpping? Like the link.xml file.
     
  19. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    9,996
    My iOS build went from 1,15GB -> 1,09GB and from 70 seconds -> 67 seconds build time, so roughly a ~5% improvement in size and build time.

    IMO this isn't worth even a 0.1% loss in performance, or even bothering to switch to it for debug builds.
     
    phobos2077 likes this.
  20. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    I don't believe that this option should impact code stripping at all. So if it is stripping something out incorrectly, there might be some unexpected interaction happening. Can you submit a bug report so that we can investigate this?

    https://unity3d.com/unity/qa/bug-reporting
     
  21. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Yes, I completely agree with that sentiment. The improvement in build size and time can vary per project, which is why we've left this as an option. For this project, it certainly does not seem to be worth using.
     
  22. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    89
    thank you for your reply. The case ID I reported is: 1388270.
     
    JoshPeterson likes this.
  23. streeter12

    streeter12

    Joined:
    Mar 28, 2015
    Posts:
    6
    Smaller build significant reduse build code size with redueced build time (10%). But we got exception on UNITY 2021.2.8:
    Code (CSharp):
    1. MethodAccessException: Attempt to access method 'System.Collections.Generic.IEnumerable<PokerCore.Model.Achievements.AchievementConfig>.GetEnumerator' on type 'System.Action' failed.
    on type is random it may be any class.
     
  24. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Can you provide more details about this is error? Did it occur during the build or at run time? Is there an associated stack trace?
     
  25. streeter12

    streeter12

    Joined:
    Mar 28, 2015
    Posts:
    6
    It is runtime error.
    It affect several generics with value struct type parameter.
    Full Stack:
    Code (CSharp):
    1. MethodAccessException: Attempt to access method 'System.Collections.Generic.IEnumerable<PokerCore.Model.Achievements.AchievementConfig>.GetEnumerator' on type 'System.Action' failed.
    2. System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) (at <00000000000000000000000000000000>:0)
    3. System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) (at <00000000000000000000000000000000>:0)
    4. System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <00000000000000000000000000000000>:0)
    5. Poker.GUI.Table.StatTabPagePresenter.CreateInternal () (at <00000000000000000000000000000000>:0)
    6. Poker.GUI.ConstructorHelper.Create (UnityEngine.GameObject gameObject, System.Func`2[T,TResult] continuationCondition) (at <00000000000000000000000000000000>:0)
    7. Poker.GUI.ZenjectObjectFactory.CreateObject (System.String resourceId, UnityEngine.Transform creationPoint) (at <00000000000000000000000000000000>:0)
    8. PokerCore.Infrastructure.GUISystem.Presenter.GUIFactory.GetObject (System.String id, UnityEngine.MonoBehaviour layer) (at <00000000000000000000000000000000>:0)
    9. PokerCore.Infrastructure.GUISystem.Presenter.GUIFactory.CreateInternal[TPresenter] (System.String id, UnityEngine.MonoBehaviour layer) (at <00000000000000000000000000000000>:0)
    10. PokerCore.Infrastructure.GUISystem.Presenter.GUIFactory.Create[TPresenter,TLayerType] (System.String id, PokerCore.Infrastructure.GUISystem.Layers.PresenterLayerAbstract`1[TPresenter] layer, System.Nullable`1[T] position) (at <00000000000000000000000000000000>:0)
    11. PokerCore.Infrastructure.GUISystem.Service.GUIService.CreateGUIInternal[TGUI,TLayerType] (System.String resorceId, PokerCore.Infrastructure.GUISystem.Layers.PresenterLayerAbstract`1[TPresenter] layer, System.Nullable`1[T] position, System.Threading.CancellationToken token) (at <00000000000000000000000000000000>:0)
    12. PokerCore.Infrastructure.GUISystem.Service.GUIService.Create[TGUI,TParams,TLayerType] (System.String resorceId, TParams parameters, PokerCore.Infrastructure.GUISystem.Layers.PresenterLayerAbstract`1[TPresenter] layer, System.Nullable`1[T] position, System.Threading.CancellationToken token) (at <00000000000000000000000000000000>:0)
    13. PokerCore.Infrastructure.GUISystem.Service.GUIService.Create[TGUI,TParams] (PokerCore.Infrastructure.GUISystem.Service.ViewDescription viewDescription, TParams parameters, System.Nullable`1[T] position, System.Threading.CancellationToken token) (at <00000000000000000000000000000000>:0)
    14.  
    15.  
    16. PokerCore.Infrastructure.Logging.GUIServiceLogDecorator.Create[TGUI,TParams] (PokerCore.Infrastructure.GUISystem.Service.ViewDescription viewDescription, TParams parameters, System.Nullable`1[T] position, System.Threading.CancellationToken token) (at <00000000000000000000000000000000>:0)
    17. Poker.GUI.Popups.PopupService.OpenPopup[TPopup,TParams] (System.String popupId, TParams parameters, System.Threading.CancellationToken token) (at <00000000000000000000000000000000>:0)
    18. Poker.Application.Analytics.PopupAnalyticsService.OpenPopup[TPopup,TParams] (System.String popupId, TParams parameters, System.Threading.CancellationToken token) (at <00000000000000000000000000000000>:0)
    19. Poker.GUI.Table.UserProfileGUIService.OpenUserProfile (System.String userId, System.Threading.CancellationToken token) (at <00000000000000000000000000000000>:0)
    20. CrazyPanda.UnityCore.PandaTasks.PandaTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    21. Poker.GUI.Table.UserProfileGUIService.OpenUserProfile (System.String userId, System.Threading.CancellationToken token) (at <00000000000000000000000000000000>:0)
    22. Poker.GUI.Lobby.UserProfilePresenter.HandleButtonClick () (at <00000000000000000000000000000000>:0)
    23. Poker.GUI.Instrumental.ButtonView.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <00000000000000000000000000000000>:0)
    24. UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <00000000000000000000000000000000>:0)
    25. Poker.GUI.Instrumental.MobileStandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) (at <00000000000000000000000000000000>:0)
    26. Poker.GUI.Instrumental.MobileStandaloneInputModule.ProcessTouchEvents () (at <00000000000000000000000000000000>:0)
    27. Poker.GUI.Instrumental.MobileStandaloneInputModule.Process () (at <00000000000000000000000000000000>:0)
    28. UnityEngine.EventSystems.EventSystem.Update () (at <00000000000000000000000000000000>:0)
    29. --- End of stack trace from previous location where exception was thrown ---
    30. CrazyPanda.UnityCore.PandaTasks.PandaTask.Fail (System.Action`1[T] errorHandler) (at <00000000000000000000000000000000>:0)
    31. Poker.GUI.Instrumental.ButtonView.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <00000000000000000000000000000000>:0)
    32. UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <00000000000000000000000000000000>:0)
    33. Poker.GUI.Instrumental.MobileStandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) (at <00000000000000000000000000000000>:0)
    34. Poker.GUI.Instrumental.MobileStandaloneInputModule.ProcessTouchEvents () (at <00000000000000000000000000000000>:0)
    35. Poker.GUI.Instrumental.MobileStandaloneInputModule.Process () (at <00000000000000000000000000000000>:0)
    36. UnityEngine.EventSystems.EventSystem.Update () (at <00000000000000000000000000000000>:0)
    37. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
    38. Poker.GUI.Instrumental.MobileStandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
    39. Poker.GUI.Instrumental.MobileStandaloneInputModule:ProcessTouchEvents()
    40. Poker.GUI.Instrumental.MobileStandaloneInputModule:Process()
    41. UnityEngine.EventSystems.EventSystem:Update()
    AcivmentConfig struct:
    Code (CSharp):
    1.  public readonly struct AchievementConfig
    2.     {
    3.         public readonly string Id;
    4.         public readonly int SortPriority;
    5.         public readonly int Notification;
    6.         public readonly List< AchievementLevel > Levels;
    7.  
    8.         public AchievementConfig( string id, List< AchievementLevel > levels, int sortPriority, int notification )
    9.         {
    10.             Id = id.ValidateId( nameof( id ) );
    11.             Levels = levels;
    12.             SortPriority = sortPriority;
    13.             Notification = notification;
    14.         }
    15.     }
    Fail code line:
    Code (CSharp):
    1.  _allAchievementConfigs = _configsService.GetConfig< AchievementsConfig >().GetAll().ToList();
     
  26. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Thanks, can you submit a bug report for this issue? This looks like a problem we should correct.

    https://unity3d.com/unity/qa/bug-reporting
     
  27. streeter12

    streeter12

    Joined:
    Mar 28, 2015
    Posts:
    6
    JoshPeterson likes this.
  28. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    Hello! I used to build my game in under 3 minutes with Unity 2020.3.23f1. Since I moved to Unity 2021.3.8f1 it takes 25 minutes with most of the time spent on this step.

    upload_2022-2-12_21-43-2.png

    I have tried without creating symbols but it doesn't make a difference and the other IL2CPP Code Generation option (Faster (smaller) build) reduces the time to 19 minutes so still not great.

    Am I missing something in the options to get back to my previous build times?
     
  29. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    That step is the Android native linker. I'm not sure why it would take so much longer in Unity 2021 though. First, can you confirm the Unity version where it slows down. I don't think we have a version named 2021.3.8 yet. Did you mean 2021.2.8 instead?

    Second, were you using the Mono scripting backend with Unity 2020.3? Or were you using the IL2CPP scripting backend in both cases?
     
  30. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    2021.2.8f1 indeed, sorry for the unfortunate typo!

    I always used IL2CPP with C++ Compiler Configuration Master with both versions.
     
  31. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Can you try to use the C++ Compiler Configuration option Release with 2021.2.8? I'd be curious to know if that matters.
     
  32. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    Apparently it matters! I just tried again in Master and it took 21 minutes and only 8 minutes in Release. Still longer than it used to be (even when it was in Master) but much better.
     
  33. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Thanks for checking. I wonder if the wrong compiler or linker flags were passed in 2020.3 so that the "Master" configuration was not doing anything special.

    I makes sense for "Master" to be a lot longer, is it should enable link-time optimization, which can be really expensive.
     
  34. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    I see! I stayed on Master before so that I didn't have to remember to use it for live builds and because it didn't make a difference in build times. I'll be work in Release mode from now on and switch only when needed!

    Thanks!
     
  35. michael_unity145

    michael_unity145

    Joined:
    Mar 8, 2022
    Posts:
    14
    How do we set this one on Unity cloud build?
     
  36. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    What setting are you referring to specifically?
     
  37. michael_unity145

    michael_unity145

    Joined:
    Mar 8, 2022
    Posts:
    14
    Sorry for being unclear, I was referring to the "IL2CPP Code Generation" box, as the default seems to be optimize runtime whereas on cloud builds we want to optimise for build speed. I couldn't see it in the dashboard like the current "development build", is it possible to set through the "PreExport" method?
     

    Attached Files:

  38. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    I don't know enough about how Cloud Build configures these build settings options to be sure, unfortunately. My guess is that Cloud Build is using the default option, which is to optimize for runtime performance.

    In Unity 2022.1, we have moved this option to the Player Settings though, so with that version it will be saved with the Unity Project and should be pretty easy to set then for Cloud Build.
     
  39. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    653
    @JoshPeterson what are the folders/files that are deleted upon Clean Build? So we can force a clean build in an older version of Unity.
     
  40. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Which version of Unity are you using and which player platform? That answer will vary.
     
  41. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    653
    2020.3 for PC (server build)
     
  42. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    Thanks! Look in the Library folder of the project for folders named il2cpp_cache or Il2CppCache - those are the ones with the build artifacts. Removing them should cause IL2CPP to rebuild.
     
    joshuacwilde likes this.
  43. Elapotp

    Elapotp

    Joined:
    May 14, 2014
    Posts:
    98
    Hey, folks

    Checked this feature on my project (DOTS one) after upgrading from 2020.3.33f1.
    Well, can't say that build time is hugely less, but for sure we gain some.

    Android platform. Building via a build configuration file. Unity 2021.3.4f1.

    Faster (smaller) builds:
    1. Master configuration:
      aab – 75.7 MB
      symbols – 25.2 MB
      build time – 12.77 m

    2. Release configuration:
      aab – 73.6 MB
      symbols – 25.3 MB
      build time – 4.46 m
    Faster runtime:
    Can't be build with DOTS 0.51 and Unity 2021 LTS right now

    So, there is only one question.
    Why in the Master configuration aab size bigger?
    Isn't Master configuration is about to optimize everything as much as possible?
     
    lclemens likes this.
  44. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    The Master configuration enable link-time (also called whole-program) optimization which is designed to optimize for run time performance. It will perform the same optimization passes that normally happen only within each translation unity (.cpp file) across all translation units.

    So it is very likely that the code size will actually be larger with the Master configuration, as the compiler and linker will likely inline more methods across translation units, leading to move duplication of executable code.

    I'm curious about this problem, what is the specific issue? This should work properly.
     
    lclemens and Elapotp like this.
  45. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    1,810
    lclemens likes this.
  46. Elapotp

    Elapotp

    Joined:
    May 14, 2014
    Posts:
    98
    Prerequisites:

    Faster runtime:
    1. Master configuration. Build fail output:
      Code (csharp):
      1. Building Library/Bee/artifacts/Android/fy9m9/libil2cpp.so failed with output:
      2. /Applications/Unity/Hub/Editor/2021.3.5f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: internal error in arm_branch_common, at /Volumes/Android/buildbot/src/android/binutils/toolchain/binutils/binutils-2.27/gold/arm.cc:4063
      3. clang++: error: linker command failed with exit code 1 (use -v to see invocation) (at ?)
      4. UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions) (at ?)
      5. Unity.Build.Classic.Private.BuildPlayerStep:Run (Unity.Build.BuildContext) (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build.Classic.Private/NonIncremental/Steps/BuildPlayerStep.cs:64)
      6. Unity.Build.BuildStepCollection:Run (Unity.Build.BuildContext) (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build/BuildStepCollection.cs:77)
      7. Unity.Build.Classic.Private.MissingClassicNonIncrementalPipeline:OnBuild (Unity.Build.BuildContext) (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build.Classic.Private/NonIncremental/MissingClassicNonIncrementalPipeline.cs:66)
      8. Unity.Build.BuildProcess:Update () (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build/BuildProcess.cs:54)
      9. Unity.Build.BuildPipelineBase:Build (Unity.Build.BuildConfiguration,Unity.Build.BuildProgress) (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build/BuildPipelineBase.cs:111)
      10. Unity.Build.BuildConfiguration:Build () (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build/BuildConfiguration.cs:157)
      11. Unity.Build.Editor.BuildConfigurationInspector:Build (Unity.Build.BuildConfiguration) (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build.Editor/BuildConfigurationInspector.cs:157)
      12. Unity.Build.Editor.BuildConfigurationInspector/BuildAction:Execute (Unity.Build.BuildConfiguration) (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build.Editor/BuildConfigurationInspector.cs:36)
      13. Unity.Build.Editor.BuildConfigurationInspector/<>c__DisplayClass48_1:<Build>b__13 () (at Library/PackageCache/com.unity.platforms@0.51.0-preview.31/Editor/Unity.Build.Editor/BuildConfigurationInspector.cs:239)
      14. UnityEditor.EditorApplication:Internal_CallDelayFunctions () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:371)
    • Release configuration:
      aab – 87.7 MB
      symbols – 41.4 MB
      build time – 4.76 m

    • Release configuration, NO AAB, Crash on start on Android emulator:
      apk – 73.1 MB
      build time – 6.02 m
     
    Last edited: Jun 29, 2022
    lclemens likes this.
  47. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,081
    Master configuration always failed for me. I didn't bother reporting it as I'd rather see Unity spending time improving/fixing Release.

    Has anyone tested performance of Release vs Master?
     
    lclemens, Neil-Corre and Elapotp like this.
  48. pradotech

    pradotech

    Joined:
    Oct 17, 2019
    Posts:
    35
    @JoshPeterson any news regarding this issue? I'm using 2021.3.8f1 and can't build using Master. Looks like it's required to stick with Release instead. I'm concerned about low-end devices performance.
     
  49. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,591
    I think the only work around that has proven to be consistent is to update to a new Android NDK and use the lld linker. We did this in Unity 2022.2, but that change won't be coming to the Unity 2021 LTS release stream.
     
  50. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    653
    Doesn't seem to be much, if any performance difference between Release and Master from my (brief) tests.