Commit Graph

1005 Commits

Author SHA1 Message Date
Michael Sartain
4bb8a0e646 Fix UnrealBuildTool unused variable warnings
#jira none
#rb Ben.Marsh
#fyi Andrew.Grant, Brandon.Schaefer

[CL 12224860 by Michael Sartain in 4.25 branch]
2020-03-16 19:03:39 -04:00
Ben Marsh
dfe44a2b5c Remove unused variables causing warnings on Mono.
#jira
#rb none
#rnx

[CL 12223682 by Ben Marsh in 4.25 branch]
2020-03-16 17:07:01 -04:00
Ben Marsh
7d1474895f Make sure UBT and HoloLens platforms agree on the architecture being compiled. The architecture setting is now driven by the target being built, and cannot be overridden later. The HoloLens platform returns the default architecture value to UBT, ensuring that intermediate folders and the like are named consistently between builds where an architecture isn't specified (and it uses the default), and and builds where an architecture is explicitly specified.
#rb Steve.Smith
#rnx
#jira

[CL 12167048 by Ben Marsh in 4.25 branch]
2020-03-13 16:20:22 -04:00
Ben Marsh
bf0b702d4b UBT: Fix makefile being invalidated by response files updated during the build process. Also fix certain source files excluded from unity builds from triggering makefile invalidation.
Creation time of the makefile was being used to test whether dependencies have been modified, which is valid for external dependencies (since we want to catch any files modified after the build process starts), but not valid for files we create during the makefile building (such as response files).

Code attempting to detect response files was also incorrect, and would find any leaf files not included in a unity blob. Response files are now detected explicitly.

#rb none
#jira

[CL 12039693 by Ben Marsh in 4.25 branch]
2020-03-06 21:02:25 -05:00
Ben Marsh
71f5ab51b6 Refactor UBT to use an interface (IActionGraphBuilder) to construct the action graph. Response files are also constructed through this interface, allowing them to be tracked as dependencies (will be added in subsequent change).
#rb none
#jira

[CL 12038895 by Ben Marsh in 4.25 branch]
2020-03-06 20:42:36 -05:00
Andrew Grant
f7a1951313 Add Thread_UseAllCpuGroups to UnrealBuildTool config to enable UBT to use both CPU groups on high-core systems such as 64-core ThreadRippers.
See - https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/thread-useallcpugroups-element

Also added MaxParallelActions command-line flag to UBT that can be used to restrict the number of cores used for local (e.g. nonxge).

Added -cores=X+Y=Z option to benchmark script for profiling

#rb swarm
#review-11806361 @ben.marsh
#jira nojira

[CL 11845433 by Andrew Grant in 4.25 branch]
2020-03-02 15:49:57 -05:00
Anthony Bills
3e1df8cd5a Add support for whitelisting additional plugins and adding additional modules to plugin extensions.
Additionally allow monolithic programs inside platform extensions to ouput to the Binaries directory in the extension.

#review-11565119 @brian.white, @josh.adams, @ben.marsh
#jira UE-81798
#rb ben.marsh

[CL 11655119 by Anthony Bills in 4.25 branch]
2020-02-27 10:46:04 -05:00
Ben Marsh
28d11a724c Fix exception running IncludeTool due to include path modules no longer being included in JSON export.
#rb none
#jira UE-89475

[CL 11646035 by Ben Marsh in 4.25 branch]
2020-02-26 21:10:23 -05:00
Ben Marsh
2bd587e62d Remove debug code.
#rb none
#rnx
#jira

[CL 11631935 by Ben Marsh in 4.25 branch]
2020-02-26 11:05:06 -05:00
Ben Marsh
b49030bb94 Fix incorrect force included files in intellisense data.
#rb none
#jira UE-89364

[CL 11631903 by Ben Marsh in 4.25 branch]
2020-02-26 11:02:44 -05:00
Ben Marsh
21d99caf97 Output a warning if the root path is longer than 50 characters.
#rb none
#jira UE-88446
#fyi Martin.Sevigny

[CL 11625250 by Ben Marsh in 4.25 branch]
2020-02-25 21:05:31 -05:00
Ben Marsh
f0d3dbda4a UBT: Output a warning if any intermediate path is > 200 characters under the UE root directory.
#rb none
#jira UE-88446
#fyi Martin.Sevigny

[CL 11624846 by Ben Marsh in 4.25 branch]
2020-02-25 20:48:25 -05:00
Ben Marsh
2a053912fd UBT: Fix error running UBT with -JsonExport if the target instantiates (but decides not to link) a module.
#rb none
#jira UE-88379

[CL 11592316 by Ben Marsh in 4.25 branch]
2020-02-24 18:45:30 -05:00
Ben Marsh
0981320865 Allow single file compile to work with generated cpp files.
#rb none
#jira UE-85511

[CL 11592169 by Ben Marsh in 4.25 branch]
2020-02-24 18:40:06 -05:00
Getty
7c9d0f066f PR #6697: Fix wrong setting name in error message of UEBuildTarget.cs (Contributed by Getty)
#jira UE-88831
#rb none
#rnx

[CL 11592053 by Ben Marsh in 4.25 branch]
2020-02-24 18:18:16 -05:00
Ben Marsh
c3640d846f Generate type library headers as a standalone build action, to eliminate contention when generated by multiple compiler instances.
Also add support for using Visual Studio DTE type libraries from AutoSDK, to fix accessor not working in installed builds built from licensee workspaces.

#jira UE-88791, UE-89124, UE-89162
#rb none

[CL 11590477 by Ben Marsh in 4.25 branch]
2020-02-24 15:44:07 -05:00
Ben Marsh
fd8e320cfd UBT: Add a utility function to create an action that copies from one file to another.
#rb none
#jira
#rnx

[CL 11590405 by Ben Marsh in 4.25 branch]
2020-02-24 15:37:54 -05:00
PierreOlivier Latour
1d307c0dd7 Fixed UnrealBuildTool crashing on launch if initialization of UnrealTargetPlatform static members variables happens out of order
## Summary

`UnrealTargetPlatform` and `UnrealPlatformGroup` are partial structs which each have a static member variable declared like this:

private static UniqueStringRegistry StringRegistry = new UniqueStringRegistry();

These partial structs have additional implementations in /Engine/Platforms/XXX/Source/Programs/UnrealBuildTool/UEBuildXXX.cs, which also have static member variables declared like this:

public static UnrealTargetPlatform XXX = FindOrAddByName("XXX");

`FindOrAddByName()` is a static method on `UnrealTargetPlatform` and `UnrealPlatformGroup` which accesses `StringRegistry` and requires it to be initialized i.e. non-null.

It appears that there's no guarantee in .NET runtime that the static member variables in the "original" implementation of the partial structs will be initialized _before_ the ones from the "additional" implementations. This means `XXX` above can be initialized in the additonal implementation before `StringRegistry` has been initialized in the original implementation, which means it's still null when `FindOrAddByName()` is called so the tool crashes.

In practice, this is 100% reproducible in our public GitHub mirror when opening `UnrealBuildTool.csproj` with VisualStudio Mac. This IDE rewrites the project file which affects when / how UEBuildXXX.cs is compiled, and static member variables for these partial structs end up being initialized out or order.

The only solution I found that worked was to replace all accesses to the `StringRegistry` static member variables by a wrapper function `GetUniqueStringRegistry()` which takes care of initializing it - only once. Since all this happens while the tool launches, this code should not need to be multithread aware / re-entrant.

NOTE: There is another partial struct `RestrictedFolder` in this codebase which also use `UniqueStringRegistry` in a similar way but the 2 implementations are in the same source file, so the bug may not happen and I left the implementation untouched.

## Test Plan

- Opened `UnrealBuildTool.csproj` with VisualStudio Mac
- Built UnrealBuildTool and verified it crashed on launch due to `StringRegistry` being NULL when used by `FindOrAddByName()`
- Confirmed the crash doesn't happen anymore after applying this change and that the `StringRegistry` static member variable was only set once by `GetUniqueStringRegistry()`


#jira UE-88908
#rb ben.marsh

[CL 11498874 by PierreOlivier Latour in 4.25 branch]
2020-02-18 10:02:51 -05:00
Ben Marsh
b37d68e4a5 Remove Gnmx from hard-coded list of modules that aren't IWYU compatible.
#rb none
#rnx
#jira UE-84505

[CL 11433161 by Ben Marsh in 4.25 branch]
2020-02-13 21:09:57 -05:00
Rolando Caloca
5b82f15def Copying //UE4/Dev-RenderPlat-Staging@11388153 to //UE4/Main
#rb none
#rnx

[CL 11388545 by Rolando Caloca in Main branch]
2020-02-12 13:27:19 -05:00
Stefan Boberg
55a8b15f1f Copying //UE4/Dev-Core to Main (//UE4/Main)
#rb none

[CL 11258477 by Stefan Boberg in Main branch]
2020-02-05 14:26:36 -05:00
Rolando Caloca
f63a3e857e Merging //UE4/Main@11178322 to Dev-RenderPlat-Staging
#rnx
#rb none

[CL 11195678 by Rolando Caloca in Dev-RenderPlat-Staging branch]
2020-01-31 10:34:10 -05:00
Ben Marsh
0e6aa011b3 Copying //UE4/Dev-Build @ CL 11166028 to Dev-Main (//UE4/Dev-Main)
#rb none
#rnx

[CL 11166227 by Ben Marsh in Main branch]
2020-01-29 14:48:18 -05:00
PJ Kack
ef8a7b620e AUTO MERGE
Merging //UE4/Main @ 11112898 to //UE4/Dev-Core (dev-core-l0178)

#rb none

(ushell-p4-mergedown)

[CL 11113593 by PJ Kack in Dev-Core branch]
2020-01-26 11:35:42 -05:00
PJ Kack
3a9ca4d2f9 Merging //UE4/Main @ 11112898 to //UE4/Dev-Core (dev-core-l0178)
#rb none

(ushell-p4-mergedown)

[CL 11113592 by PJ Kack in Dev-Core branch]
2020-01-26 11:33:22 -05:00