Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ ARG VERBOSE_OUTPUT=0
# Apply our bugfix patches to broken Engine releases
# (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
RUN --mount=type=secret,id=password,env=GITPASS,uid=1000,required \
sudo apt-get update && sudo apt-get install -y --no-install-recommends python3-requests && sudo rm -rf /var/lib/apt/lists/* \
&& python3 /tmp/patch-broken-releases.py /home/ue4/UnrealEngine $VERBOSE_OUTPUT
{% endif %}

# Run post-clone setup steps, ensuring our package lists are up to date since Setup.sh doesn't call `apt-get update`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import json
import sys
from os.path import join
import os
import requests


def readFile(filename):
Expand All @@ -20,11 +22,11 @@ def writeFile(filename, data):
readFile(join(engineRoot, "Engine", "Build", "Build.version"))
)

if (
versionDetails["MajorVersion"] == 5
and versionDetails["MinorVersion"] == 0
and versionDetails["PatchVersion"] == 0
):
major = versionDetails["MajorVersion"]
minor = versionDetails["MinorVersion"]
patch = versionDetails["PatchVersion"]

if major == 5 and minor == 0 and patch == 0:
buildFile = join(engineRoot, "Engine", "Build", "InstalledEngineFilters.xml")
buildXml = readFile(buildFile)

Expand All @@ -42,3 +44,36 @@ def writeFile(filename, data):
print("PATCHED {}:\n\n{}".format(buildFile, buildXml), file=sys.stderr)
else:
print("PATCHED {}".format(buildFile), file=sys.stderr)

if major < 5 or (major == 5 and minor < 2):
gitdepsFile = join(engineRoot, "Engine", "Build", "Commit.gitdeps.xml")
# See https://forums.unrealengine.com/t/upcoming-disruption-of-service-impacting-unreal-engine-users-on-github/1155880
# In May 2023, Epics broke Commit.gitdeps.xml for *all existing releases up to 5.1.1* due to changes in their CDN
# we need to authenticate
password = os.getenv("GITPASS")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But where does GITPASS come from?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@slonopotamus slonopotamus Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but that won't work on Windows...

# eg curl -L \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer ghp_secretGoesHere" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/repos/EpicGames/UnrealEngine/releases/tags/4.27.2-release
gitdepsUrl = f"https://api.github.com/repos/EpicGames/UnrealEngine/releases/tags/{major}.{minor}.{patch}-release"
headers = {
"Accept": "application/vnd.github+json",
"Authorization": "Bearer " + password.strip(),
"X-GitHub-Api-Version": "2022-11-28",
}
with requests.get(gitdepsUrl, headers=headers) as response:
assets = response.json()["assets"]
if len(assets) == 1:
gitdepsUrl = assets[0]["url"]

# eg gitdepsUrl = f"https://api.github.com/repos/EpicGames/UnrealEngine/releases/assets/107274338"
headers["Accept"] = "application/octet-stream"
with requests.get(gitdepsUrl, headers=headers) as response:
gitdepsXml = response.text.replace("&", "&amp;")
writeFile(gitdepsFile, gitdepsXml)

if verboseOutput:
print("PATCHED {}:\n\n{}".format(gitdepsFile, gitdepsXml), file=sys.stderr)
else:
print("PATCHED {}".format(gitdepsFile), file=sys.stderr)