Search Unity

API Updater not explicit at all

Discussion in 'Editor & General Support' started by Mikilo, Aug 13, 2017.

  1. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Sorry not answering before. Somehow I missed the notification about new messages.

    The fix has been released in 2018.3.6f1 which happened after the date you asked. If it still happens, please, let me know.

    Best

    Adriano
     
  2. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,167
    Hi Adriano!

    Thanks for the response, the asset is This

    And you just need to create an empty project on unity 2019.1.0.f2 and after importing the asset package, just go to one of the demo scenes and Select the IRDSManager object on the scene, you would see then the error that LoadImage is not implmemented, so the dll was not updated by the API Updater.

    This does not happen on Unity 2018.3 only on 2019

    Thanks again! let me know if this is what you need to be able to reproduce it.

    Cheers!
     
    AdrianoVerona_Unity likes this.
  3. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Hi

    I'll try to investigate it today and get back to you.

    you are welcome!
     
  4. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    @rhodnius

    I've just tried with a development branch of 2019.1 and it looks to work as expected. See attached file and the output of AssemblyUpdater in the log:

    [API Updater]
    [AssemblyUpdater] Field replacement 'System.Boolean UnityEditor.SceneView::m_AudioPlay' replaced with 'System.Boolean UnityEditor.SceneView::audioPlay' in method 'System.Void IRDSSoundTestWindow::Init(IRDSSoundController,IRDSDrivetrain) (IL_0059: stfld System.Boolean UnityEditor.SceneView::audioPlay)'.
    [AssemblyUpdater] Member 'System.Boolean UnityEngine.Texture2D::LoadImage(System.Byte[])' replaced with 'System.Boolean UnityEngine.ImageConversion::LoadImage(UnityEngine.Texture2D,System.Byte[])' in method 'System.Void IRDSLevelLoadVariablesEditor::OnEnable()'.
    [AssemblyUpdater] Member 'System.Boolean UnityEngine.Texture2D::LoadImage(System.Byte[])' replaced with 'System.Boolean UnityEngine.ImageConversion::LoadImage(UnityEngine.Texture2D,System.Byte[])' in method 'System.Void IRDSManagerEditor::LoadResources()'.


    Can you send me your Editor.log ?

    Adriano
     

    Attached Files:

    Last edited: Apr 29, 2019
  5. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,167

    Sorry for the long wait!

    I have been really busy, and haven't checked this out, will do today and post here the update/logs of the result.

    Thanks a lot for looking at this, would update soon
     
    AdrianoVerona_Unity likes this.
  6. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,167
    here is the log file, i see the API run, but no updates made, also I never get to see the popup confirmation dialogue.

    Code (CSharp):
    1. [API Updater] Processing imported assemblies took 90 ms (3/3 assemblie(s)).
    2. Filename: "D:\Program Files\Unity\2019.1.0f2\Editor\Data\MonoBleedingEdge\bin/mono.exe"
    3. Filename: "D:\Program Files\Unity\2019.1.0f2\Editor\Data\MonoBleedingEdge\bin/mono.exe"
    4. Filename: "D:\Program Files\Unity\2019.1.0f2\Editor\Data\MonoBleedingEdge\bin/mono.exe"
    5. Arguments: D:/Program Files/Unity/2019.1.0f2/Editor/Data/Tools/ScriptUpdater/AssemblyUpdater.exe update -a Assets/iRDS/Scripts/Main/iRDSMain.dll --output "C:/Users/JOSEGA~1/AppData/Local/Temp/tmp375b48a4.tmp" --api-version 2019.1.0f2  -s "D:\Program Files\Unity\2019.1.0f2\Editor\Data\Managed,+D:/Program Files/Unity/2019.1.0f2/Editor/Data\UnityExtensions/Unity,+D:/Projects/DagaGames/clients/Greg 2019 test/iRDS Test 2019/Assets,+D:\Program Files\Unity\2019.1.0f2\Editor\Data\Managed" "D:/Program Files/Unity/2019.1.0f2/Editor/Data/Managed/UnityEngine.dll"
    6. Arguments: D:/Program Files/Unity/2019.1.0f2/Editor/Data/Tools/ScriptUpdater/AssemblyUpdater.exe update -a Assets/iRDS/Scripts/Editor/iRDSEditorTool.dll --output "C:/Users/JOSEGA~1/AppData/Local/Temp/tmp505718e9.tmp" --api-version 2019.1.0f2  -s "D:\Program Files\Unity\2019.1.0f2\Editor\Data\Managed,+D:/Program Files/Unity/2019.1.0f2/Editor/Data\UnityExtensions/Unity,+D:/Projects/DagaGames/clients/Greg 2019 test/iRDS Test 2019/Assets,+D:\Program Files\Unity\2019.1.0f2\Editor\Data\Managed" "D:/Program Files/Unity/2019.1.0f2/Editor/Data/Managed/UnityEngine.dll"
    7. Arguments: D:/Program Files/Unity/2019.1.0f2/Editor/Data/Tools/ScriptUpdater/AssemblyUpdater.exe update -a Assets/iRDS/Scripts/Editor/iRDSEditor.dll --output "C:/Users/JOSEGA~1/AppData/Local/Temp/tmp2a3e4c83.tmp" --api-version 2019.1.0f2  -s "D:\Program Files\Unity\2019.1.0f2\Editor\Data\Managed,+D:/Program Files/Unity/2019.1.0f2/Editor/Data\UnityExtensions/Unity,+D:/Projects/DagaGames/clients/Greg 2019 test/iRDS Test 2019/Assets,+D:\Program Files\Unity\2019.1.0f2\Editor\Data\Managed" "D:/Program Files/Unity/2019.1.0f2/Editor/Data/Managed/UnityEditor.dll" "D:/Program Files/Unity/2019.1.0f2/Editor/Data/Managed/UnityEngine.dll"
    8. [API Updater] Update finished with success in 207 ms (0/3 assemblie(s) updated).
    And here is the complete Log file

    Editor.Log
     
  7. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    For some reason I cannot access the log file. When I download it if has a lot of zeros.. looks like corrupt
    Can you attach it to this thread?

    Adriano
     
  8. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,167
    Sure here it is
     

    Attached Files:

  9. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,167
    Seems it gets those zeros at the beginning, but the logs are at the bottom, can't generate one currently, and won't be able until May 10 that I return from a short vacation
     
  10. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
  11. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,167
    AdrianoVerona_Unity likes this.
  12. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,184
    @AdrianoVerona_Unity Can you pass it on to the team that it would be incredibly helpful towards productivity if there was a setting or option for disabling/suppressing the API updater from auto-running on Unity load.
     
  13. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    We've discussed the idea of adding such option but we decided to not do so to avoid users disabling it and then failing to realize that not running it is causing them trouble.

    Anyway, I am curious: why do you think not running ApiUpdater would improve productivity ? Actually ApiUpdater run only in 2 scenarios:

    1. After an assembly is imported (we run AssemblyUpdater.exe to check whether it requires updating or not and update it in case it is necessary)
    2. After script compilation errors/warnings that indicates the script needs to be updated (we run ScriptUpdater.exe).

    Scenario 1 can be a problem if you compile your project code outside Unity and import the built assembly; in this case you can disable AssemblyUpdater for specific assemblies by passing -disable-assembly-updater <assembly1 assembly_n> argument to Unity.

    As long as there's no warnings/errors that trigger 2 (I'd expect this to be the most common case) the overhead of ApiUpdater in this scenario is really low.

    Adriano
     
  14. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,184
    @AdrianoVerona_Unity For us, it's triggered all the time because Unity crashes about 15-20 times a day for us. And when we pull from git, changes in scripts cause that to popup. In addition, with source control, anytime a file is added or modified, Unity triggers the API updater when we reopen it.

    We prefer to have complete control over the pipeline because many times after a crash or some issue with Unity, we'll open and let the project reimport assets, but when we leave and come back to our computers nothing is imported because of that popup. Also, because we're using unmanaged code the API updater always fails.This interrupts the flow and adds up to wasting countless hours for us. It'd be at least nice to have this as an option for power users. The small popup is very disruptive for our workflow, and we're intimate enough with Unity to know what needs to be upgraded.
     
    Spike likes this.
  15. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Hi.

    Adding new files should only trigger the updater if that files requires updates. When this happens again, please share your Editor.log with me so I can try to understand what is happening.


    What type of failure? Can you share your Editor.log and if possible some repro project?

    I am really interested in understanding why ApiUpdater triggering in your scenarios.

    We already have a way to tell Unity to not display that dialog through an command line argument (-accept-apiupdate) but that is only checked in batch mode. Maybe we could check it irrespective to being in batch mode or not.

    Adriano
     
  16. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,184
    @AdrianoVerona_Unity We're in the middle of a couple feature heavy agile sprints, so I may not have time to get you the Editor.log right away.

    But, allowing the disabling of the dialog through -accept-apiupdate irrespective of batch mode or not would be much appreciated and celebrated by many. If you get a chance could you pass that onto the team? Thank you for checking back with me.
     
    Last edited: Jul 18, 2019
  17. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    That is unfortunate since it looks like to me that you are hitting other issues and fixing those would probably benefit more Unity users.

    I'll.

    Just keep in mind that that command line argument simply tells Unity to go ahead and apply updates.

    Also, I'll not be around for the next 4 weeks or so, so I may be not responsive during this time.

    Adriano
     
    Last edited: Jul 18, 2019
  18. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,184
    No worries. I'll get the repro for you when I can. Thank you.
     
    AdrianoVerona_Unity likes this.
  19. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    226
    @AdrianoVerona_Unity I am contributor to the Microsoft MixedRealityToolkit. Just yesterday I had a talk about the difficulty of getting the Toolkit changed when it comes to breaking changes. Now my question is, would it be possible to somehow open the API Update up to be customizable for asset developers? Quick example:
    Users update to the latest MixedRealityToolkit. Some API changed from using enums to actual System Types. These code passages get marked by a custom attribute, created by the vendors of the toolkit, which trigger the API Updater to run a code converter created by the vendors too. Afterwards, code is changed and custom attributes are getting removed.
    Now the code is changed, cleaned up and still working without breaking users configurations. I am talking about ScriptableObjects and their serialization data.
    Maybe this is not even how it works at the moment, but something like that would be nice. This would open up a bunch of possibilities.
     
  20. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    @Alexees Sorry for the very lonnnnnnnnnnnnnnnnnnnng delay.

    I was in vacation when you wrote and since them I am really busy :)

    We do see the value in supporting ApiUpdater in AS packages and we have had discussions around this subject some times but haven't decided yet. One thing I can say is that with the introduction of packages, work have been done in a direction that it will be easier to support the scenario you mentioned (if we decide to open ApiUpdater to AS packages).

    Even though the mechanism that implements each type of update is relatively flexible it is not plug-able (for sure, that would be possible to implement, but it is not done).

    Serializable objects (including ScriptableObjects) have some limitations (ApiUpdater wise) but in general they are not special.

    Even not working exactly as you described we still see value in allowing AS authors to use the existing set of update types.

    Best
     
    Alexees likes this.