Add Linux game server fallback packaging

This commit is contained in:
2026-05-19 13:28:16 -07:00
parent 86a0fcbb3f
commit 67006ff1bb
3 changed files with 109 additions and 3 deletions
+25 -3
View File
@@ -60,9 +60,31 @@ Expected output:
- Logs: `Saved\BuildLogs\BuildLinuxDedicatedServer.log`
- Archive: `Builds\LinuxServerDevelopment`
If the script fails before compile with a Linux toolchain error, install Epic's
Unreal `5.7` Linux cross-compile toolchain on Windows-Builder, reopen the
terminal, and run the script again.
The script self-heals `LINUX_MULTIARCH_ROOT` when the known UE 5.7 toolchain is
installed at `C:\UnrealToolchains\v26_clang-20.1.8-rockylinux8`.
If the script fails with:
```text
Server targets are not currently supported from this engine distribution.
```
the installed Epic binary engine cannot build the true `AgrarianGameServer`
target. Use the MVP fallback package until a source-built/server-capable engine
is available:
```bat
cd /d P:\AgrarianGameBulid
Scripts\PackageLinuxGameServerFallback-Windows.bat
```
Fallback expected output:
- Logs: `Saved\BuildLogs\PackageLinuxGameServerFallback.log`
- Archive: `Builds\LinuxGameDevelopment`
Deploy the fallback package to `/opt/agrarian/server` and launch it through
`AgrarianGameServer.sh` with `-server -port=7777 -NullRHI -nosound`.
## Initial Runtime Shape
@@ -10,10 +10,17 @@ set "ARCHIVE_DIR=%PROJECT_DIR%\Builds\LinuxServerDevelopment"
set "LOG_DIR=%PROJECT_DIR%\Saved\BuildLogs"
set "LOG_FILE=%LOG_DIR%\BuildLinuxDedicatedServer.log"
set "TARGET_MAP=/Game/Agrarian/Maps/L_GroundZeroTerrain_Test"
set "DEFAULT_LINUX_MULTIARCH_ROOT=C:\UnrealToolchains\v26_clang-20.1.8-rockylinux8"
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
if not exist "%ARCHIVE_DIR%" mkdir "%ARCHIVE_DIR%"
if "%LINUX_MULTIARCH_ROOT%"=="" (
if exist "%DEFAULT_LINUX_MULTIARCH_ROOT%\x86_64-unknown-linux-gnu\bin\clang++.exe" (
set "LINUX_MULTIARCH_ROOT=%DEFAULT_LINUX_MULTIARCH_ROOT%"
)
)
if not exist "%BUILD_BAT%" (
echo Unreal Engine 5.7 Build.bat was not found at:
echo %BUILD_BAT%
@@ -37,6 +44,7 @@ echo Archive: %ARCHIVE_DIR%
echo Log: %LOG_FILE%
echo.
echo This requires Epic's Linux cross-compile toolchain for Unreal 5.7 on Windows-Builder.
echo LINUX_MULTIARCH_ROOT=%LINUX_MULTIARCH_ROOT%
echo.
call "%BUILD_BAT%" AgrarianGameServer Linux Development -Project="%PROJECT_FILE%" -WaitMutex -NoUBA > "%LOG_FILE%" 2>&1
@@ -0,0 +1,76 @@
@echo off
setlocal
set "PROJECT_DIR=%~dp0.."
set "PROJECT_FILE=%PROJECT_DIR%\AgrarianGame.uproject"
set "UE_ROOT=C:\Program Files\Epic Games\UE_5.7"
set "RUN_UAT=%UE_ROOT%\Engine\Build\BatchFiles\RunUAT.bat"
set "ARCHIVE_DIR=%PROJECT_DIR%\Builds\LinuxGameDevelopment"
set "LOG_DIR=%PROJECT_DIR%\Saved\BuildLogs"
set "LOG_FILE=%LOG_DIR%\PackageLinuxGameServerFallback.log"
set "TARGET_MAP=/Game/Agrarian/Maps/L_GroundZeroTerrain_Test"
set "DEFAULT_LINUX_MULTIARCH_ROOT=C:\UnrealToolchains\v26_clang-20.1.8-rockylinux8"
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
if not exist "%ARCHIVE_DIR%" mkdir "%ARCHIVE_DIR%"
if "%LINUX_MULTIARCH_ROOT%"=="" (
if exist "%DEFAULT_LINUX_MULTIARCH_ROOT%\x86_64-unknown-linux-gnu\bin\clang++.exe" (
set "LINUX_MULTIARCH_ROOT=%DEFAULT_LINUX_MULTIARCH_ROOT%"
)
)
if not exist "%RUN_UAT%" (
echo Unreal Engine 5.7 RunUAT was not found at:
echo %RUN_UAT%
exit /b 1
)
if not exist "%PROJECT_FILE%" (
echo Project file was not found at:
echo %PROJECT_FILE%
exit /b 1
)
if "%LINUX_MULTIARCH_ROOT%"=="" (
echo LINUX_MULTIARCH_ROOT is not set and the default toolchain was not found:
echo %DEFAULT_LINUX_MULTIARCH_ROOT%
exit /b 1
)
echo Packaging Agrarian Linux game-server fallback...
echo Archive: %ARCHIVE_DIR%
echo Log: %LOG_FILE%
echo LINUX_MULTIARCH_ROOT=%LINUX_MULTIARCH_ROOT%
echo.
call "%RUN_UAT%" BuildCookRun ^
-project="%PROJECT_FILE%" ^
-noP4 ^
-platform=Linux ^
-clientconfig=Development ^
-build ^
-cook ^
-stage ^
-pak ^
-archive ^
-archivedirectory="%ARCHIVE_DIR%" ^
-map=%TARGET_MAP% ^
-utf8output ^
-NoUBA > "%LOG_FILE%" 2>&1
set "PACKAGE_EXIT_CODE=%ERRORLEVEL%"
type "%LOG_FILE%"
if not "%PACKAGE_EXIT_CODE%"=="0" (
echo.
echo Linux game-server fallback package failed with exit code %PACKAGE_EXIT_CODE%.
echo Log file: %LOG_FILE%
exit /b %PACKAGE_EXIT_CODE%
)
echo.
echo Linux game-server fallback package completed successfully.
echo Archive: %ARCHIVE_DIR%
echo.
exit /b 0