diff --git a/README.md b/README.md index a3c0d436..4dd393b7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The ue4-docker Python package contains a set of Dockerfiles and accompanying bui Key features include: -- The six most recent versions of the Unreal Engine are supported (currently Unreal Engine 4.26 and newer). +- The six most recent versions of the Unreal Engine are supported (currently Unreal Engine 4.27 and newer). - Both Windows containers and Linux containers are supported. - Building and packaging Unreal Engine projects is supported. - Running automation tests is supported. diff --git a/docs/advanced-build-options.adoc b/docs/advanced-build-options.adoc index 26352a0b..9b6fbb9f 100644 --- a/docs/advanced-build-options.adoc +++ b/docs/advanced-build-options.adoc @@ -67,7 +67,7 @@ For example: [source,shell] ---- # Excludes both debug symbols and template projects -ue4-docker build 4.21.2 --exclude debug --exclude templates +ue4-docker build 4.27.0 --exclude debug --exclude templates ---- === Enabling system resource monitoring during builds @@ -78,19 +78,19 @@ You can also use the `-interval` flag to override the default interval of 20 sec [source,shell] ---- # Logs system resource levels every 20 seconds -ue4-docker build 4.24.2 --monitor +ue4-docker build 4.27.0 --monitor ---- [source,shell] ---- # Logs system resource levels every 20 seconds -ue4-docker build 4.24.2 --monitor +ue4-docker build 4.27.0 --monitor ---- [source,shell] ---- # Logs system resource levels every 5 seconds -ue4-docker build 4.24.2 --monitor -interval=5 +ue4-docker build 4.27.0 --monitor -interval=5 ---- [[exporting-generated-dockerfiles]] @@ -103,19 +103,19 @@ You can use these flags like so: [source,shell] ---- # Exports Dockerfiles for all images to the specified filesystem directory -ue4-docker build 4.25.4 -layout "/path/to/Dockerfiles" +ue4-docker build 4.27.0 -layout "/path/to/Dockerfiles" ---- [source,shell] ---- # Exports Dockerfiles for all images -ue4-docker build 4.25.4 -layout "/path/to/Dockerfiles" +ue4-docker build 4.27.0 -layout "/path/to/Dockerfiles" ---- [source,shell] ---- # Exports Dockerfiles for all images and combines them into a single Dockerfile -ue4-docker build 4.25.4 -layout "/path/to/Dockerfiles" --combine +ue4-docker build 4.27.0 -layout "/path/to/Dockerfiles" --combine ---- Exporting Dockerfiles is useful for debugging or contributing to the development of ue4-docker itself. @@ -158,29 +158,13 @@ This includes the labels which specify the <. diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile index 798a786c..52776029 100644 --- a/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile @@ -15,21 +15,6 @@ RUN python3 /tmp/set-changelist.py /home/ue4/UnrealEngine/Engine/Build/Build.ver # Remove the .git directory to disable UBT `git status` calls and speed up the build process RUN rm -rf /home/ue4/UnrealEngine/.git -{% if (not disable_all_patches) and (not disable_opengl_patch) %} -# Enable the OpenGL RHI for Engine versions where it is present but deprecated -COPY enable-opengl.py /tmp/enable-opengl.py -RUN python3 /tmp/enable-opengl.py /home/ue4/UnrealEngine/Engine/Config/BaseEngine.ini -{% endif %} - -{% if (not disable_all_patches) and (not disable_buildgraph_patches) %} -COPY patch-filters-xml.py /tmp/patch-filters-xml.py -RUN python3 /tmp/patch-filters-xml.py /home/ue4/UnrealEngine/Engine/Build/InstalledEngineFilters.xml - -# Patch the default settings in InstalledEngineBuild.xml and increase the output verbosity of the DDC generation step -COPY patch-build-graph.py /tmp/patch-build-graph.py -RUN python3 /tmp/patch-build-graph.py /home/ue4/UnrealEngine/Engine/Build/InstalledEngineBuild.xml /home/ue4/UnrealEngine/Engine/Build/Build.version -{% endif %} - # Ensure UBT is built before we create the Installed Build, since Build.sh explicitly sets the # target .NET Framework version, whereas InstalledEngineBuild.xml just uses the system default, # which can result in errors when running the built UBT due to the wrong version being targeted @@ -54,23 +39,6 @@ RUN ./Engine/Build/BatchFiles/Linux/Build.sh UnrealVersionSelector Linux Shippin RUN cp /home/ue4/UnrealEngine/LocalBuilds/Engine/Linux/Engine/Build/InstalledBuild.txt /home/ue4/UnrealEngine/Engine/Build/InstalledBuild.txt && \ ./Engine/Binaries/Linux/UnrealVersionSelector-Linux-Shipping -register -unattended -{% if (not disable_all_patches) and (not disable_target_patches) %} -# Ensure Client and Server targets have their `PlatformType` field set correctly in BaseEngine.ini -COPY fix-targets.py /tmp/fix-targets.py -RUN python3 /tmp/fix-targets.py /home/ue4/UnrealEngine/LocalBuilds/Engine/Linux/Engine/Config/BaseEngine.ini -{% endif %} - -{% if (not disable_all_patches) and (not disable_unrealpak_copy) %} -# Some versions of the Engine fail to include UnrealPak in the Installed Build, so copy it manually -RUN cp ./Engine/Binaries/Linux/UnrealPak ./LocalBuilds/Engine/Linux/Engine/Binaries/Linux/UnrealPak -{% endif %} - -{% if (not disable_all_patches) and (not disable_toolchain_copy) %} -# Ensure the bundled toolchain included in 4.20.0 and newer is copied to the Installed Build -COPY --chown=ue4:ue4 copy-toolchain.py /tmp/copy-toolchain.py -RUN python3 /tmp/copy-toolchain.py /home/ue4/UnrealEngine -{% endif %} - {% if enable_ushell %} # Ensure ushell is copied to the Installed Build RUN rm -rf ./LocalBuilds/Engine/Linux/Engine/Extras/ushell && \ diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/copy-toolchain.py b/src/ue4docker/dockerfiles/ue4-minimal/linux/copy-toolchain.py deleted file mode 100644 index df70e6ec..00000000 --- a/src/ue4docker/dockerfiles/ue4-minimal/linux/copy-toolchain.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python3 -from os.path import basename, dirname, exists, join, relpath -import glob, shutil, sys - -# Determine the root directory for the source build and the Installed Build -sourceRoot = sys.argv[1] -installedRoot = join(sourceRoot, "LocalBuilds", "Engine", "Linux") - -# Locate the bundled toolchain and copy it to the Installed Build -sdkGlob = join( - sourceRoot, - "Engine", - "Extras", - "ThirdPartyNotUE", - "SDKs", - "HostLinux", - "Linux_x64", - "*", - "x86_64-unknown-linux-gnu", -) -for bundled in glob.glob(sdkGlob): - # Extract the root path for the toolchain - toolchain = dirname(bundled) - - # Print progress output - print( - 'Copying bundled toolchain "{}" to Installed Build...'.format( - basename(toolchain) - ), - file=sys.stderr, - ) - sys.stderr.flush() - - # Perform the copy - dest = join(installedRoot, relpath(toolchain, sourceRoot)) - if exists(dest) == True: - print( - "Destination toolchain already exists: {}".format(dest), - file=sys.stderr, - flush=True, - ) - else: - shutil.copytree(toolchain, dest) diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/enable-opengl.py b/src/ue4docker/dockerfiles/ue4-minimal/linux/enable-opengl.py deleted file mode 100644 index 597992ed..00000000 --- a/src/ue4docker/dockerfiles/ue4-minimal/linux/enable-opengl.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python3 -import os, sys - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -# Enable the OpenGL RHI for Engine versions where it is present but deprecated -iniFile = sys.argv[1] -config = readFile(iniFile) -config = config.replace("; +TargetedRHIs=GLSL_430", "+TargetedRHIs=GLSL_430") -writeFile(iniFile, config) diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/fix-targets.py b/src/ue4docker/dockerfiles/ue4-minimal/linux/fix-targets.py deleted file mode 100644 index 6ce9a427..00000000 --- a/src/ue4docker/dockerfiles/ue4-minimal/linux/fix-targets.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -import os, re, sys - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -# Ensure the `PlatformType` field is set correctly for Client and Server targets in BaseEngine.ini -iniFile = sys.argv[1] -config = readFile(iniFile) -config = re.sub( - 'PlatformType="Game", RequiredFile="(.+UE4(Client|Server).*\\.target)"', - 'PlatformType="\\2", RequiredFile="\\1"', - config, -) -writeFile(iniFile, config) diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/patch-build-graph.py b/src/ue4docker/dockerfiles/ue4-minimal/linux/patch-build-graph.py deleted file mode 100644 index 3bf2ddf1..00000000 --- a/src/ue4docker/dockerfiles/ue4-minimal/linux/patch-build-graph.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 -import json, os, sys - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -# Read the build graph XML -buildXml = sys.argv[1] -code = readFile(buildXml) - -# Read the UE4 version information -versionFile = sys.argv[2] -versionData = json.loads(readFile(versionFile)) - -# Add verbose output flags to the `BuildDerivedDataCache` command -code = code.replace( - 'Command Name="BuildDerivedDataCache" Arguments="', - 'Command Name="BuildDerivedDataCache" Arguments="-Verbose -AllowStdOutLogVerbosity ', -) - -# Disable AArch64 by default (enabled since 4.24.0) -code = code.replace( - 'Property Name="DefaultWithLinuxAArch64" Value="true"', - 'Property Name="DefaultWithLinuxAArch64" Value="false"', -) -# AArch64 was renamed to Arm64 in UE-5.0, so also disable it -code = code.replace( - 'Property Name="DefaultWithLinuxArm64" Value="true"', - 'Property Name="DefaultWithLinuxArm64" Value="false"', -) - -# Enable client and server targets by default in 4.23.0 onwards, except for 4.24.0 - 4.24.2 where Linux server builds fail -# (See for details of the bug and its fix) -if ( - versionData["MajorVersion"] != 4 - or versionData["MinorVersion"] != 24 - or versionData["PatchVersion"] >= 3 -): - code = code.replace( - 'Option Name="WithClient" Restrict="true|false" DefaultValue="false"', - 'Option Name="WithClient" Restrict="true|false" DefaultValue="true"', - ) - code = code.replace( - 'Option Name="WithServer" Restrict="true|false" DefaultValue="false"', - 'Option Name="WithServer" Restrict="true|false" DefaultValue="true"', - ) - -# Write the modified XML back to disk -writeFile(buildXml, code) diff --git a/src/ue4docker/dockerfiles/ue4-minimal/windows/Dockerfile b/src/ue4docker/dockerfiles/ue4-minimal/windows/Dockerfile index 25b98f76..56a81da9 100644 --- a/src/ue4docker/dockerfiles/ue4-minimal/windows/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-minimal/windows/Dockerfile @@ -16,16 +16,6 @@ RUN python C:\set-changelist.py C:\UnrealEngine\Engine\Build\Build.version %CHAN # Remove the .git directory to disable UBT `git status` calls and speed up the build process RUN if exist C:\UnrealEngine\.git rmdir /s /q C:\UnrealEngine\.git -{% if (not disable_all_patches) and (not disable_buildgraph_patches) %} -# Patch out problematic entries in InstalledEngineFilters.xml introduced in UE4.20.0 -COPY patch-filters-xml.py C:\patch-filters-xml.py -RUN python C:\patch-filters-xml.py C:\UnrealEngine\Engine\Build\InstalledEngineFilters.xml - -# Patch out problematic entries in InstalledEngineBuild.xml introduced in UE4.23.0 -COPY patch-build-graph.py C:\patch-build-graph.py -RUN python C:\patch-build-graph.py C:\UnrealEngine\Engine\Build\InstalledEngineBuild.xml -{% endif %} - # Create an Installed Build of the Engine WORKDIR C:\UnrealEngine RUN .\Engine\Build\BatchFiles\RunUAT.bat BuildGraph ` @@ -37,12 +27,6 @@ RUN .\Engine\Build\BatchFiles\RunUAT.bat BuildGraph ` (if exist C:\UnrealEngine\LocalBuilds\InstalledDDC rmdir /s /q C:\UnrealEngine\LocalBuilds\InstalledDDC) && ` rmdir /s /q C:\UnrealEngine\Engine -{% if (not disable_all_patches) and (not disable_target_patches) %} -# Ensure Client and Server targets have their `PlatformType` field set correctly in BaseEngine.ini -COPY fix-targets.py C:\fix-targets.py -RUN python C:\fix-targets.py C:\UnrealEngine\LocalBuilds\Engine\Windows\Engine\Config\BaseEngine.ini -{% endif %} - # Split out components (DDC, debug symbols, template projects) so they can be copied into the final container image as separate filesystem layers COPY split-components.py C:\split-components.py RUN python C:\split-components.py C:\UnrealEngine\LocalBuilds\Engine\Windows C:\UnrealEngine\Components diff --git a/src/ue4docker/dockerfiles/ue4-minimal/windows/fix-targets.py b/src/ue4docker/dockerfiles/ue4-minimal/windows/fix-targets.py deleted file mode 100644 index 6ce9a427..00000000 --- a/src/ue4docker/dockerfiles/ue4-minimal/windows/fix-targets.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -import os, re, sys - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -# Ensure the `PlatformType` field is set correctly for Client and Server targets in BaseEngine.ini -iniFile = sys.argv[1] -config = readFile(iniFile) -config = re.sub( - 'PlatformType="Game", RequiredFile="(.+UE4(Client|Server).*\\.target)"', - 'PlatformType="\\2", RequiredFile="\\1"', - config, -) -writeFile(iniFile, config) diff --git a/src/ue4docker/dockerfiles/ue4-minimal/windows/patch-build-graph.py b/src/ue4docker/dockerfiles/ue4-minimal/windows/patch-build-graph.py deleted file mode 100644 index ae2de692..00000000 --- a/src/ue4docker/dockerfiles/ue4-minimal/windows/patch-build-graph.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 -import os, sys - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -# Read the build graph XML -buildXml = sys.argv[1] -code = readFile(buildXml) - -# Disable HoloLens by default on 4.23. -# On later versions, it is guarded by DefaultWithPlatform and disabled because of HostPlatformOnly=true -code = code.replace( - 'Option Name="WithHoloLens" Restrict="true|false" DefaultValue="$(DefaultWithWindows)"', - 'Option Name="WithHoloLens" Restrict="true|false" DefaultValue="false"', -) - -# Enable client and server targets by default in 4.23.0 onwards -code = code.replace( - 'Option Name="WithClient" Restrict="true|false" DefaultValue="false"', - 'Option Name="WithClient" Restrict="true|false" DefaultValue="true"', -) -code = code.replace( - 'Option Name="WithServer" Restrict="true|false" DefaultValue="false"', - 'Option Name="WithServer" Restrict="true|false" DefaultValue="true"', -) - -# Write the modified XML back to disk -writeFile(buildXml, code) diff --git a/src/ue4docker/dockerfiles/ue4-minimal/windows/patch-filters-xml.py b/src/ue4docker/dockerfiles/ue4-minimal/windows/patch-filters-xml.py deleted file mode 100644 index 20c9e254..00000000 --- a/src/ue4docker/dockerfiles/ue4-minimal/windows/patch-filters-xml.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -import os, sys - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -# Remove the dependency on Linux cross-compilation debug tools introduced in UE4.20.0 -filtersXml = sys.argv[1] -code = readFile(filtersXml) -code = code.replace("Engine/Binaries/Linux/dump_syms.exe", "") -code = code.replace("Engine/Binaries/Linux/BreakpadSymbolEncoder.exe", "") -writeFile(filtersXml, code) diff --git a/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile index b952f903..b2363212 100644 --- a/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile @@ -6,11 +6,6 @@ ARG PREREQS_TAG FROM ${NAMESPACE}/ue4-build-prerequisites:${PREREQS_TAG} {% endif %} -{% if not disable_all_patches %} -# Enable verbose output for steps that patch files? -ARG VERBOSE_OUTPUT=0 -{% endif %} - {% if source_mode == "copy" %} # Copy the Unreal Engine source code from the host system @@ -83,11 +78,13 @@ RUN mkdir /home/ue4/UnrealEngine && \ {% endif %} -{% if (not disable_all_patches) and (not disable_release_patches) %} -# Apply our bugfix patches to broken Engine releases such as 4.25.4 -# (Make sure we do this before the post-clone setup steps are run) -COPY --chown=ue4:ue4 patch-broken-releases.py /tmp/patch-broken-releases.py -RUN python3 /tmp/patch-broken-releases.py /home/ue4/UnrealEngine $VERBOSE_OUTPUT +{% if (not disable_all_patches) and (not disable_buildgraph_patches) %} +COPY patch-filters-xml.py /tmp/patch-filters-xml.py +RUN python3 /tmp/patch-filters-xml.py /home/ue4/UnrealEngine/Engine/Build/InstalledEngineFilters.xml + +# Patch the default settings in InstalledEngineBuild.xml and increase the output verbosity of the DDC generation step +COPY patch-build-graph.py /tmp/patch-build-graph.py +RUN python3 /tmp/patch-build-graph.py /home/ue4/UnrealEngine/Engine/Build/InstalledEngineBuild.xml /home/ue4/UnrealEngine/Engine/Build/Build.version {% endif %} # Run post-clone setup steps, ensuring our package lists are up to date since Setup.sh doesn't call `apt-get update` @@ -113,22 +110,3 @@ RUN sudo apt-get update && \ sudo rm -rf /var/lib/apt/lists/* {% endif %} - -{% if (not disable_all_patches) and (not disable_linker_fixup) %} -# The linker bundled with UE4.20.0 onwards chokes on system libraries built with newer compilers, -# so redirect the bundled clang to use the system linker instead -COPY --chown=ue4:ue4 linker-fixup.py /tmp/linker-fixup.py -RUN python3 /tmp/linker-fixup.py /home/ue4/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64 `which ld` -{% endif %} - -{% if (not disable_all_patches) and (not disable_example_platform_cleanup) %} -# Remove the sample `XXX` example platform code, since this breaks builds from 4.24.0 onwards -# (For details of what this is, see: ) -RUN rm -r -f /home/ue4/UnrealEngine/Engine/Platforms/XXX -{% endif %} - -{% if (not disable_all_patches) and (not disable_ubt_patches) %} -# Apply our bugfix patches to UnrealBuildTool (UBT) -COPY --chown=ue4:ue4 patch-ubt.py /tmp/patch-ubt.py -RUN python3 /tmp/patch-ubt.py /home/ue4/UnrealEngine/Engine/Source/Programs/UnrealBuildTool -{% endif %} diff --git a/src/ue4docker/dockerfiles/ue4-source/linux/linker-fixup.py b/src/ue4docker/dockerfiles/ue4-source/linux/linker-fixup.py deleted file mode 100644 index f63a12b4..00000000 --- a/src/ue4docker/dockerfiles/ue4-source/linux/linker-fixup.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 -import glob, os, shutil, sys - -# Retrieve the Linux SDK root directory and system ld location from our command-line arguments -sdkRoot = sys.argv[1] -systemLd = sys.argv[2] - -# Locate the bundled version(s) of ld and replace them with symlinks to the system ld -for bundled in glob.glob( - os.path.join( - sdkRoot, "*", "x86_64-unknown-linux-gnu", "bin", "x86_64-unknown-linux-gnu-ld" - ) -): - os.unlink(bundled) - os.symlink(systemLd, bundled) - print("{} => {}".format(bundled, systemLd), file=sys.stderr) diff --git a/src/ue4docker/dockerfiles/ue4-source/linux/patch-broken-releases.py b/src/ue4docker/dockerfiles/ue4-source/linux/patch-broken-releases.py deleted file mode 100644 index 5fb4f0f2..00000000 --- a/src/ue4docker/dockerfiles/ue4-source/linux/patch-broken-releases.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -import json -import sys -from os.path import join - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -# Determine if we are building UE 4.25.4 -engineRoot = sys.argv[1] -verboseOutput = len(sys.argv) > 2 and sys.argv[2] == "1" -versionDetails = json.loads( - readFile(join(engineRoot, "Engine", "Build", "Build.version")) -) -if ( - versionDetails["MajorVersion"] == 4 - and versionDetails["MinorVersion"] == 25 - and versionDetails["PatchVersion"] == 4 -): - # If `Commit.gitdeps.xml` is missing the changes from CL 14469950 then inject them - # (See: ) - gitdepsFile = join(engineRoot, "Engine", "Build", "Commit.gitdeps.xml") - gitdepsXml = readFile(gitdepsFile) - if '', - '\n ' - + '', - ) - gitdepsXml = gitdepsXml.replace( - '', - '\n ' - + '', - ) - gitdepsXml = gitdepsXml.replace( - '', - '\n ' - + '', - ) - - writeFile(gitdepsFile, gitdepsXml) - - if verboseOutput: - print("PATCHED {}:\n\n{}".format(gitdepsFile, gitdepsXml), file=sys.stderr) - else: - print("PATCHED {}".format(gitdepsFile), file=sys.stderr) diff --git a/src/ue4docker/dockerfiles/ue4-source/linux/patch-build-graph.py b/src/ue4docker/dockerfiles/ue4-source/linux/patch-build-graph.py new file mode 100644 index 00000000..54e8c42c --- /dev/null +++ b/src/ue4docker/dockerfiles/ue4-source/linux/patch-build-graph.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +import json, os, sys + + +def readFile(filename): + with open(filename, "rb") as f: + return f.read().decode("utf-8") + + +def writeFile(filename, data): + with open(filename, "wb") as f: + f.write(data.encode("utf-8")) + + +# Read the build graph XML +buildXml = sys.argv[1] +code = readFile(buildXml) + +# Read the UE4 version information +versionFile = sys.argv[2] +versionData = json.loads(readFile(versionFile)) + +# Disable AArch64 by default (enabled since 4.24.0) +code = code.replace( + 'Property Name="DefaultWithLinuxAArch64" Value="true"', + 'Property Name="DefaultWithLinuxAArch64" Value="false"', +) +# AArch64 was renamed to Arm64 in UE-5.0, so also disable it +code = code.replace( + 'Property Name="DefaultWithLinuxArm64" Value="true"', + 'Property Name="DefaultWithLinuxArm64" Value="false"', +) + +# Write the modified XML back to disk +writeFile(buildXml, code) diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/patch-filters-xml.py b/src/ue4docker/dockerfiles/ue4-source/linux/patch-filters-xml.py similarity index 100% rename from src/ue4docker/dockerfiles/ue4-minimal/linux/patch-filters-xml.py rename to src/ue4docker/dockerfiles/ue4-source/linux/patch-filters-xml.py diff --git a/src/ue4docker/dockerfiles/ue4-source/linux/patch-ubt.py b/src/ue4docker/dockerfiles/ue4-source/linux/patch-ubt.py deleted file mode 100644 index 435ddd90..00000000 --- a/src/ue4docker/dockerfiles/ue4-source/linux/patch-ubt.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 -import os, re, sys - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -def patchFile(filename, search, replace): - contents = readFile(filename) - patched = contents.replace(search, replace) - writeFile(filename, patched) - - -# Apply our bugfixes to UnrealBuildTool (UBT) - -# Ensure modules always have a binary output directory value set when exporting JSON -# (In some Engine versions, External modules do not have an output directory set, breaking modules that reference `$(BinaryOutputDir)`) -patchFile( - os.path.join(sys.argv[1], "Configuration", "UEBuildTarget.cs"), - "Module.ExportJson(Module.Binary?.OutputDir, GetExecutableDir(), Writer);", - "Module.ExportJson((Module.Binary != null || Binaries.Count == 0) ? Module.Binary?.OutputDir : Binaries[0].OutputDir, GetExecutableDir(), Writer);", -) diff --git a/src/ue4docker/dockerfiles/ue4-source/windows/Dockerfile b/src/ue4docker/dockerfiles/ue4-source/windows/Dockerfile index ddd5c8a3..b163af71 100644 --- a/src/ue4docker/dockerfiles/ue4-source/windows/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-source/windows/Dockerfile @@ -64,7 +64,7 @@ RUN python C:\patch-setup-win.py C:\UnrealEngine\Setup.bat %VERBOSE_OUTPUT% {% endif %} {% if (not disable_all_patches) and (not disable_release_patches) %} -# Apply our bugfix patches to broken Engine releases such as 4.25.4 +# Apply our bugfix patches to broken Engine releases # (Make sure we do this before the post-clone setup steps are run) COPY patch-broken-releases.py C:\patch-broken-releases.py RUN python C:\patch-broken-releases.py C:\UnrealEngine %VERBOSE_OUTPUT% @@ -74,15 +74,3 @@ RUN python C:\patch-broken-releases.py C:\UnrealEngine %VERBOSE_OUTPUT% # (Note that the `-no-cache` flag disables caching of dependency data in `.git/ue4-gitdeps`, saving disk space) WORKDIR C:\UnrealEngine RUN Setup.bat -no-cache {{ gitdependencies_args }} - -{% if (not disable_all_patches) and (not disable_example_platform_cleanup) %} -# Remove the sample `XXX` example platform code, since this breaks builds from 4.24.0 onwards -# (For details of what this is, see: ) -RUN rmdir /s /q C:\UnrealEngine\Engine\Platforms\XXX 2>NUL || exit 0 -{% endif %} - -{% if (not disable_all_patches) and (not disable_ubt_patches) %} -# Apply our bugfix patches to UnrealBuildTool (UBT) -COPY patch-ubt.py C:\patch-ubt.py -RUN python C:\patch-ubt.py C:\UnrealEngine\Engine\Source\Programs\UnrealBuildTool -{% endif %} diff --git a/src/ue4docker/dockerfiles/ue4-source/windows/patch-broken-releases.py b/src/ue4docker/dockerfiles/ue4-source/windows/patch-broken-releases.py index 980d8f02..9bd1bf2e 100644 --- a/src/ue4docker/dockerfiles/ue4-source/windows/patch-broken-releases.py +++ b/src/ue4docker/dockerfiles/ue4-source/windows/patch-broken-releases.py @@ -14,45 +14,12 @@ def writeFile(filename, data): f.write(data.encode("utf-8")) -# Determine if we are building UE 4.25.4 +# Determine if we are building UE 4.27.0 engineRoot = sys.argv[1] verboseOutput = len(sys.argv) > 2 and sys.argv[2] == "1" versionDetails = json.loads( readFile(join(engineRoot, "Engine", "Build", "Build.version")) ) -if ( - versionDetails["MajorVersion"] == 4 - and versionDetails["MinorVersion"] == 25 - and versionDetails["PatchVersion"] == 4 -): - # If `Commit.gitdeps.xml` is missing the changes from CL 14469950 then inject them - # (See: ) - gitdepsFile = join(engineRoot, "Engine", "Build", "Commit.gitdeps.xml") - gitdepsXml = readFile(gitdepsFile) - if '', - '\n ' - + '', - ) - gitdepsXml = gitdepsXml.replace( - '', - '\n ' - + '', - ) - gitdepsXml = gitdepsXml.replace( - '', - '\n ' - + '', - ) - - writeFile(gitdepsFile, gitdepsXml) - - if verboseOutput: - print("PATCHED {}:\n\n{}".format(gitdepsFile, gitdepsXml), file=sys.stderr) - else: - print("PATCHED {}".format(gitdepsFile), file=sys.stderr) - # Determine if we are building UE 5.1.0 if ( diff --git a/src/ue4docker/dockerfiles/ue4-source/windows/patch-ubt.py b/src/ue4docker/dockerfiles/ue4-source/windows/patch-ubt.py deleted file mode 100644 index 435ddd90..00000000 --- a/src/ue4docker/dockerfiles/ue4-source/windows/patch-ubt.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 -import os, re, sys - - -def readFile(filename): - with open(filename, "rb") as f: - return f.read().decode("utf-8") - - -def writeFile(filename, data): - with open(filename, "wb") as f: - f.write(data.encode("utf-8")) - - -def patchFile(filename, search, replace): - contents = readFile(filename) - patched = contents.replace(search, replace) - writeFile(filename, patched) - - -# Apply our bugfixes to UnrealBuildTool (UBT) - -# Ensure modules always have a binary output directory value set when exporting JSON -# (In some Engine versions, External modules do not have an output directory set, breaking modules that reference `$(BinaryOutputDir)`) -patchFile( - os.path.join(sys.argv[1], "Configuration", "UEBuildTarget.cs"), - "Module.ExportJson(Module.Binary?.OutputDir, GetExecutableDir(), Writer);", - "Module.ExportJson((Module.Binary != null || Binaries.Count == 0) ? Module.Binary?.OutputDir : Binaries[0].OutputDir, GetExecutableDir(), Writer);", -) diff --git a/src/ue4docker/infrastructure/BuildConfiguration.py b/src/ue4docker/infrastructure/BuildConfiguration.py index 0e850f4d..c5efc120 100644 --- a/src/ue4docker/infrastructure/BuildConfiguration.py +++ b/src/ue4docker/infrastructure/BuildConfiguration.py @@ -29,13 +29,6 @@ # The Perforce changelist numbers for each supported .0 release of the Unreal Engine UNREAL_ENGINE_RELEASE_CHANGELISTS = { - "4.20.0": 4212847, - "4.21.0": 4541578, - "4.22.0": 5660361, - "4.23.0": 8386587, - "4.24.0": 10570792, - "4.25.0": 13144385, - "4.26.0": 14830424, "4.27.0": 17155196, "5.0.0": 19505902, "5.1.0": 23058290, @@ -71,8 +64,8 @@ def __str__(self) -> str: "2017": VisualStudio( name="2017", build_number="15", - # We do not support versions older than 4.20 - supported_since=Version("4.20"), + # We do not support versions older than 4.27 + supported_since=Version("4.27"), unsupported_since=Version("5.0"), pass_version_to_buildgraph=False, ), @@ -133,12 +126,12 @@ def addArguments(parser): parser.add_argument( "release", nargs="?", # aka "required = False", but that doesn't work in positionals - help='UE4 release to build, in semver format (e.g. 4.20.0) or "custom" for a custom repo and branch (deprecated, use --ue-version instead)', + help='UE4 release to build, in semver format (e.g. 4.27.0) or "custom" for a custom repo and branch (deprecated, use --ue-version instead)', ) parser.add_argument( "--ue-version", default=None, - help='UE4 release to build, in semver format (e.g. 4.20.0) or "custom" for a custom repo and branch', + help='UE4 release to build, in semver format (e.g. 4.27.0) or "custom" for a custom repo and branch', ) parser.add_argument( "--linux", @@ -450,7 +443,7 @@ def __init__(self, parser, argv, logger): ) except InvalidVersion: raise RuntimeError( - 'invalid Unreal Engine release number "{}", full semver format required (e.g. "4.20.0")'.format( + 'invalid Unreal Engine release number "{}", full semver format required (e.g. "4.27.0")'.format( self.args.release ) ) diff --git a/test-suite/test-ue-releases.py b/test-suite/test-ue-releases.py index a3931f9a..e409bdfa 100755 --- a/test-suite/test-ue-releases.py +++ b/test-suite/test-ue-releases.py @@ -29,12 +29,13 @@ def __init__( # The list of Unreal Engine releases that are currently supported by ue4-docker SUPPORTED_RELEASES = [ - UERelease("4.26", "4.26.2-fixed", COMMITDEPS_REPO, 2017, None), UERelease("4.27", "4.27.2-fixed", COMMITDEPS_REPO, 2017, None), UERelease("5.0", "5.0.3-fixed", COMMITDEPS_REPO, 2019, "20.04"), UERelease("5.1", "5.1.1-fixed", COMMITDEPS_REPO, 2019, None), UERelease("5.2", "5.2.1-release", UPSTREAM_REPO, 2022, None), UERelease("5.3", "5.3.2-release", UPSTREAM_REPO, 2022, None), + UERelease("5.4", "5.4.4-release", UPSTREAM_REPO, 2022, None), + UERelease("5.5", "5.5.1-release", UPSTREAM_REPO, 2022, None), ]