Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Cannot build for Linux IL2CPP using Unity 2020.2.0b1 on Win 10?

Discussion in 'Linux' started by zapposh, Sep 4, 2020.

  1. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    115
    I updated to Unity 2020.2.0b1 (on Windows 10), after seeing the new "Linux Build Support (IL2CPP)" addon in the Unity Hub, which I then also installed.

    But Build is greyed out when using IL2CPP, with the message "Building Linux IL2CPP player requires a sysroot toolchain package to be installed."
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,415
    Hey, it looks like the installer update went out before we could add proper documentation on this or make the package visible in the package manager.

    Can you add this to your project package manifest for now?

    Code (csharp):
    1. "com.unity.toolchain.win-x86_64-linux-x86_64" : "0.1.11-preview"
    We will have more information on this soon.
     
    zapposh likes this.
  3. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    115
    Your solution worked perfectly in Unity 2020.2.0b1, but after updating to 2020.2.b2, the error message is back.
    As ideas?
    Thanks
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,415
    Is that line still in the package manifest?
     
  5. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    115
    Tried with, and without. Same result.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,415
    That's weird. We're looking into it.
     
  7. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    115
    The only notable difference is that while updating, I did not install the Linux Mono build module this time, only the IL2CPP one.
     
  8. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    115
    Just tried with a new project, and added the line to the manifest.
    I can confirm this workaround does not work anymore in 2020.2.0b2.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,415
    Can you submit a project you're reproducing this on as a bug report? I cannot seem to reproduce this on my end. It allows me to build Linux Standalone player with IL2CPP just fine after adding that package to the manifest.
     
    zapposh likes this.
  10. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    115
    Case 1278936
    Thanks
     

    Attached Files:

  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,415
    Hey so it doesn't reproduce for me with your project, however, I found some interesting entries in your editor log. Could it be that you're running into this issue by any chance?

    https://issuetracker.unity3d.com/is...p-and-linux-build-support-mono-both-installed

    Could you try making sure that just "Linux-IL2CPP" module is installed in the editor (and don't install "Linux-Mono")? We are in the process of fixing this.
     
  12. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    115
    I'm actually not sure if my issues are related to the one in your link, since I can build using mono, but have unsuccessfully tried using Linux-IL2CPP in 3 test-scenes now (screenshot below), but I confirm having both modules installed.
    When the next update is there, I'll not install the mono package (it seems one cannot uninstall single packages).
     

    Attached Files:

  13. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    623
    Hi, Does building linux il2cpp from macos not supported yet? I installed com.unity.toolchain.macos-x86_64-linux-x86_64 0.1.15-preview, but it shows "failed to initialize package: com.unity.toolchain.macos-x86_64-linux-x86_64" and number of "failed to initialize sysroot com.unity.toolchain.macos-x86_64-linux-x86_64" errors.

    (Both Unity 2020.1.7f1 and 2020.2.0b6 are failed)
     
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,415
    It should work, can you show the editor log?
     
  15. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    623
    I checked Editor.log and found that 7-Zip log says that "Scanning the drive for archives: ERROR No more files" with strange project path. After further investigation, I found that spaces in project path makes issue, so when I removed all spaces from project path, it works.
     
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,415
    Can you file a bug report on that?
     
  17. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    623
    Strange, after rebooting my PC, new-project which contains spaces in project path does not throw any error. Forget this.
     
  18. No3371

    No3371

    Joined:
    Dec 1, 2016
    Posts:
    42
    Similar things happened to me that stop me from continuing the project:

    1) when both IL2CPP and Mono for Linux installed, IL2CPP is considered uninstalled.
    2) No clang.exe. I checked with Everything, the only 2 clang.exe I have on my machine are
    D:\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe
    and
    C:\Program Files\Unity\Hub\Editor\2018.2.14f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\clang.exe

    (project path shortened)
    Failed running "......\2020.1.10f1\Editor\Data\il2cpp/build/deploy/netcoreapp3.0/il2cpp.exe" --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Linux" --architecture="x64" --configuration="Release" --outputpath="......\unity\Temp/StagingArea/Data\Native\GameAssembly.so" --cachedirectory="......\Assets\..\Library/il2cpp_cache" --baselib-directory="....../2020.1.10f1/Editor/Data/PlaybackEngines/LinuxStandaloneSupport\Variations\linux64_headless_nondevelopment_il2cpp" --avoid-dynamic-library-copy --incremental-g-c-time-slice=3 --profiler-report --map-file-parser=D:/UnityInstallations/2020.1.10f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe --directory=....../Temp/StagingArea/Data/Managed --generatedcppdir=....../Temp/StagingArea/Data/il2cppOutput --extra-types-file=....../unity/Temp/StagingArea/Data/extra-types.txt

    stdout:
    Running il2cpp.exe in server GC mode.
    il2cpp.exe didn't catch exception: System.InvalidOperationException: C++ code builder is unable to build C++ code for Linux: Could not find valid clang executable at clang.exe
    at Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions)
    at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions)
    at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    at il2cpp.Program.Main(String[] args)
    stderr:
    Unhandled exception. System.InvalidOperationException: C++ code builder is unable to build C++ code for Linux: Could not find valid clang executable at clang.exe
    at Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions)
    at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions)
    at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    at il2cpp.Program.Main(String[] args)

    UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <3037c1046402403280ab8b0782ca806f>:0)
    UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <3037c1046402403280ab8b0782ca806f>:0)
    UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at <3037c1046402403280ab8b0782ca806f>:0)
    UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at <3037c1046402403280ab8b0782ca806f>:0)
    UnityEditorInternal.IL2CPPBuilder.Run () (at <3037c1046402403280ab8b0782ca806f>:0)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <3037c1046402403280ab8b0782ca806f>:0)
    DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <3037c1046402403280ab8b0782ca806f>:0)

    (2020.1.10 and 2020.1.7 tested

    I tried the package you mentioned, but it's not working and gives the following error:
    Failed to initialize package: com.unity.toolchain.win-x86_64-linux-x86_64
    UnityEditor.Il2Cpp.SysrootPackage:Initialize()
    UnityEditorInternal.SysrootManager:FindSysroot(String, String)
    UnityEditorInternal.SysrootManager:FindSysroot(BuildTarget)
    System.Collections.Generic.List`1:AddRange(IEnumerable`1)
    UnityEditorInternal.Il2CppNativeCodeBuilderUtils:AddBuilderArguments(Il2CppNativeCodeBuilder, String, IEnumerable`1, IEnumerable`1, Il2CppCompilerConfiguration)
    UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(Il2CppBuildPipelineData, String, String, Boolean)
    UnityEditorInternal.IL2CPPBuilder:Run()
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry)
    DesktopStandalonePostProcessor:SetupStagingArea(BuildPostProcessArgs, HashSet`1)
    DesktopStandalonePostProcessor:postProcess(BuildPostProcessArgs)
     
  19. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,637
    How the hell do I fix that?
     
  20. andrews_unity

    andrews_unity

    Unity Technologies

    Joined:
    Dec 11, 2015
    Posts:
    258
    This should be fixed in the latest version of the package
     
    No3371 likes this.
  21. azcoffeehabit

    azcoffeehabit

    Joined:
    Jun 14, 2015
    Posts:
    1
    I am also seeing this trying to build to Linux target on 2020.2.0.b11.3484 I have added the toolchain to the package manifest.json and have the following set up and console logs below:

    New HDRP project
    Windows/Linux il2cpp build support only
    Add package manifest entry above
    Restart Unity

    INFO
    Found sysroot: com.unity.sysroot, hp=, ha=, tp=, ta=
    UnityEngine.Debug:Log (object)
    UnityEditorInternal.SysrootManager:RegisterSysroots ()
    UnityEditorInternal.SysrootManager:Initialize ()
    UnityEditor.Modules.ModuleManager:InitializePlatformSupportModules ()

    INFO
    Found sysroot: com.unity.toolchain.win-x86_64-linux-x86_64, hp=windows, ha=x86_64, tp=linux, ta=x86_64
    UnityEngine.Debug:Log (object)
    UnityEditorInternal.SysrootManager:RegisterSysroots ()
    UnityEditorInternal.SysrootManager:Initialize ()
    UnityEditor.Modules.ModuleManager:InitializePlatformSupportModules ()

    INFO
    Found sysroot: com.unity.sysroot.linux-x86_64, hp=, ha=, tp=linux, ta=x86_64
    UnityEngine.Debug:Log (object)
    UnityEditorInternal.SysrootManager:RegisterSysroots ()
    UnityEditorInternal.SysrootManager:Initialize ()
    UnityEditor.Modules.ModuleManager:InitializePlatformSupportModules ()

    ERROR
    Failed to initialize package: com.unity.toolchain.win-x86_64-linux-x86_64
    UnityEditor.Il2Cpp.SysrootPackage:Initialize ()
    UnityEditorInternal.SysrootManager:FindSysroot (string,string)
    UnityEditorInternal.SysrootManager:FindSysroot (UnityEditor.BuildTarget)
    UnityEditor.LinuxStandalone.LinuxStandaloneBuildWindowExtension:GetCannotBuildIl2CppPlayerInCurrentSetupError ()
    DesktopStandaloneBuildWindowExtension:ShowIl2CppErrorIfNeeded ()
    DesktopStandaloneBuildWindowExtension:ShowPlatformBuildOptions ()
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
    Last edited: Nov 12, 2020
  22. andrews_unity

    andrews_unity

    Unity Technologies

    Joined:
    Dec 11, 2015
    Posts:
    258

    Will look into this.
     
  23. aydin_khp

    aydin_khp

    Joined:
    May 15, 2020
    Posts:
    13
    I had more or less the same problem with building for Linux on a Windows machine; Installing "Linux (IL2CPP) Target Support" directly from Unity 2020.2.2's What's New Page fixed it for me.
     
unityunity