Commit Graph

1756 Commits

Author SHA1 Message Date
joe kirchoff
2864b992e7 UnrealBuildTool: Remove defunct HybridExecutor
[CL 28293691 by joe kirchoff in ue5-main branch]
2023-09-27 17:10:23 -04:00
joe kirchoff
a6e94ff649 UnrealBuildTool: Invalidate makefile if a header only directory is added or removed
#jira UE-191921

[CL 28257409 by joe kirchoff in ue5-main branch]
2023-09-26 20:28:19 -04:00
henrik karlsson
65b9042153 [UBT]
* Added support for pch using header units.

#rb joe.kirchoff

[CL 28138630 by henrik karlsson in ue5-main branch]
2023-09-22 11:51:23 -04:00
rob perren
a6b5dd69df Add support to ConfigCache.cs to allow a hotfix directory to be specified which will allow additions and overrides to specified in a similar way to the runtime hotfixing system
#rb Josh.Adams
#rnx

[CL 27669033 by rob perren in ue5-main branch]
2023-09-07 07:25:22 -04:00
niklas rojemo
528b8e6d85 IR->bytecode lowering: map and iteration over maps
VerseCLR can now compile verse code with maps, and iterations over maps, to the new VM.
Fix unrelated bug triggered by nested for-iterations over arrays, returning an array of arrays.

#rb Saam.Barati
#rnx

[CL 27582449 by niklas rojemo in ue5-main branch]
2023-09-04 04:06:16 -04:00
saam barati
7157db4ca9 Don't allocate tuples unnecessarily for calls with multiple arguments
#rb markus.breyer

This patch makes it so calls with multiple arguments don't require a tuple allocation. We just allow functions to have multiple arguments and be called normally. However, when such functions are invoked with a tuple, we'll unbox the tuple into the argument slots.

We also allow functions with single-param-as-tuple to be invoked with multiple arguments. And such functions will box the arguments into a tuple when being called.

A function with N arguments now take up the first N register slots in the frame.

This patch also fills out some more of the bytecode generator to make some tests I wrote work.

[CL 27510491 by saam barati in ue5-main branch]
2023-08-30 20:56:02 -04:00
tim smith
d758896471 Move VerseVM to CoreUObject to facilitate the merging of UEGC and VerseGC
#rb saam.barati phil.pizlo

[CL 27374952 by tim smith in ue5-main branch]
2023-08-25 09:08:53 -04:00
joe kirchoff
9b2f302d4b UnrealBuildTool: Always enable ValidateFormatStrings for engine modules, and create a pch variant for modules that opt out
#rnx

[CL 27352456 by joe kirchoff in ue5-main branch]
2023-08-24 14:59:44 -04:00
joe kirchoff
092ff454ad [Backout] - CL27330584
[FYI] Joe.Kirchoff
Original CL Desc
-----------------------------------------------------------------
UnrealBuildTool: Always enable ValidateFormatStrings for engine modules, and create a pch variant for modules that opt out

#rnx

[CL 27331965 by joe kirchoff in ue5-main branch]
2023-08-23 22:16:13 -04:00
joe kirchoff
c0b34f9bb3 UnrealBuildTool: Always enable ValidateFormatStrings for engine modules, and create a pch variant for modules that opt out
#rnx

[CL 27330607 by joe kirchoff in ue5-main branch]
2023-08-23 20:55:29 -04:00
kirill zorin
6b206ca86d Turning on FormatStringSan in UBT
#rb joe.kirchoff

[CL 27314833 by kirill zorin in ue5-main branch]
2023-08-23 14:49:29 -04:00
neil henning
f222493c8a Make CPP files on windows depend on the AutoRTFM compiler version if we are using it.
#rb joe.kirchoff

[CL 27302143 by neil henning in ue5-main branch]
2023-08-23 07:19:35 -04:00
joe kirchoff
94452e2f5d UnrealBuildTool: Update BuildSettingVersion for temp generated projects
#rnx

[CL 27247806 by joe kirchoff in ue5-main branch]
2023-08-21 14:31:25 -04:00
robert srinivasiah
3e991908f7 UBT: Generate RulesFileCache for temporary targets created for hybrid projects
When we have hybrid projects, we add temporary target and build files in Intermediate/Source. We need to regenerate the RulesFileCache for that temporary folder.
If we don't, our 'initial' attempt to BuildCookRun a project will fail because we won't discover any target files because of an invalid cache entry.

#jira UE-190114 UE-193398
#rb Kriss.Gossart Jeff.Fisher

[CL 27246945 by robert srinivasiah in ue5-main branch]
2023-08-21 14:09:10 -04:00
jeff fisher
d5fbfa08db UE-189611 ARImageDetection Fails to Launch on Android - Error: Unable to load plugin 'XRBase'
-The logic in NativeProjects.cs IsHybridContentOnlyProject which decides whether we need to build an executable for a project was always using the buildhost platform (usually win64) to decide which plugins were active.  This caused it to miss enabled code plugins that build for the actual target platform but not the host platform and potentially not do an executible build when one is required.
-Now we pass the TargetPlatforms for the current build into ConditionalMakeTempTargetForHybridProject so that we can test against them.  If any project in this list needs code built we will make a temp target.
#jira UE-189611 UE-192833
#rb Josh.Adams

[CL 27101769 by jeff fisher in ue5-main branch]
2023-08-15 10:07:26 -04:00
joe kirchoff
c44fc5fd4a UnrealBuildTool: Print action groups in parallel executor when building multi target
#rnx

[CL 27006666 by joe kirchoff in ue5-main branch]
2023-08-10 15:38:17 -04:00
joe kirchoff
4f5e1d5b1c UnrealBuildTool: Don't short circuit adaptive builds if all cpp in a module are in the working set
#rnx

[CL 27001130 by joe kirchoff in ue5-main branch]
2023-08-10 14:19:38 -04:00
markus breyer
828a18c45e New temporary target rule property bUseVerseBPVM
#rb andrew.scheidecker, joe.kirchoff
#rnx

[CL 26996866 by markus breyer in ue5-main branch]
2023-08-10 12:45:45 -04:00
leon huang
721ed16c42 Unreal Build Tool:
Update PluginDescriptor to have parity with FPluginDescriptor in terms of handling custom JSON fields. The order in which the original fields are written to disk is preserved.
When saving the PluginDescriptor to disk, the same order is followed and any new entries are added to the end of the plugin file.
Note: PluginDescriptor.Save and PluginDescriptor.Save2 will exist concurrently for now. There are still parts of UBT that use PluginDescriptor.Write and the refactor to create a unified Save function will come later as a lot of testing still needs to be done.
JsonObject:
- Introduced AddOrSetFieldValue() methods overloaded on value types to add/set fields in JsonObject.
- Changed the underlying data structure of JsonObject from Dictionary<string,Object?> to OrderedDictionary to guarantee that order of all .uplugin fields (default and custom) are preserved
- Made the JsonObject constructor that takes an OrderedDictionary private to ensure type safety of values passed to JsonObject
- Introduced ToJsonString() for JsonObject that serializes the JsonObject to match the formatting of .uplugin
IMPORTANT: The ToJsonString() method uses the JavaScriptEncoder.UnsafeRelaxedJsonEscaping encoder for Utf8JsonWriter.
This allows +,<,>,&,` etc characters to be written properly for .uplugins. As per MS docs, with this encoding, none of the contents should be written to HTML or a script.
- Introduced JsonObjectTests that unit tested JsonObject to ensure previous behavior was maintained.
- Ensured that keys for the JsonObject are processed in a case insensitive and culture independent way.

PluginDescriptor
- Added a JsonObject field that acts as the cache of all fields that were read from a file or parsed from a json string.
- Cached JsonObject records the order of all fields that were read and captures custom fields in the .uplugin
- Introduced Save2(), the new save algorithm that writes all fields (default and custom) to disk.
- Deleted the private default constructor because it didn't seem to be used anywhere.
- Introduced PluginDescriptorTests to ensure previous behavior is maintained. In particular when dealing with a .uplugin with only default fields, results of Save() and Save2() are the same.

Descriptor Files:
- Introduced ToJsonObject() methods to replace the previous JsonWriter patterns of writing the descriptor data.
- Introduced the UpdateJsonObject pattern which mimics the old WriteArray pattern of writing data to a JsonWriter.

#rb: Mark.Winter, Joe.Kirchoff
#jira: none
#test: Developed this in a TDD style with unit tests for all the major functions. Also reviewed output of created .uplugins and diffed them.

[CL 26920712 by leon huang in ue5-main branch]
2023-08-08 12:52:41 -04:00
chris constantinescu
199373a78d UBT new plugin test - generate solution doesn't include create new target
#rb Jerome.Delattre, Eric.Day
#jira UE-192402

[CL 26919864 by chris constantinescu in ue5-main branch]
2023-08-08 12:26:25 -04:00
andrew grant
8168aa1717 Change UBT limiting of actions based on memory to use total ram on Mac instead of free ram.
This addresses issues with CPU resources on Mac going under utilized on systems where total RAM is only 2-3x the number of cores (e.g 8c/16GB, 10c/32GB) and the user has applications running (UE, XCode, browsers) that are occupying RAM.

Historically this check limited actions based on free memory to ensure action processes weren't forced to use swap, but there's strong evidence that limiting based on total system memory and relying on the OS to swap out other processes to make room is fine. That said only Mac has been extensively tested here in this scenario (and tends to have faster disk performance than other platforms). So for now we'll change Mac and leave Windows/Linux using the old behavior

Tests -

* Ran on an M1 8c/16GB Mac with Xcode & UE open and compared core utilization before (5) to after this change (8)
* Loaded up a bucket-load of apps, browser tabs, and a running game and verified engine built successfully 2x with no compiler OOMs

#jira UE-192238
#rb swarm
#swarm [at]Joe.Kirchoff [at]Zack.Neyland

[CL 26906094 by andrew grant in ue5-main branch]
2023-08-07 19:49:26 -04:00
andrew grant
725db830a1 Fixes regression where BenchmarkBuild script would not reliably measure build performance.
The fix is to restore the <= 5.1 behavior of UBT where the MaxParallelActions argument specifies the maximum number of actions to execute in parallel, not a cap on UBTs heuristic-based selection.

This change also modifies BenchmarkBuild so it will default to the available processor count if no -cores argument is specified. This ensures the behavior of repeated runs will be deterministic as UBT may select different values if the system free memory changes

#jira UE-192236
#rb swarm
[REVIEW] [at]Joe.Kirchoff
#tests Ran UBT / BenchmarkBuild with arguments that forces the number of actions higher than the locally available core count

[CL 26889927 by andrew grant in ue5-main branch]
2023-08-07 13:35:03 -04:00
henrik karlsson
97a4015f60 [UBT]
* Added actions first produced item directory path as part of sorting for scheduling. This groups modules together nicely which will benefit when running things remotely where remotes takes batches of actions at the time meaning there is a higher chance each remote helper will need to download fewer variations of pch files

#rb  joe.kirchoff

[CL 26856192 by henrik karlsson in ue5-main branch]
2023-08-04 15:04:09 -04:00
kirill zorin
b36d22897c Deprecating non-TObjectPtr FReferenceCollector::AddReferencedObject(s) API.
#rb andrew.scheidecker, marc.audy

[CL 26821499 by kirill zorin in ue5-main branch]
2023-08-03 14:53:09 -04:00
joe kirchoff
da089d0875 Support for .natstepfilter
#rnx
#jira UE-190863
#jira UE-191341

#ushell-cherrypick of 26715542 by Joe.Kirchoff

[CL 26723680 by joe kirchoff in ue5-main branch]
2023-07-31 18:02:16 -04:00