Commit Graph

346 Commits

Author SHA1 Message Date
bryan sefcik
1ad98523c4 Added support to give actions in UBT "weight". "Weight" is an average measurement of how many cores and memory an action uses. Using one core with a normal amount of memory for an action would be a value of 1.
Why do this:
Currently when compiling a cpp file with MSVC, it compiles across multiple cores while clang does not. This means that while we support limiting the number of cores(using ProcessorCountMultiplier), MSVC will use more cores than we specify. It also means that MSVC will always be faster when compiling because clang does not support compiling a cpp over multiple cores. To get similiar results when compiling with clang, we set the weight of MSVC to 1.5 and the weight of clang to 1.0. We then set the ProcessorCountMultiplier to 1.5. This results in MSVC and clang taking roughly the same amount of CPU utilization and clang compiles to be much faster.

	                     Old Timing(secs)	Old CPU Utilization	New Timing	New CPU Utilization(secs)
PlatformA AncientGame	590.94	51	                               431.47	73
MSVC AncientGameEditor	1016.96	94	                             1026.08	95
Clang AncientGameEditor	1543.72	63	                               1270.4	84
PlatformB AncientGame	494	52	                               396.95	74

Old = without weight path
New = with weight path

#jira
#rb christopher.waters, joe.kirchoff
#preflight 6409026c8832f48a4dc72025

[CL 24567859 by bryan sefcik in ue5-main branch]
2023-03-08 17:08:22 -05:00
Andrew Scheidecker
02f9686b0f Fix ClangToolchain omitting global compiler options from the command line on platforms that don't use a shared response file.
#jira none
#rb Joe.Kirchoff
#preflight 6408d6096c1b9295b9bddca7

[CL 24564056 by Andrew Scheidecker in ue5-main branch]
2023-03-08 13:59:38 -05:00
Joe Kirchoff
04b2b155bc UnrealBuildTool: Make CStandard enum consistent with CppStandard
#rnx
#preflight 6407c690c13b7130d276f1b8

[CL 24551440 by Joe Kirchoff in ue5-main branch]
2023-03-07 18:41:02 -05:00
joe kirchoff
1ad009dd27 UnrealBuildTool: Stash shared paths in the CppCompileEnvironment after creating a shared response file so those paths can still be used for validation
#rnx
[FYI] Henrik.Karlsson

[CL 24493752 by joe kirchoff in ue5-main branch]
2023-03-02 20:29:33 -05:00
bryan sefcik
b0205aeefa Added another possible fix for SNDBS when using PCH chains.
#preflight 63fe91bb30633435f8cbf742

[CL 24455007 by bryan sefcik in ue5-main branch]
2023-02-28 19:02:35 -05:00
swarm
b61361facf Secondary remote Mac
#jira UE-120589
# rb josh.adams
#preflight 63f2da7d90198dffbaaee3ff

[CL 24309059 by swarm in ue5-main branch]
2023-02-19 21:45:46 -05:00
bryan sefcik
1cc61ecdd1 Possible fix for android having issues with PCHs
[CL 24253388 by bryan sefcik in ue5-main branch]
2023-02-16 04:16:25 -05:00
bryan sefcik
0ef675123b Possible fix for SNDBS when compiling with PCH chains.
#jira
#rb joe.kirchoff
#preflight 63ed1d817d2ec3d2fd4c3452

[CL 24251837 by bryan sefcik in ue5-main branch]
2023-02-16 02:02:35 -05:00
henrik karlsson
dceb9f0713 [UnrealBuildTool]
* Fixed so -SingleFile includes running prereq actions if they are not up to date.

#preflight skipped
#rb joe.kirchoff
#jira none

[CL 24239919 by henrik karlsson in ue5-main branch]
2023-02-15 15:31:40 -05:00
joe kirchoff
3c3baf04d1 UnrealBuildTool: Return target file from GetCompileArguments_FileType rather then getting it from the ProducedItem list
#rnx
#rb trivial
#preflight 63e6875a211c20974fefc76f

[CL 24136563 by joe kirchoff in ue5-main branch]
2023-02-11 12:26:49 -05:00
henrik karlsson
0573c9a222 [UBT]
* Changed so clang single file placeholder action is not having any produced items.. this means that ubt modes that looks for produced items won't find anything on the placeholder actions

#preflight skipped
#rb joe.kirchoff

[CL 24136526 by henrik karlsson in ue5-main branch]
2023-02-11 12:26:10 -05:00
henrik karlsson
8035d32fe0 [UBT]
* Disabled -SingleFile option when building for multiple architectures at once... this can be implemented if someone needs it but require a bit of work
* Enabled -SingleFile option for apple platforms

#preflight skipped
#rb zach.neyland
#jira none

[CL 24129855 by henrik karlsson in ue5-main branch]
2023-02-10 18:36:33 -05:00
zack neyland
b1ecff88d2 UBT: AppleToolChain temporary workaround for failing builds.
-SingleFile=... will not work for the time being, but this at least resolves horde build failures.

#jira UE-176814
#preflight na

[CL 24128134 by zack neyland in ue5-main branch]
2023-02-10 17:06:40 -05:00
bryan sefcik
592942fad7 Added support for Clang PCH chaining
https://clang.llvm.org/docs/PCHInternals.html#chained-precompiled-headers

Linux - EngineTestEditor -allmodules
Before:
Total PCH Size: 3.41 GB

After:
Total PCH Size: 2.65 GB

#jira
#rb joe.kirchoff
#preflight 63e57da9636f66aac7dc1818

[CL 24114121 by bryan sefcik in ue5-main branch]
2023-02-09 22:37:30 -05:00
henrik karlsson
5f74d114d5 [UBT]
Changed how single files are built. We don't want to invalidate makefile everytime we build single files since it destroys turnaround times. With this change a single file compile can take 2s (+ the actual compile time).

The new behavior injects a special action per module when creating the makefile. These actions can be used to on-the-fly create a proper compile action that follows the rules of the module that the specific file belongs to.. In a normal build these actions are ignored since the logic deciding which actions to build is backtraced from which binaries we want to create.

When a specific file compile is triggered, the logic deciding which files to build search up all these special actions and create a lookup based on which folders the special actions handle. It then try to find the special action that handles the specific file. The matching special action then creates a compile action that can handle that specific file and then queue up the action for execution. If no special action is found it falls back to try to use actions that have this specific file as input (ispc files for example)

Details:
* Removed lots of custom code for "specific files" handling
* Changed so pch (both private and shared) always use definition file. Added #pragma once and change so pch wrapper file include definition file. This made the adaptive path and specific file easy to implement (just disable pch in compile environment and it will just work)
* Added SingleFileAction for both VCToolChain and ClangToolChain. It now works to compile specific headers and cpp files. (It creates wrapper files on the fly to be able to compile all header files (compiling headers directly blow up if there are circular includes)
* Fixed so GenerateClangDatabase mode works with new changes
* Moved the logic that makes sure all (directly) depending cpp files are recompiled when .h are included in the singlefile option

#preflight 63dcc46f78716a01e8069649
#rb joe.kirchoff

[CL 24094027 by henrik karlsson in ue5-main branch]
2023-02-09 04:20:43 -05:00
axel riffard
f0898e1c0d Remote Prepare to Debug
#jira UE-120589
#rb josh.adams
#preflight 63db32457a39a18021af8c38

[CL 23964201 by axel riffard in ue5-main branch]
2023-02-01 23:02:14 -05:00
joe kirchoff
ac72cb1034 UnrealBuildTool: Fix additional response files not being quoted
#rnx
#rb Henrik.Karlsson

[CL 23961118 by joe kirchoff in ue5-main branch]
2023-02-01 19:29:49 -05:00
henrik karlsson
e4a153fd0a [UBT]
* Turned off shared response file for apple platforms to fix compile errors. Need to be revisited

#preflight skipped
#rb none
#jira none

[CL 23943727 by henrik karlsson in ue5-main branch]
2023-01-31 21:56:34 -05:00
henrik karlsson
0de807f1a8 [UBT]
* Added support for additional response files (will be used by header units)
* Added support for shared response files and changed so normal cpp/h build path uses it if toolchain supports it.
* Enabled shared response files on all platforms but android (which doesnt seem to support reponse files including response files)
* Some cleanup in the iwyu toolchain related to shared rsp files

#preflight 63d9af169b3bb6a66cec9a8e
#rb joe.kirchoff

[CL 23943501 by henrik karlsson in ue5-main branch]
2023-01-31 21:24:28 -05:00
henrik karlsson
bce2998aaa [UBT]
* Fixed so only colliding headers gets hash suffix for files in immediate folder

#preflight 63d86e11f626715201a3daa5
#rb joe.kirchoff

[CL 23924099 by henrik karlsson in ue5-main branch]
2023-01-31 01:29:20 -05:00
henrik karlsson
5c3236c955 [IWYU]
* Submitted binaries and tps
* Changed so iwyu toolchain is using this new path

#preflight skipped
#rb none

[CL 23898321 by henrik karlsson in ue5-main branch]
2023-01-28 04:03:07 -05:00
joe kirchoff
46bc663f3b UnrealBuildTool: Rename .response to .rsp
#rnx
#rb Henrik.Karlsson
#preflight 63d40d4a5c69f453c131a7a7

[CL 23890482 by joe kirchoff in ue5-main branch]
2023-01-27 15:19:25 -05:00
Joe Kirchoff
49941df8c8 UnrealBuildTool: Prevent multiple target leaking bundle dependencies on Mac
#rnx
#rb Josh.Adams
#preflight 63d1978cbe435f17b408210c
#preflight 63d1af24be435f17b40e38f4

[CL 23858824 by Joe Kirchoff in ue5-main branch]
2023-01-25 17:55:46 -05:00
Brandon Schaefer
768ffe45bd Add clang version checks on deprecated arguments
#jira none
#rb Joe.Kirchoff
#preflight none

[CL 23840030 by Brandon Schaefer in ue5-main branch]
2023-01-24 17:25:29 -05:00
josh adams
1610c3bee3 UnrealArch/UnrealArchitectures changes
- Creates the UnrealArchitectures class, which wraps a list of UnrealArch objects
 - UnrealArch is a single architecture, expandable enum-like struct
 - There is no more concept of "no/default architecture", there is always a valid active architecture when building
 - Most uses of "string Architecture" are replaced with one of the two above, depending if multiple architectures are supported or not
 - UnrealArch has some platform-extensions for platform-specific naming (like Linux adds in LinuxName that turns, for instance, Arm64 -> aarch64-unknown-linux-gnueabi, which is used in folder names, etc)
 - UnrealArch has bIsX64 which can be used determine intel instruction set (as opposed to arm)
 - TargetRules class has an "Architecture" accessor that will return a single architecture if the active architectures is a single architecture, or throw an exception if multiple. This is useful in a majority of the cases where a paltform can only have a single architecture active in TargetRules (microsoft platforms, for instance, will create separate targets when compiling multiple architectures at once)
 - Added UnrealArchitectureConfig class, which contains all the architecture information for a platform (what architectures are supported, what ones are currently active for given project, etc)

#preflight 63c81fb5b065224750a1759e
#rb mike.fricker,roman.dzieciol,joe.kirchoff,dmytro.vovk,brandon.schaefer [various parts]
#p4v-preflight-copy 23562471

[CL 23829977 by josh adams in ue5-main branch]
2023-01-24 09:30:28 -05:00