diff --git a/Assets/Mirror/Hosting/Edgegap/Editor/EdgegapBuildUtils.cs b/Assets/Mirror/Hosting/Edgegap/Editor/EdgegapBuildUtils.cs index 7ba02b10135..14b23c4b04e 100755 --- a/Assets/Mirror/Hosting/Edgegap/Editor/EdgegapBuildUtils.cs +++ b/Assets/Mirror/Hosting/Edgegap/Editor/EdgegapBuildUtils.cs @@ -75,12 +75,19 @@ public static async Task RunCommand_DockerBuild(string registry, string imageRep { string realErrorMessage = null; + // ARM -> x86 support: + // build commands use 'buildx' on ARM cpus for cross compilation. + // otherwise docker builds would not launch when deployed because + // Edgegap's infrastructure is on x86. instead the deployment logs + // would show an error in a linux .go file with 'not found'. + string buildCommand = IsArmCPU() ? "buildx build --platform linux/amd64" : "build"; + #if UNITY_EDITOR_WIN - await RunCommand("docker.exe", $"build -t {registry}/{imageRepo}:{tag} .", onStatusUpdate, + await RunCommand("docker.exe", $"{buildCommand} -t {registry}/{imageRepo}:{tag} .", onStatusUpdate, #elif UNITY_EDITOR_OSX - await RunCommand("/bin/bash", $"-c \"docker build -t {registry}/{imageRepo}:{tag} .\"", onStatusUpdate, + await RunCommand("/bin/bash", $"-c \"docker {buildCommand} -t {registry}/{imageRepo}:{tag} .\"", onStatusUpdate, #elif UNITY_EDITOR_LINUX - await RunCommand("/bin/bash", $"-c \"docker build -t {registry}/{imageRepo}:{tag} .\"", onStatusUpdate, + await RunCommand("/bin/bash", $"-c \"docker {buildCommand} -t {registry}/{imageRepo}:{tag} .\"", onStatusUpdate, #endif (msg) => { diff --git a/Assets/Mirror/Hosting/Edgegap/Editor/EdgegapWindow.cs b/Assets/Mirror/Hosting/Edgegap/Editor/EdgegapWindow.cs index b3515bb2ffe..1fd45019922 100755 --- a/Assets/Mirror/Hosting/Edgegap/Editor/EdgegapWindow.cs +++ b/Assets/Mirror/Hosting/Edgegap/Editor/EdgegapWindow.cs @@ -356,16 +356,6 @@ async void BuildAndPushServer() } // END MIRROR CHANGE - // MIRROR CHANGE - // Edgegap VMs are x86. - // ARM CPUs like Apple Silicon need special handling. - if (EdgegapBuildUtils.IsArmCPU()) - { - onError($"Building from {RuntimeInformation.ProcessArchitecture} Processors is currently not supported because Edgegap infrastructure runs on x86.\n\nPlease find another machine to build from while we are working on ARM support."); - return; - } - // END MIRROR CHANGE - // create server build BuildReport buildResult = EdgegapBuildUtils.BuildServer(); if (buildResult.summary.result != BuildResult.Succeeded)