Search Unity

Is there a reason Unity doesn't use the Roslyn compiler by default on non-supported distros?

Discussion in 'Linux' started by r9shackleford, Sep 1, 2019.

  1. r9shackleford

    r9shackleford

    Joined:
    Jul 23, 2019
    Posts:
    23
    Referring to unity_csc.sh in the Tools/RoslynScripts/ folder.
    I saw a massive speedup by manually enabling it for my distro, reducing compile times by 70-80%.

    Is there any downside to this or a reason why it's disabled by default?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    That is the list we know to work. If you try to run .NET Core version on a system that doesn't have required dependencies, it will simply crash and you won't even be able to open the editor.
     
    r9shackleford likes this.
  3. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Can you share what enabling it means (how to do it)?
    I'd be interested in this speedup as i found compiling noticeably slower than on my windows machine.
    (And from what i gather (only?) .net core is required additionally?)
     
  4. r9shackleford

    r9shackleford

    Joined:
    Jul 23, 2019
    Posts:
    23
    Edit the unity_csc.sh script in the Unity/xxx/Editor/Data/Tools/RoslynScripts/
    Where "xxx" is whatever version you're using(e.g., mine is 2019.2.6f1)
    sed command to change it to always use roslyn:
    sed -i 's/USE_NETCORE=0/USE_NETCORE=1/g' unity_csc.sh
     
    Flavelius likes this.
  5. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Thanks, looking through that script it seems many 'common' distros do use roslyn already. Since i had to switch back to ubuntu i guess i won't actually need to modify it anymore then.
     
  6. ZliVuk

    ZliVuk

    Joined:
    Mar 24, 2018
    Posts:
    61
    Anyone tried this on Arch or Manjaro?
     
  7. r9shackleford

    r9shackleford

    Joined:
    Jul 23, 2019
    Posts:
    23
    Yes, I use Arch.
     
    ZliVuk likes this.