Search Unity

Unity's version control component has been upgraded to Plastic SCM.

Changes to scripts cause infinite compilation times

Discussion in 'Unity Collaborate' started by hippocoder, Aug 5, 2016.

  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hi,

    If you press play while it's still compiling (spinning progress wheel bottom right of unity is active) it can sometimes compile forever, and never enter play mode and never allow me to press play or even quit from play. I can still edit the project however.

    But testing is not possible until I close and open Unity again.

    This is only with collaborate active as far as I know as it only started today, and the only change today was to start using collaborate.
     
  2. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    Hippo, this is great feedback!! Thank you so much I'll repro now but if you have time to submit a bug, feel free to ping me over the case #! :D
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I've been trying to make it reproduce before bugging you. I do notice after the bug occurs, and I close and reopen unity, it pops up with a compiling scripts box. This indicates it got stuck somehow trying to compile changes previously.

    It's not related to pressing play either, it just will get stuck sometimes after saving a script and tabbing back to Unity.

    I'm aware these are the worst kind of bugs :)
     
    holliebuckets likes this.
  4. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    I actually can repro pretty consistently with the Play button, but it does seem to be racey. I'll keep an eye out for the general "stuck on compile" issues. Thank you so much!
     
    hippocoder likes this.
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Oh you reproduced it? thank goodness :) What would we do without you! To confirm, when it happens, it sticks the play button down forever, and has that little spinny cog forever so can't actually do any play testing from that point, although everything else works!
     
    holliebuckets likes this.
  6. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    Yep!! I can repro it with the Services window and the Collab History window :) Trying to track down where the bad code is today :D
     
  7. Inok

    Inok

    Joined:
    Feb 5, 2014
    Posts:
    16
    As workaround i close collab history tab, i still have this issue in Unity 5.5.0p3, strange that this bug still not fixed.
     
    donutdan likes this.
  8. hibbygames

    hibbygames

    Joined:
    Mar 19, 2015
    Posts:
    49
    I also have this issue in 5.5.2f1, turning Collab off stops it from crashing when I return from editing a script
     
  9. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @Inok and @bitcoinhibby! We're really sorry for the inconvenience that this bug is causing. We are aware of this bug and aim to resolve it before we leave beta.
     
  10. hibbygames

    hibbygames

    Joined:
    Mar 19, 2015
    Posts:
    49
    No worries, Collaborate is awesome
     
    Ryan-Unity likes this.
  11. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That it is. After riding a canoe upside down through Perforce waters and being stripped and flogged by some git, I can only agree.
     
  12. andrew-lukasik

    andrew-lukasik

    Joined:
    Jan 31, 2013
    Posts:
    249
    Workaround: When compilation is definitely stuck, RMB on any script in Project window > Reimport
     
  13. hibbygames

    hibbygames

    Joined:
    Mar 19, 2015
    Posts:
    49
    That worked for me :)
     
    MrLucid72 likes this.
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    My hero.
     
    andrew-lukasik and hibbygames like this.
  15. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    996
    If it helps, I've seen this issue too! Seems really random, though (but I do see it 2 times per day+ in 5.5p4). I haven't been able to reproduce in any fashionable pattern.
     
  16. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Can confirm, my team gets this all the time too
     
  17. blueteak

    blueteak

    Joined:
    Feb 19, 2013
    Posts:
    140
    Thanks so much for this! Was pulling my hair out closing and re-opening unity every time.
     
    Last edited: Apr 25, 2017
  18. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Wonder when it will be fixed? it still happens here but at least the reimport hack works :)
     
  19. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @hippocoder! We are aiming to have this bug fixed for 2017.1. I'm really sorry for the delay and appreciate you being so patient with us.
     
    hippocoder likes this.
  20. jakejolli

    jakejolli

    Joined:
    Mar 22, 2014
    Posts:
    54
    Still seeing this in 2017.1.0f3.

    Just added a single variable to a script, and now the compilation icon just keeps spinning.

    Occasionally, this also happens when pressing play during compilation. The editor will change color to my play mode tint, and the play button will be depressed but will never play. I can't exit play mode, but can still edit the project.

    I had originally submitted a bug report, but they couldn't reproduce it, and I couldn't reproduce it reliably either.

    This only seems to occur if a lot of quick changes are made in code and Unity has to compile more than once in a short time. Maybe there's some clean up going on behind the scenes that's not being completed before it tries to compile again?

    Original bug report's case number is 899319. I'll also try to reopen the ticket.

    Hopefully this gets fixed soon. It probably happens at least once per development session and is pretty disruptive.
     
  21. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Which version did you jump from to here? I am on 2017.1 p5 and it's not present. Maybe this is a regression? @ryanc-unity
     
  22. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    996
    I started getting this daily, all the time. I eventually couldn't take all the collab bugs and we disconnected Collab. Ever since then, no sticky play button.... Unity boots up in 5 seconds instead of a 2 minute thread freeze.... No weird UI stuff whenever I unfocus and re focus Unity.... Suddenly most of my bugs are gone.

    I had tons of Unity bugs, but had no idea almost all of them were from Collab...!
    That said, it's a shame that 5.6 doesn't get patched. This is why there's never a truly stable version within Unity: Features are pushed to stable early, very early, and all the fixed go to the next version. But in the next version, there's always a new feature introduced that are minimally tested for stability in an alpha/Beta-like state. But for stability, you need to upgrade, and new alpha/Beta-like features pour in.

    It's a paradox :( apologies this turned into a rant post (unintended), but I hope one day Unity truly has a stable release. You won't see Visual Studio, Unreal, or any major software ever call such a version 'stable' . If they do, major bugs are patched and not thrown exclusively if you upgrade.... It's truly a frowned practice.

    (I know it's an upper-management decision and not your fault, of course)

    Edit: don't mind my grammar/sp, on phone
     
    Last edited: Aug 29, 2017
  23. lifeFo

    lifeFo

    Joined:
    Apr 14, 2017
    Posts:
    15
    same question happened on 2017.3.1f1
     
  24. Joviex

    Joviex

    Joined:
    Jan 23, 2011
    Posts:
    44
    Still waiting for a fix on 2017.4.1f1

    o.0
     
  25. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @lifeFo and @Joviex! I'm sorry that we've taken so long to come back to address these concerns. We've released a few fixes that resolved issues similar to this one for a lot of users but clearly we haven't addressed either of your specific issues if you're still seeing it in these latest versions.

    We'd like to work closer with you all to help us better diagnose your specific issues. If both of you could get in touch with our Support Team then that would really help us out.
     
  26. lassade

    lassade

    Joined:
    Jan 27, 2013
    Posts:
    127
    In 2017.4.0f1 I got around these issue by close all instances of mono.exe with task mananger then reimporting the script(s) that I just modiffied.
     
  27. Loden_Heathen

    Loden_Heathen

    Joined:
    Sep 1, 2012
    Posts:
    480
    On 2018.2 similar or same issue
    Project was fine, it was mostly empty (fresh project) created a simple terrain, imported some common assets (micro splat and the likes) and worked away. Then I imported post processing effects and it went into a constant loop of compiling. Closed the engine (with the close button) and reopened it and it goes to complile scripts on boot but never completes. Seems to get about 80% of the way through hangs, drops back to 50% closes the script compliling dialog and reopens it to start again.

    For note in this case it compiles for a time, stops for a short bit and starts compilign again. the others seem to have been in a compile that never ends I seem to have a situation where it constantly things there is more to compile.

    Going to let it run for awhile and see if it ever completes but there is no way this little project should take that long

    Update:
    Some testing over night, we finally got the project to open back up took it 3 hours of compile attempts. Once it was open again it constantly recompiled over and over. We tested for what the cause might be and found it to be Post Processing v2.x (we tried several versions).
    We do use Post Processing in several other projects on this version of the engine so it cant be that alone but something about the includion of Post Processing v2.x in this project always causes it to perpetually compile.

    We are attempting to upload the project and bug report now.

    Update 2:
    We have reproduced without using Collab, so in our case anyway this is not a collab issue. The reproduction project has never been hooked up to collab.
     
    Last edited: Jul 20, 2018
  28. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @lodendsg! This sounds like a known bug around our Post Processing pipeline that is currently being looked at. In the meantime, one possible workaround is to try deleting your Library folder and reopen Unity. I hope that helps to unblock you.
     
  29. DrunkenMastah

    DrunkenMastah

    Joined:
    Sep 26, 2017
    Posts:
    51
    Losing scene file changes every alternate day because Unity gets stuck compiling and does not even save the Scene file before it gets stuck :/ (I gotta remember to hit the save scene button before making changes to scripts)

    Steps to Repro:

    Unity 2018.3.0f2
    Visual Studio 15.9.3 Community Edition
    Scripting Runtime Version: .NET 4.x Equivalent

    1. Run debugger on Visual Studio for the loaded Unity Project.
    2. Make changes to script in visual studio
    3. Click on Unity Editor.
    4. Unity starts compiling.
    5. Sometimes compilation gets stuck forever.

    The only way to continue is to kill the process and lose all changes made to the scene file...
    Clicking stop debugging in the Visual Studio will not work as that too is stuck. (Probably the reason why Unity is stuck in the first place)
     
  30. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @AmitSuri! I've been trying to repro this bug but ran into a blocker that's preventing me from following your same steps. On Windows 10, after I attach the Visual Studio debugger to the Unity Editor all of my script files are locked in VS so that I can't modify them. Does this not happen for you? Do you have a setting enabled that allows you to modify files while attaching the debugger?
     
  31. DrunkenMastah

    DrunkenMastah

    Joined:
    Sep 26, 2017
    Posts:
    51

    [PS:] Sorry for the late reply. I assumed any tags here get directed to my email. Only saw it just now as an alert while browsing the Forums.

    Do you have a setting enabled that allows you to modify files while attaching the debugger?
    Not sure about that. I am on Unity 2018.3.4f1 now. Will report here if it happens even after the update.
    I usually do work as follows:
    1. Click Play
    2. See my game playing -> Change some script while the game is running.
    3. The Editor settings are as follows:

    upload_2019-2-4_10-1-12.png

    As it is set on Stop Playing and Recompile, the game stops playing when I make changes to the script file and hit save and return back to the Unity Editor. But the problem begins there.

    The Editor is trying to stop running the debugger and then start compiling but at that same time if you try and Hit STOP button on the Visual studio debugger, everything gets stuck. I think the problem is that the Editor is trying to stop the debugger and the debugger is trying to stop itself at the same time. Editor is waiting for visual studio and Visual studio waiting for the Unity Editor is what I think.

    To circumvent that issue, I put up a sticky note on my monitor. "Don't hit stop button on VS Debugger when the Popup appears"

    It helps a bit but sometimes I don't even have to hit the STOP button on the VS debugger to get stuck. Not sure of the repro steps for that situation.

    Hope this helps.
     
  32. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    No worries about the late reply. If you'd like you can hover over your name and click on Preferences, then under Options there will be an option to also get email notifications from forum replies so that you don't miss them in the future.

    Thank you for the extra information. I'll play around with these settings more myself and see if there's something here that I can pass along to the Editor team about how the VS Debugger is interacting with Unity's compiler. Please let us know if you run into any more issues that you think might be Collab-related.
     
  33. petersvp

    petersvp

    Joined:
    Dec 20, 2013
    Posts:
    63
    Guys, GameAnalytics.dll got me stuck in endless loop trying to run the Api updater on it! Had to delete GA to be able to proceed. And this is a new bug now. There are also ways to completely get unity stuck waiting for VS's debugger and VS failing to gracefully stop the debugging. Working on huge projects is harder then ever now! You sohuld NEVER allow compilation loops, under no circumstances! The post-processing stack was able to do similar endless loops. I don't know why but such a bug is definitely a more-than-critical issue because it can lock out people of theirs project and not everybody knows how to troubleshoot such loops. Please, fix this, fix your debugger integration.

    Saying "On Windows 10, after I attach the Visual Studio debugger to the Unity Editor all of my script files are locked in VS" does not even make any sense. What does "locked" mean? Did you mean, *.cs files are write-locked? Or you mean that Visual Studio does not allow you to edit the CS files while debugger is attached? If it's the latter, did you done a google search, because there is a setting for it - DISABLE the "Edit and Continue" - it's not supported for unity C# thus VS is locking you away - it's one of these stupid VS behaviours, but you will be able to edit your files.

    And sorry for me being that cold but, guys, Unity used to be "state of the art" years ago. Now, every stable release have some serious form of bug... and you are even refusing to partially open the source for community cintributions. I don't want to abandon Unity in a project that mature as my current project but there is constantly anything that slows me down. You are losing pro customers and plus customers because of these... Anyways.
     
    better_walk_away and hahahpizza like this.
  34. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    Just come across this issue. I accidentally imported three C# scripts into the project while Editor was in Play Mode. After that, my project got stuck on importing. Then I restarted Unity, and now it just stuck on "Hold on... Compiling Scripts..." for 30 minutes now. I think it is not going to finish, I think it is a infinite loop.