BuildFailedException: Burst compiler (1.2.0-preview.9) failed running

i cant build build Linux Headless Server. (it works for Windows Headless Server)

Error:

BuildFailedException: Burst compiler (1.2.0-preview.9) failed running

stdout:
Burst requires gcc/clang toolchains to be correctly installed in order to build a standalone player for Linux with X64_SSE4
Unable to find /usr/bin/clang or /usr/bin/gcc, is the gcc/clang toolchain installed?
stderr:

Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.2.0-preview.9/Editor/BurstAotCompiler.cs:725)
Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.2.0-preview.9/Editor/BurstAotCompiler.cs:663)
Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunManagedProgram (System.String exe, System.String args, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.2.0-preview.9/Editor/BurstAotCompiler.cs:637)
Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLsImpl (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.2.0-preview.9/Editor/BurstAotCompiler.cs:332)
Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.2.0-preview.9/Editor/BurstAotCompiler.cs:90)
UnityEditor.Build.BuildPipelineInterfaces.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at <b43e6d4802d64ea8bbdaa0bf64614d3b>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Error seems pretty self explanatory

Or are you trying to do cross platform compilation or something? Which isn’t supported by the way.

sorry i didnt get what do you mean by cross platform compilation ?

Are you trying to compile a linux version from a windows machine

yes i thought the Unity Editor can Build Linux Player on a windows machine.

Unity does, but Burst does not support cross platform compilation.

If you want to make a linux build, you need a linux machine.

https://discussions.unity.com/t/756059/3

1 Like

oh i didnt know.
i got this error on the Linux machine. (installed in a virtualbox environment)

Failed running /home/sabri/Desktop/UnityProjects/2019.3.0b10/Editor/Data/il2cpp/build/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="/home/sabri/Desktop/UnityProjects/TestHeadlessBuild/Temp/StagingArea/Data/Native/GameAssembly.so" --cachedirectory="/home/sabri/Desktop/UnityProjects/TestHeadlessBuild/Assets/../Library/il2cpp_cache" --profiler-report --map-file-parser="/home/sabri/Desktop/UnityProjects/2019.3.0b10/Editor/Data/Tools/MapFileParser/MapFileParser" --directory="/home/sabri/Desktop/UnityProjects/TestHeadlessBuild/Temp/StagingArea/Data/Managed" --generatedcppdir="/home/sabri/Desktop/UnityProjects/TestHeadlessBuild/Temp/StagingArea/Data/il2cppOutput"

stdout:
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 /usr/bin/clang
  at Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment () [0x00051] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at Unity.IL2CPP.Building.CppProgramBuilder.Build (Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x00001] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner (Unity.IL2CPP.Building.CppProgramBuilder builder, Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x00001] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at il2cpp.Program.DoRun (System.String[] args, System.Collections.Generic.List`1[T] foundAssemblies) [0x005b5] in <b2a2e6a90711435a98a53b1506c78efc>:0
  at il2cpp.Program.Run (System.String[] args, System.Boolean setInvariantCulture) [0x00042] in <b2a2e6a90711435a98a53b1506c78efc>:0
  at il2cpp.Program.Main (System.String[] args) [0x00002] in <b2a2e6a90711435a98a53b1506c78efc>:0
stderr:

Unhandled Exception:
System.InvalidOperationException: C++ code builder is unable to build C++ code for Linux: Could not find valid clang executable at /usr/bin/clang
  at Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment () [0x00051] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at Unity.IL2CPP.Building.CppProgramBuilder.Build (Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x00001] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner (Unity.IL2CPP.Building.CppProgramBuilder builder, Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x00001] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at il2cpp.Program.DoRun (System.String[] args, System.Collections.Generic.List`1[T] foundAssemblies) [0x005b5] in <b2a2e6a90711435a98a53b1506c78efc>:0
  at il2cpp.Program.Run (System.String[] args, System.Boolean setInvariantCulture) [0x00042] in <b2a2e6a90711435a98a53b1506c78efc>:0
  at il2cpp.Program.Main (System.String[] args) [0x00036] in <b2a2e6a90711435a98a53b1506c78efc>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: C++ code builder is unable to build C++ code for Linux: Could not find valid clang executable at /usr/bin/clang
  at Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment () [0x00051] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at Unity.IL2CPP.Building.CppProgramBuilder.Build (Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x00001] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner (Unity.IL2CPP.Building.CppProgramBuilder builder, Unity.IL2CPP.Building.Statistics.IBuildStatistics& statistics) [0x00001] in <bb67bd417da84683b2b1ad15ccb4aa5e>:0
  at il2cpp.Program.DoRun (System.String[] args, System.Collections.Generic.List`1[T] foundAssemblies) [0x005b5] in <b2a2e6a90711435a98a53b1506c78efc>:0
  at il2cpp.Program.Run (System.String[] args, System.Boolean setInvariantCulture) [0x00042] in <b2a2e6a90711435a98a53b1506c78efc>:0
  at il2cpp.Program.Main (System.String[] args) [0x00036] in <b2a2e6a90711435a98a53b1506c78efc>:0

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:126)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71)
UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:515)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(Il2CppBuildPipelineData, String, String, Boolean) (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:496)
UnityEditorInternal.IL2CPPBuilder:Run() (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:337)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:72)
DesktopStandalonePostProcessor:SetupStagingArea(BuildPostProcessArgs, HashSet`1) (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:240)
DesktopStandalonePostProcessor:PostProcess(BuildPostProcessArgs) (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:42)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /home/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

Again, the error is pretty straight forward. It’s telling you that you don’t have the required dependencies installed on your machine to compile. e.g. clang

1 Like

Thanks @tertle
im not very familiar with Linux, but ill try to install all those dependencies.

i have a Segmentation fault error which causes the Headless Server to Stop Running,
from what i read this problem is can be caused by these cases:
trying to access memory that has not been allocated or has been deleted. Trying to write to memory that is read-only can also cause a memory error. Finally, on some Unix and Linux systems, pointers that are initialized to null cannot be dereferenced.

but i dont understand why is this happening only in linux and not in Windows ?

Hello,
can you try to run the unity editor from commandline and prepend DISPLAY=:0.0 to the command?
For instance
DISPLAY=:0.0 ./Unity --batchmode …etc all the arguments you need to pass
X11 needs to associate the process to a display even in headless mode.

Please let us know if this helps.

1 Like