Commit Graph

39 Commits

Author SHA1 Message Date
ben marsh
1d327afd66 Horde: Allow setting a tag for unmanaged memory allocations that helps identify it for tracking down memory leaks.
[CL 31395941 by ben marsh in ue5-main branch]
2024-02-12 15:40:15 -05:00
ben marsh
46ab79d2a9 Horde: Upgrade server to NET 8.0.
- Shared libraries still default to building as NET 6, but are forced to build against NET 8 using the UE_DOTNET_VERSION environment variable for running tests in Docker.

[FYI] Joe.Kirchoff, Joakim.Lindqvist

[CL 30509382 by ben marsh in ue5-main branch]
2024-01-09 12:43:29 -05:00
joe kirchoff
e5618b4c2d EpicGames.Core: Don't throw a new Exception when a JsonException occurs when parsing
#rnx
#jira UE-196461

[CL 30310003 by joe kirchoff in ue5-main branch]
2023-12-13 19:01:45 -05:00
carl bystrom
6e4f5712f2 Horde: Add support for AppContainers in ManagedProcess
#rb Ben.Marsh
#rb Joe.Kirchoff

[CL 30300443 by carl bystrom in ue5-main branch]
2023-12-13 14:48:45 -05:00
ben marsh
4373db4c84 Horde: Add helper methods for writing directory trees to storage writers.
[CL 30292017 by ben marsh in ue5-main branch]
2023-12-13 09:45:27 -05:00
ben marsh
aefbd80a6c Horde: Fix static analysis warnings.
#jira

[CL 30262994 by ben marsh in ue5-main branch]
2023-12-12 09:52:18 -05:00
ben marsh
9b3247f601 Horde: Annotate Horde id types with the [LogValueType] attribute, so the dashboard can link them appropriately.
#jira

[CL 30262462 by ben marsh in ue5-main branch]
2023-12-12 09:28:10 -05:00
ben marsh
43b1786bbf Horde: Horde: Add an attribute to indicate that a value that should be tagged with a type name in structured log messages, and a log value type for embedding an external hyperlink into the log output.
#jira

[CL 30262342 by ben marsh in ue5-main branch]
2023-12-12 09:21:42 -05:00
ben marsh
7acd01bd34 EpicGames.Core: Add a deterministic memory allocator to EpicGames.Core for use with large allocations, reducing pressure on the LOH.
* Currently supports allocation from the global heap (GlobalHeapAllocator), through memory mapped files (VirtualMemoryAllocator), or through the standard .NET shared MemoryPool (PoolAllocator).
* ChunkedMemoryWriter now accepts an optional IMemoryAllocator argument for configuring where to obtain chunks from, defaulting to the previous behavior of using the shared .NET memory pool.
* Added a RefCountedMemoryWriter class which can implement reference counting on handles returned by IMemoryAllocator instances.

#jira

[CL 29523179 by ben marsh in ue5-main branch]
2023-11-07 12:09:28 -05:00
Ben Marsh
d4d28cc16a Fix threading issue in AsyncThreadPoolWorkQueueTest.
[CL 28315703 by Ben Marsh in ue5-main branch]
2023-09-28 09:00:21 -04:00
Ben Marsh
977dd674d2 Horde: Fix presubmit tests.
[CL 28200228 by Ben Marsh in ue5-main branch]
2023-09-25 15:24:54 -04:00
Ben Marsh
0f2489886e Update Engine/Source/Programs/Shared to use same .editorconfig rules as Horde.
[CL 27945430 by Ben Marsh in ue5-main branch]
2023-09-16 12:23:02 -04:00
Ben Marsh
14aee7947a Horde: Enable code style warnings in "Analyze" configuration for Horde.Agent and Horde.Agent.TrayApp, and fix current violations.
[CL 27806357 by Ben Marsh in ue5-main branch]
2023-09-12 16:20:59 -04:00
Ben Marsh
a4b39b2df0 EpicGames.Core: Enable code style warnings in Analyze configuration, and fix current violations.
[CL 27798481 by Ben Marsh in ue5-main branch]
2023-09-12 13:23:14 -04:00
Ben Marsh
a18916d4e7 Horde: Various static analyzer fixes.
[CL 27059541 by Ben Marsh in ue5-main branch]
2023-08-12 10:14:12 -04:00
Ben Marsh
26d753ea0b EpicGames.Core: Fix JSON tests.
[CL 26990106 by Ben Marsh in ue5-main branch]
2023-08-10 09:32:36 -04:00
Ben Marsh
9930d40df1 EpicGames.Core: Fix some style warnings.
[CL 26967205 by Ben Marsh in ue5-main branch]
2023-08-09 15:02:35 -04:00
carl bystrom
0d3a177b06 EpicGames.Core: Fix compiler warning
[CL 26964915 by carl bystrom in ue5-main branch]
2023-08-09 14:08:18 -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
Ben Marsh
2fb6142ee2 Horde: Disable max concurrency test. This is not thread safe (on the uniqueTaskIds set), nor deterministic (there is no guarantee that the same task ids will be used for each spawned task).
[CL 26271132 by Ben Marsh in ue5-main branch]
2023-06-27 17:15:22 -04:00
Ben Marsh
a0e00b2992 Horde: Fix IDE2001 warnings about multiple statements on one line.
#fyi Carl.Bystrom

[CL 26271060 by Ben Marsh in ue5-main branch]
2023-06-27 17:10:34 -04:00
carl bystrom
4c79f390eb EpicGames.Core: Add AsyncThreadPoolWorkQueue
[CL 26255939 by carl bystrom in ue5-main branch]
2023-06-27 09:32:14 -04:00
leon huang
e8c7cae7b2 [Backout] - CL26105383
[FYI] Leon.Huang
Original CL Desc
-----------------------------------------------------------------
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.

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 26111662 by leon huang in ue5-main branch]
2023-06-19 21:11:08 -04:00
leon huang
82b1ba105d 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.

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 26105458 by leon huang in ue5-main branch]
2023-06-19 17:00:48 -04:00
Ben Marsh
c8f8537d5c EpicGames.Core: Set a large max degree of parallelism in Json tracer tests.
The default value here is -1, which is equivalent to Environment.ProcessorCount when calling Parallel.ForEachAsync(). This results in a large number of async tasks calling Task.Delay() in sequence, rather than actually running asynchronously, causing the test to take > 60 seconds on machines with low core counts (such as a VM). Increasing this setting to eliminate sequencing allows allows test to complete in < 50ms.

#fyi bryan.sefcik

[CL 25844877 by Ben Marsh in ue5-main branch]
2023-06-07 10:32:50 -04:00