Commit Graph

58 Commits

Author SHA1 Message Date
paul chipchase
5388a344ec [UVT] Add a log line showing when engine pre init ends and the tool begins.
#rb Juan.Legaz
#jira UE-224646
#rnx

[CL 36385338 by paul chipchase in 5.5 branch]
2024-09-18 07:11:21 -04:00
paul chipchase
82875561f5 [UVT] Do not try to virtualize packages marked fro delete or ignore in revision control.
#rb PJ.Kack
#jira UE-224194

- Previously we passed all files in the changelist to the virtualization process which would result in errors when the process tried to open deleted packages for reading.
- We now skip packages marked for delete and packages marked for ignore, the latter won't be submitted so there is no point virtualizing them.

[CL 36259805 by paul chipchase in 5.5 branch]
2024-09-13 06:21:24 -04:00
paul chipchase
5f786cb50e UnrealVirtualizationTool can now pass the cmdline arg '-fastexit' to spawned child processes.
#rb Juan.Legaz
#rnx

[CL 35695899 by paul chipchase in ue5-main branch]
2024-08-21 08:10:48 -04:00
paul chipchase
8dddb6d539 Add a cmdline arg '-ReportFailures' to UnrealVirtualizationTool that raises an ensure if the process fails.
#rb Juan.Legaz
#jira UE-222213
#rnx

- At the moment most projects allow submits with failed virtualization attempts to continue uninterrupted but that means we rely on users reporting issues to us. By raising an ensure we will get a report sent to our crash reporting systems which we can use to dig into the problems. This system will be opt in via the cmdline arg.
- The cmdline arg will be passed onto any spawned child processes so that they will report too.
-- Note that we also now pass '-fastexit' onto the child processes which was not done before.
- We only raise an ensure if the problem occurred in the current process, it is expected that child processes will raise their own.
-- We use a new enum EProcessResult to pass this info around.
- The log filtering has been extended to filter out warning/error messages normally logged when an ensure fires as these will concern the end users, we don't want the reporting to not interrupt their day to day work either.

[CL 35695506 by paul chipchase in ue5-main branch]
2024-08-21 07:56:23 -04:00
paul chipchase
3102beb73c Strip out additional features from UnrealVirtualizationTool that it does not need.
#rb Per.Larsson
#rnx

[CL 35417093 by paul chipchase in ue5-main branch]
2024-08-09 03:31:51 -04:00
paul chipchase
2c7d41621b Fix a bug where UVT invoking a child process would fail if the engine root path or the target project path has spaces in it.
#rb Juan.Legaz
#jira UE-221396

- When invoking a child process UVT will pass in the path of the target .uproject file as well as a path to a .inputfile containing the details of the operation to run. If either of these paths contained whitespace then they would fail to parse correctly and either the target project would not be correctly set or  the input file would not be readable.
- We now properly escape the args so that the whole paths are parsed, even when containing whitespace.

[CL 35393883 by paul chipchase in ue5-main branch]
2024-08-08 09:14:30 -04:00
paul chipchase
a903eb52c9 [UVT] Clean up the child process files after use.
#rb Per.Larsson
#jira UE-215823
#rnx

- When the UVT needs to launch a child process we send it info on the command to run via a .input file and in turn the child process will write out a .output file to return info to the calling process.
- This change will now attempt to delete these files after we are done with them.
- If the delete fails we will raise a warning rather than an error as it is not essential that the files be deleted.

[CL 33923415 by paul chipchase in ue5-main branch]
2024-05-27 09:53:48 -04:00
zousar shaker
95ce2445c4 Adding internal API to allow monolithic programs to optionally accept a uproject as a first argument and use that as its project directory even if it is an engine executable.
#rb paul.chipchase

[CL 33084091 by zousar shaker in ue5-main branch]
2024-04-18 16:23:21 -04:00
paul chipchase
f22d747a98 UnrealVirtualizationTool now accepts the P4Port and P4User values on the commandline.
#rb Juan.Legaz
#jira UE-212182
#rnx

- Clean up some of the logging to be tab aligned.
- Add an additional line of logging showing how many files were found in the changelist. Previously I was only logging how many packages (.umap/.uasset) were found in the changelist

[CL 33002544 by paul chipchase in ue5-main branch]
2024-04-16 11:37:24 -04:00
paul chipchase
1a840070b0 Improve the initialization logging when starting up UnrealVirtualizationTool.
#rb Per.Larsson
#rnx

- Log which perforce server the tool connects too as sometimes it is not what we expect.
- Expanded code comments explaining why the CommandBase has two different source control provider pointer/references.

[CL 32925630 by paul chipchase in ue5-main branch]
2024-04-12 07:16:59 -04:00
paul chipchase
d8024ee02b [UVT] Fix a bug where the child process was launched with an incorrect stdin pipe attached.
#rb Per.Larsson
#rnx

- The problem with the process set up is described properly in UE-208628, but the quick summary is that a lot of our code is creating a single pipe, then using the input as stdin and the output as stdout when launching a child process so if that process ever did read from stdin it would end up using it's own output. Then we are copy/pasting the same bug around the code base,
- Fixed the problem by adding a second pipe to FProcessPipes.

[CL 32465578 by paul chipchase in ue5-main branch]
2024-03-25 04:43:00 -04:00
paul chipchase
1ecf629377 [UVT] Further reduce the size of the tool
#rb PJ.Kack
#rnx

- Minimal increase in compile time (+1.5s for full rebuild) but a significant reduction in exe/pdb size.

[CL 29929818 by paul chipchase in ue5-main branch]
2023-11-27 02:25:44 -05:00
paul chipchase
76579b36a8 [UVT] Fix a bug where running the tool on a changelist from a project that has not enabled virtualization would give an error.
#rb PJ.Kack
#jira UE-198032
#rnx

- Running the virtualization process on a project without virtualization enabled will mount a 'FNullVirtualizationSystem' which will return errors when actually used.
- Now, once we initialize the virtualization system we check to see if it is actually enabled and if not we early out at this point. It's quicker and does not result in an error being logged.

[CL 28833521 by paul chipchase in ue5-main branch]
2023-10-17 04:02:28 -04:00
paul chipchase
9775cb2f90 [UVT] Minor logging improvements
#rb PJ.Kack
#rnx

- Do not log if '-MinimalLogging' is set in the cmdline. If it is set then the tool is supposed to only display non-technical info and the user probably doesn't care about the flag. If we need to check the state of it, the log file will contain the processes cmdline anyway.
- Add a missing tab to the logging in FUnrealVirtualizationToolApp::TrySortFilesByProject to keep it aligned.

[CL 28833497 by paul chipchase in ue5-main branch]
2023-10-17 04:00:51 -04:00
josh adams
aeb5cb1347 - Restoring a backout after fixing the issue that causes the backout
[Backout] - CL27745134
[FYI] stan.hormell
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL27731288 - CIS / Build Errors
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
- Deprecated GetSectionPrivate and FindOrAddSection, and accessors in FConfigFile that could return a non-const FConfigSection (this is so we can track modifications to config values)
- Added AddToSection, RemoveKeyFromSection, etc to replace directly accessing a FConfigSection
- Fixed up Epic code for the deprecations (at least the majority, some projects that aren't built by Horde presubmit may have some that we will address going forward)
#jira UE-194955
#rb david.harvey and various others

[CL 27923017 by josh adams in ue5-main branch]
2023-09-15 13:39:02 -04:00
josh adams
4b18982678 - Fixed a deprecation from config system changes
#rb trivial

[CL 27732058 by josh adams in ue5-main branch]
2023-09-08 18:17:55 -04:00
robert millar
2ac24cb374 Add target rules option for enabling trace.
#rb ionut.matasaru

[CL 27011549 by robert millar in ue5-main branch]
2023-08-10 17:10:14 -04:00
johan berg
a6d6caa97f No master fix for UnrealVirtualizationTool
#jira UE-192221
#rb paul.chipchase

[CL 26883694 by johan berg in ue5-main branch]
2023-08-07 11:14:23 -04:00
paul chipchase
5c23270845 Log the time taken to virtualize/hydrate when using the UnrealVirtualizationTool
#rb trivial
#jira none
#rnx
#preflight 64622a40cf788a25582851cd

- Virtualization/hydration can be quite slow. We should log the time taken so that it is easier for users to see if something is abnormally slow and report it.
- Small code cleanup in the hydration code to move the ::UnRegisterMountPoints call to a ON_SCOPE_EXIT

[CL 25472139 by paul chipchase in ue5-main branch]
2023-05-15 08:59:03 -04:00
paul chipchase
cda88edd26 [UVT] Allow the tool to discover custom plugins
#rb none
#jira UE-181761
#rnx
#preflight 644643bab14f1faacf8a1536

- When the tool was created we tried to avoid discovering all plugins as it was very slow. Since then it has been optimized and only costs 500ms or so, which for now is acceptable. So now we allow plugins to be discovered in the normal way. If the plugins have been set up correctly to work with the tool then they will be loaded.
- Note that the perforce plugin still needs to be mounted manually, but no longer needs the paths adding.
- Removed UE_DISABLE_PLUGIN_DISCOVERY from the Target.cs so that we scan for all plugins on startup.
- Removed adding of perforce to AdditionalPlugins in the Target.cs as it wasn't really doing anything.

[CL 25161223 by paul chipchase in ue5-main branch]
2023-04-24 05:07:38 -04:00
ionut matasaru
3d7c0e8440 UBT: Removed deprecated TargetInfo::bUseMallocProfiler toggle in Source/Programs.
#jira UE-141779
#rb Joe.Kirchoff
#rb Johan.Berg
#preflight 64380aea7a00790bfd116430

[CL 25101875 by ionut matasaru in ue5-main branch]
2023-04-19 04:15:59 -04:00
paul chipchase
f9c8066d0d [UVT] Improve the reliability of establishing revision control connections when using the tool to checkout or submit packages
#rb none
#jira UE-151641
#rnx
#preflight 642599a738075fa13fe70c7e

- Changed the logic of TryConnectToSourceControl so that if a project is set we try to use the projects existing revision control settings for the default provider (which is the provider that will be used by the virtualization/rehydration process), if the project is not set then the only revision control operation that should occur is parsing of an existing changelist to find the files that we might want to operate on.
-- As we now also use the default provider we cannot use a single TUniquePtr as we do not own the pointer to the default provider. So there is a general pointer to be used for the current active provider and a TUniquePtr if we own the provider.
- Added calls to ::TryConnectToSourceControl if a command is setting the Checkout flag which should ensure that the packages will be able to be checked out.

[CL 24854420 by paul chipchase in ue5-main branch]
2023-03-30 11:05:15 -04:00
paul chipchase
7b92bdae2f [UVT] The tool now supports the '-fastexit' commandline option
#rb none
#jira none
#rnx
#preflight 64258067b72410fc17a11f03

- The main goal was to prevent the GConfig from flushing to disk on shutdown as we do not want the tool to do that.
- We can do this by disabling the disk operations for GConfig or forcing the process to terminate, the latter of which we support in commandlets via the cmdline option '-fastexit'

[CL 24852905 by paul chipchase in ue5-main branch]
2023-03-30 08:47:06 -04:00
paul chipchase
888406f7f4 [UVT] Fix issue preventing the rehydration command from checking out packages on demand
#rb none
#jira UE-151641
#rnx
#preflight 642574c0974dfaa53cae8be2

- The checkout cmdline option was not being serialized to the child process correctly.

[CL 24852626 by paul chipchase in ue5-main branch]
2023-03-30 07:58:45 -04:00
paul chipchase
8417cde7dd [UVT] Properly apply the project path being supplied via the commandline (if there is one)
#rb trivial
#jira UE-151641
#rnx
#preflight 64103cb1c41a0a2a770c96a4

- Although we now relaunch the tool with the correct project path (if not supplied) this was not enough to allow us to load the projects config files and so set up the DDC and source control etc properly. My original testing was picking up hacks in the programs config file that was allowing it to work.
- FGenericPlatformMisc::ProjectDir has a bespoke path for standalone programs which means even if the uproject is on the cmdline it is ignored.
- We probably should look into a way for a project to mark itself as being "project aware" but for now we can make use of the project path override system to make sure it is set correctly, which will fix the problem for now.

[CL 24631824 by paul chipchase in ue5-main branch]
2023-03-14 05:36:41 -04:00