You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Change 8553543 by Wes.Fudala
We now set a fixed value of 24 to CEF screenInfo colorDepth when off screen rendering is enabled.
Change 8235770 by Wes.Fudala
Fix for CEFJsScripting memory stomp and memory alignment errors called out by the stomp memory allocator when running with -stompmalloc on the commandline.
Change 8065597 by Leigh.Swift
BuildPatchServices: Improving ChunkBuildDirectory behaviour when dealing with empty build or builds only containing empty files.
This is now fully supported as part of the generation flow rather than an early detected edge case.
Change 7641628 by Leigh.Swift
BuildPatchServices: Tweaks to serialisation safety.
BuildPatchServices: DiskChunkStore fix for crash when chunkdump serialisation fails due to disk space.
Change 7436869 by Leigh.Swift
BuildPatchServices: Fix regression in BPT package chunks for cloud save improvements now require message pumping.
Change 7326553 by Wes.Fudala
BuildPatchServices: Attempt to restore functionality of the -SkipBuildPatchPrereq commandline. This stopped functioning in CL# 6655502 with the BPS DLC related refactors.
The issue was reported by a number of users that were relying on this commandline as a last resort workaround for prereq install issues.
Change 7323945 by Leigh.Swift
BuildPatchServices: BuildPatchTool: Install time coefficient values exposed by DiffManifests.
This gives an indicative install duration.
The time is not necessarily accurate, but the simulation is a constant and so the value is highly comparable between different builds.
Change 7310352 by Antony.Carter
BuildPatchServices: Adding support for overriding http path for chunk requests. This allows the ability to support signed urls when downloading patch data.
Change 7095282 by Leigh.Swift
BuildPatchServices: Fix regression with manifests that have no core files.
Change 7092198 by leigh.swift
BuildPatchServices: Reuse existing code from FBuildPatchAppManifest::GetChunkShaHash in FBuildPatchManifestSet::GetChunkShaHash.
This fixes an issue where older manifest files that did not ship with chunk sha values in them, can skip sha validation of chunks like pre-DLC launcher did.
Change 6959115 by Wes.Fudala
Added functionality that will optionally expose embedded browser console logs to the client.
Change 6835841 by Leigh.Swift
BuildPatchServices: Rearranging manifest save logic to avoid unnecessary seeking forwards, which avoids an assert when undetected write failures occur.
Change 6684994 by Leigh.Swift
BuildPatchServices: Don't clean empty directories if staging only.
Change 6655502 by Mike.Erickson, Leigh.Swift, Wes.Fudala
BuildPatchServices: Restructuring how installers are configured and make use of manifest files in order to combine multiple actions on an installation directory into one installer.
This resembles a feature set for a better DLC installation experience.
Change 6404031 by Richard.Fawcett
BuildPatchTool: Only append ".manifest" to output filename if output filename has been specified on the command line.
This was causing a manifest file called literally ".manifest" to be output to the clouddir if -OutputFilename was not specified.
Change 6077240 by Wes.Fudala
Execution of browser resource load complete delegate now happens on the main thread.
Change 6076171 by Leigh.Swift
BuildPatchTool: PatchGeneration: ChunkDeltaOptimise: PackageChunks: Improved corrupt output protection against ill timed taskkill, by serialising to temp filename, and then rename on success.
BuildPatchTool: PatchGeneration: Manifest file extension added if not provided, fixing an oversight and inconsistency with other mode behaviours.
BuildPatchTool: Compactify: Only warn when failing to get a file size, if the file still exists. Otherwise log instead.
Change 6049003 by Leigh.Swift
BuildPatchServices: Adding ProcessRequiredDiskSpace to Launcher.Install.Stats which represents how much disk space the install/update process needed to complete.
BuildPatchServices: Adding ProcessAvailableDiskSpace to Launcher.Install.Stats which represents how much disk space was available at the time of checking required disk space.
Change 5915157 by Leigh.Swift
BuildPatchTool: Adding a statistic to diffmanifests for temporary disk space requirement to apply the patch.
Change 5934838 by Leigh.Swift
BuildPatchTool: PackageChunks: Adding support to provide a tagset for the previous build manifest when producing chunkdbs. This allows expanding the chunks saved out to cover tagsets not installed in the previous build.
Change 5838666 by wes.fudala
Browser can now bubble up the state of completed web resource loads.
Change 5689493 by Leigh.Swift
Adding new x86 and x64 MS VC141 CRT redist, version 14.16.27012
Change 5689462 by Leigh.Swift
Fixing process handle leaks on windows.
Core was leaking for getting an application name.
Change 5500917 by Leigh.Swift
BuildPatchTool: Adding new arg DiffAbortThreshold to ChunkDeltaOptimise mode which allows skipping of the operation if the original delta is so large that it would take too long to process, and likely have little benefit.
BuildPatchTool: Switching some Log output to use Display so that it will appear in EC and CMD windows.
Change 5337482 by Leigh.Swift
BuildPatchTool: Fix for DiffManifests mode not accurately representing delta size for tagged install sets.
Change 5261246 by Leigh.Swift
BuildPatchServices: Fix for file download needing to mock response codes for higher layer statistics code which tracks data sizes and speeds.
This is a regression from previous change to correct download failure vs corruption statistics.
Change 5224725 by Leigh.Swift
BuildPatchServices: Fix for delta download of more than 0 bytes when no update is necessary.
BuildPatchServices: Skip requesting delta metafile if no file changes are actually required for a patch.
BuildPatchTool: Reduce unnecessary data produced by BPT ChunkDeltaOptimise mode.
Change 5010941 by Mike.Erickson
BuildPatchServices: Add download scaling based on average speed per request, maximum count, and download health.
Change 5010845 by Wes.Fudala
BuildPatchServices: IDownload refactored to have specific request and response success functions, to make it clearer that a successful request does not mean the response was also good.
BuildPatchServices: Fixed issues with download failures reporting as corruptions.
Change 5000643 by Wes.Hunt
Remove HttpServiceTracker from UE4.
Change 4884381 by Leigh.Swift
BuildPatchTool: Fix for Package Chunks mode hanging when no chunks were required.
Change 4848675 by Justin.Sargent, Leigh.Swift
Speculative fixes for graphics device lost related crash, by adding additional d3d api result checks.
Improved logging for graphics device lost handling.
Improved logging for tracking down common font loading failure resulting in an ensure.
Change 4831134 by Leigh.Swift
BuildPatchTool: Fix for crash in patchgeneration when fast-forward path replays no match.
Change 4801714 by Wes.Fudala
Fix for CEF issue encountered when building using Mac Mojave + XCode10.
Change 4719149 by Leigh.Swift
BuildPatchTool: PatchGeneration mode cyclic data optimisation, reduces SHA calculation requirement counts for cyclic data.
BuildPatchTool: PatchGeneration mode fix for a bug causing non-optimal match insertion idx searching when there are 10k+ matches per scanner.
Change 4680963 by Leigh.Swift
BuildPatchTool: ChunkDeltaOptimise mode is now FeatureLevel upgrade / downgrade aware.
Change 4680947 by Leigh.Swift
BuildPatchTool: Compactify speed improvements for massive network cloud directories.
Change 4656991 by Leigh.Swift
BuildPatchServices: Make sure chunk writer robustly discovers if a chunk fails to save out.
Change 4647815 by Leigh.Swift
Upping the minimum wait time for UdpMessageBeacon thread so that it will not always wait 0ms when network sends are failing, reducing disconnect CPU usage.
Adding configurable tick rate logic to XmppConnectionJingle thread. It will now default to 100Hz max.
Change 4627355 by Michael.Trepka
Fixed a problem with CEF being unable to find locale pak files on Mac for certain language/region combinations
Change 4620800 by Leigh.Swift
Fix for CEF crash when disabling a web window that has not yet got a parent window. There's no need to worry about focus in this case.
Change 4590207 by Leigh.Swift
BuildPatchTool: PackageChunks mode now supports FeatureLevel arg
Change 4590103 by leigh.swift
BuildPatchTool: Adding new mode ChunkDeltaOptimise which reducing the download size when patching between two specific builds in a specific direction.
BuildPatchTool: Updated Enumeration, DiffManifests, Compactify, PackageChunks, and VerifyChunks modes to take account of new delta data.
BuildPatchServices: Installers now have a single shared memory chunk store, which reduces the requirement for booting
Change 4590089 by Leigh.Swift
BuildPatchTool: Adding new mode ChunkDeltaOptimise which reducing the download size when patching between two specific builds in a specific direction.
BuildPatchTool: Updated Enumeration, DiffManifests, Compactify, PackageChunks, and VerifyChunks modes to take account of new delta data.
BuildPatchServices: Installers now have a single shared memory chunk store, which reduces the requirement for booting
Change 4341076 by Leigh.Swift
BuildPatchServices: Making FBuildPatchAppManifest::GetRemovableFiles more robust to handle directories with or without trailing slash.
Change 4331754 by Leigh.Swift
BuildPatchTool: Added support for selecting ChunkWindowSize when generating patches.
BuildPatchTool: Added support for providing the FeatureLevel command-line argument to indicate the data version that should be saved out by patch generation. This warns about defaulting to LatestJson if not provided.
BuildPatchTool: Added support for generating patches with recognition for any chunks with any ChunkWindowSize found in the provided CloudDir.
BuildPatchTool: Added command-line -IgnoreOtherWindowSizes param which if provided, the generation code will only accept chunk matches that are the same as ChunkWindowSize.
BuildPatchServices: Fixes for supporting installations that use any ChunkWindowSize.
BuildPatchServices: New manifest file format to reduce file size, this is now raw compressed binary data.
#lockdown Nick.Penwarden
#rb none
[CL 8675597 by Leigh Swift in Main branch]
204 lines
10 KiB
C++
204 lines
10 KiB
C++
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ToolModes/PackageChunksMode.h"
|
|
#include "Interfaces/IBuildPatchServicesModule.h"
|
|
#include "BuildPatchTool.h"
|
|
#include "Misc/CommandLine.h"
|
|
#include "Misc/Paths.h"
|
|
#include "Algo/Find.h"
|
|
|
|
using namespace BuildPatchTool;
|
|
|
|
class FPackageChunksToolMode : public IToolMode
|
|
{
|
|
public:
|
|
FPackageChunksToolMode(IBuildPatchServicesModule& InBpsInterface)
|
|
: BpsInterface(InBpsInterface)
|
|
{}
|
|
|
|
virtual ~FPackageChunksToolMode()
|
|
{}
|
|
|
|
virtual EReturnCode Execute() override
|
|
{
|
|
// Parse commandline.
|
|
if (ProcessCommandline() == false)
|
|
{
|
|
return EReturnCode::ArgumentProcessingError;
|
|
}
|
|
|
|
// Print help if requested.
|
|
if (bHelp)
|
|
{
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("PACKAGE CHUNKS MODE"));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("This tool mode supports packaging data required for an installation into larger files which can be used as local sources for build patch installers."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(""));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("Required arguments:"));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -mode=PackageChunks Must be specified to launch the tool in package chunks mode."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -FeatureLevel=Latest Specifies the client feature level to output data for. See BuildPatchServices::EFeatureLevel for possible values."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -ManifestFile=\"\" Specifies in quotes the file path to the manifest to enumerate chunks from."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -OutputFile=\"\" Specifies in quotes the file path the output package. Extension of .chunkdb will be added if not present."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(""));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("Optional arguments:"));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -PrevManifestFile=\"\" Specifies in quotes the file path to a manifest for a previous build, this will be used to filter out chunks, such that the"));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" produced chunkdb files will only contain chunks required to patch from this build to the one described by ManifestFile."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -CloudDir=\"\" Specifies in quotes the cloud directory where chunks to be packaged can be found."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -MaxOutputFileSize= When specified, the size of each output file (in bytes) will be limited to a maximum of the provided value."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -ResultDataFile=\"\" Specifies in quotes the file path where the results will be exported as a JSON object."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -TagSets=\",t1,t2\" Specifies in quotes a comma seperated tagset for filtering of data saved. Multiple sets can also be provided to split the chunkdb files by tagsets."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" Untagged files will be referenced with an empty tag, which you can specify using an extra comma."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" -PrevTagSet=\",tA,tB\" Specifies in quotes a comma seperated tagset for filtering of input data usable from PrevManifestFile. This will increase the amount of chunks"));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" saved out by reducing the number of files from the input manifest that are assumed usable. Only one PrevTagSet should be provided."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" Untagged files will be referenced with an empty tag, which you can specify using an extra comma."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(""));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("NB: If CloudDir is not specified, the manifest file location will be used as the cloud directory."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("NB: If an optimised delta was available, the file extension .delta.chunkdb will be used."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("NB: MaxOutputFileSize is recommended to be as large as possible. The minimum individual chunkdb filesize is equal to one chunk plus chunkdb"));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" header, and thus will not result in efficient behavior."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("NB: If MaxOutputFileSize is not specified, the one output file will be produced containing all required data."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("NB: If MaxOutputFileSize is specified, the output files will be generated as Name.part01.chunkdb, Name.part02.chunkdb etc. The part number will"));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" have the number of digits required for highest numbered part."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("NB: If MaxOutputFileSize is specified, then each part can be equal to or less than the specified size, depending on the size of the last chunk"));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" that fits."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT("NB: When providing multiple -TagSets= arguments, all data from the first -TagSets= arg will be saved first, followed by any extra data needed for the second -TagSets= arg, and so on in separated chunkdb files."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" Note that this means the chunkdb files produced for the second -TagSets= arg and later will not contain some required data for that tagset if the data already got saved out as part of a previous tagset."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" The chunkdb files are thus additive with no dupes."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" If it is desired that each tagset's chunkdb files contain the duplicate data, then PackageChunks should be executed once per -TagSets= arg rather than once will all -TagSets= args."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" An empty tag must be included in one of the -TagSets= args to include untagged file data in that tagset, e.g. -TagSets=\" , t1\"."));
|
|
UE_LOG(LogBuildPatchTool, Display, TEXT(" Adding no -TagSets= args will include all data."));
|
|
return EReturnCode::OK;
|
|
}
|
|
|
|
// Setup and run.
|
|
BuildPatchServices::FPackageChunksConfiguration Configuration;
|
|
if (!BuildPatchServices::FeatureLevelFromString(*FeatureLevel, Configuration.FeatureLevel))
|
|
{
|
|
UE_LOG(LogBuildPatchTool, Error, TEXT("Provided FeatureLevel is not recognised. Invalid arg: -FeatureLevel=%s"), *FeatureLevel);
|
|
return EReturnCode::ArgumentProcessingError;
|
|
}
|
|
Configuration.ManifestFilePath = ManifestFile;
|
|
Configuration.PrevManifestFilePath = PrevManifestFile;
|
|
Configuration.TagSetArray = TagSetArray;
|
|
Configuration.PrevTagSet = PrevTagSet;
|
|
Configuration.OutputFile = OutputFile;
|
|
Configuration.CloudDir = CloudDir;
|
|
Configuration.MaxOutputFileSize = MaxOutputFileSize;
|
|
Configuration.ResultDataFilePath = ResultDataFile;
|
|
|
|
// Run the enumeration routine.
|
|
bool bSuccess = BpsInterface.PackageChunkData(Configuration);
|
|
return bSuccess ? EReturnCode::OK : EReturnCode::ToolFailure;
|
|
}
|
|
|
|
private:
|
|
|
|
bool ProcessCommandline()
|
|
{
|
|
#define HAS_SWITCH(SwitchVar) (Algo::FindByPredicate(Switches, [](const FString& Elem){ return Elem.StartsWith(TEXT(#SwitchVar "="));}) != nullptr)
|
|
#define PARSE_SWITCH(SwitchVar) ParseSwitch(TEXT(#SwitchVar "="), SwitchVar, Switches)
|
|
#define PARSE_SWITCHES(SwitchesVar) ParseSwitches(TEXT(#SwitchesVar "="), SwitchesVar, Switches)
|
|
TArray<FString> Tokens, Switches;
|
|
FCommandLine::Parse(FCommandLine::Get(), Tokens, Switches);
|
|
|
|
bHelp = ParseOption(TEXT("help"), Switches);
|
|
if (bHelp)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// Grab the FeatureLevel. This is required param but safe to default, we can change this to a warning after first release, and then an error later, as part of a friendly roll out.
|
|
PARSE_SWITCH(FeatureLevel);
|
|
FeatureLevel.TrimStartAndEndInline();
|
|
if (FeatureLevel.IsEmpty())
|
|
{
|
|
UE_LOG(LogBuildPatchTool, Log, TEXT("FeatureLevel was not provided, defaulting to LatestJson. Please provide the FeatureLevel commandline argument which matches the existing client support."));
|
|
FeatureLevel = TEXT("LatestJson");
|
|
}
|
|
|
|
// Get all required parameters.
|
|
if (!(PARSE_SWITCH(ManifestFile)
|
|
&& PARSE_SWITCH(OutputFile)))
|
|
{
|
|
UE_LOG(LogBuildPatchTool, Error, TEXT("ManifestFile and OutputFile are required parameters"));
|
|
return false;
|
|
}
|
|
NormalizeUriFile(ManifestFile);
|
|
NormalizeUriFile(OutputFile);
|
|
|
|
// Get optional parameters.
|
|
PARSE_SWITCH(PrevManifestFile);
|
|
PARSE_SWITCH(ResultDataFile);
|
|
NormalizeUriFile(PrevManifestFile);
|
|
NormalizeUriFile(ResultDataFile);
|
|
PARSE_SWITCHES(TagSets);
|
|
PARSE_SWITCH(PrevTagSet);
|
|
|
|
if (!PARSE_SWITCH(CloudDir))
|
|
{
|
|
// If not provided we use the location of the manifest file.
|
|
CloudDir = FPaths::GetPath(ManifestFile);
|
|
}
|
|
NormalizeUriPath(CloudDir);
|
|
|
|
if (HAS_SWITCH(MaxOutputFileSize))
|
|
{
|
|
if (!PARSE_SWITCH(MaxOutputFileSize))
|
|
{
|
|
// Failing to parse a provided MaxOutputFileSize is an error.
|
|
UE_LOG(LogBuildPatchTool, Error, TEXT("MaxOutputFileSize must be a valid uint64"));
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// If not provided we don't limit the size, which is the equivalent of limiting to max uint64.
|
|
MaxOutputFileSize = TNumericLimits<uint64>::Max();
|
|
}
|
|
|
|
// Process the tagsets that we parsed.
|
|
if (TagSets.Num() > 0)
|
|
{
|
|
for (const FString& TagSet : TagSets)
|
|
{
|
|
TArray<FString> Tags;
|
|
const bool bCullEmpty = false;
|
|
TagSet.ParseIntoArray(Tags, TEXT(","), bCullEmpty);
|
|
for (FString& Tag : Tags)
|
|
{
|
|
Tag.TrimStartAndEndInline();
|
|
}
|
|
// If we ended up with an empty array, the intention would have been to pass a tagset that contains just an empty string, so make that fixup.
|
|
if (Tags.Num() == 0)
|
|
{
|
|
Tags.Add(TEXT(""));
|
|
}
|
|
TagSetArray.Emplace(Tags);
|
|
}
|
|
}
|
|
|
|
return true;
|
|
#undef PARSE_SWITCHES
|
|
#undef PARSE_SWITCH
|
|
#undef HAS_SWITCH
|
|
}
|
|
|
|
private:
|
|
IBuildPatchServicesModule& BpsInterface;
|
|
bool bHelp;
|
|
FString FeatureLevel;
|
|
FString ManifestFile;
|
|
FString PrevManifestFile;
|
|
FString OutputFile;
|
|
FString ResultDataFile;
|
|
FString CloudDir;
|
|
uint64 MaxOutputFileSize;
|
|
TArray<FString> TagSets;
|
|
TArray<TSet<FString>> TagSetArray;
|
|
TSet<FString> PrevTagSet;
|
|
};
|
|
|
|
BuildPatchTool::IToolModeRef BuildPatchTool::FPackageChunksToolModeFactory::Create(IBuildPatchServicesModule& BpsInterface)
|
|
{
|
|
return MakeShareable(new FPackageChunksToolMode(BpsInterface));
|
|
}
|