Commit Graph

28 Commits

Author SHA1 Message Date
Wes Hunt
012e45b913 UBT Utils.cs (New logging system)
* Allows us to use built-in Trace providers (console, file, etc) directly and still use our custom formatting.
* Fat comments explaining why Trace.WriteXXX functions should not be used directly in our system.
* Fixes thread safety by using Trace.WriteXXX under the hood after formatting, which uses a global lock (except on Mono, where a bug appears to be preventing this. Simulating the call on that platform).
* No need for TraceEvent overloads, which saves us the extra parameter cruft.
* Removed non-varargs overloads of Log functions (technically a bit slower, but these are already small messages).
* No longer needed VerbosityFilter and ConsoleListener classes.
* Avoid calling GetSource() if we aren't outputting the source.
* Avoid formatting the string if it won't pass the verbosity level.
* Consolidated all of UAT and UBT options into this class, so they could fully share the implementation.

UBT BuildConfiguration.cs
* Added LogFilename (and --log=<file> arg) that enables logging to a file.
* Added static ctor guard that asserts if someone tries to read a config before we have loaded config files and parsed config-override commandlines. It's a poor man's hack, but better than nothing!

UBT UEBuildConfiguration.cs
* Same static ctor guard as above.

UBT UnrealBuildTools.cs (initialization refactoring)
* In general I tried to de-mystify some of the rationale behind our startup code via fat comments.
* Broke main into 3 stages:
1. "early code" that should not try to read a config value.
  * Very little code here. Mostly setting the current directory.
  * Does an early init of logging to ensure logging is around, but config values won't be ready.
2. "Init Configuration code" that loads config files and parses command lines that may override them.
  * I isolated two locations in startup that parsed long sets of switches and moved ones that trivially affected BuildConfiguration and UEBuildConfiguration in here. Those two locations seemed to have mostly copies of the same switches, indicating serious param parsing issues at some point in time.
  * This allows switches to override config files more easily than the patchwork of re-parsing that was currently used (particularly for -verbose).
  * I did a cursory examination of later code that indicated this double (actually, triple) parsing was no longer necessary with the refactors above. Any insight into why things may have ended up this way would be helpful.
3. "Post Init code" that is actually the meat of UBT.
  * I left this code largely untouched.
  * Removed 2 of 3 different command line logging statements.
  * Removed two redundant parses of config overrides (ParseBuildConfigurationFlags).
* Guarded all of main in a try/catch block to ensure no exceptions can leak from UBT without returning a valid error code. It ALMOST already did this, but only covered the part surrounded by the Mutex.
* There was a perplexing bit that redundantly called XmlConfigLoader.Reset<> (line 683) that I struggled to understand. It turns out UEBuildConfiguration was sensitive to the current directory being set before files were loaded, and the old code called XmlConfigLoader.Init() super early, which required it to be called again after the current directory was set (see UEBuldConfiguration.UEThirdPartySourceDirectory for the cause). After my changes, I verified as best I could that these calls are no longer needed and removed them.

XmlConfigLoader.cs
* Add support for Properties in XmlConfigLoader.

AutomationTool Program.cs
* Guard logging shutdown code in try/finally so it can't be missed.

AutomationTool Log.cs
* Uses new logging system from UBT
* Removed unnecessary classes (VerbosityFilter, AutomationConsoleTraceListener, and AutomationFileTraceListener)
* Console trace logic is handled by UBT code now, moved UTF8Output handling to InitLogging.
* A custom TraceListener for file logging was unnecessary.
  * Logic to handle creating the log file and retry loops was move into InitLogging, and the result passed to a regular TextFileTraceListener.
  * Logic to handle copying the log on shutdown was moved to a ShutdownLogging function.
#codereview:robert.manuszewski,michael.trepka,kellan.carr

[CL 2526245 by Wes Hunt in Main branch]
2015-04-26 18:19:28 -04:00
Robert Jones
b5a273a278 SDK path editing in editor.
- Added class to hold values (AndroidSDKSettings)
- Added code to Android editor module to setup the values on load
- Changed device detection so that the thread is always started and the SDK path can be changed on the fly
- Changed Platform Target Management Module so that a single platform can be checked via UBT
- Settings can now be sourced from an ini file via temp direct reading code (auto seralisation is disabled until later changes are made)
-- Settings currently not exposed in editor

- Added Mac Environment var setting support

Unreleated
- Envars can now be passed down to process start points in tools

#codereview michael.trepka

[CL 2412194 by Robert Jones in Main branch]
2015-01-20 10:05:42 -05:00
Peter Sauerbrei
376e80fc53 UE-6681 Cook on the Fly on iOS wait loop
fixed issue with PC side never making a process which the cross platform code used to determine if it was done or not.
#ios

[CL 2391250 by Peter Sauerbrei in Main branch]
2014-12-17 11:17:53 -05:00
Ben Marsh
149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00
Ben Marsh
fefc1c4a84 Fix crash when interrupting a child process.
[CL 2322771 by Ben Marsh in Main branch]
2014-10-08 11:39:16 -04:00
Peter Sauerbrei
040aa73caf converted LauncherWorker to utilize a single UAT command
fixed problem with IP not being set for CotF
#ue4
#codereview daniel.lamb, chris.gagnon

[CL 2303312 by Peter Sauerbrei in Main branch]
2014-09-18 18:55:01 -04:00
Jack Porter
41e7c27325 [MMVP-74] Android packaging / deployment error reporting
[CL 2294967 by Jack Porter in Main branch]
2014-09-12 06:23:49 -04:00
Jack Porter
7efa313382 Improvement to Process cleanup change in CL 2285994
[CL 2286030 by Jack Porter in Main branch]
2014-09-05 05:09:16 -04:00
Jack Porter
d123bdd912 Fixed "Build Failure" error after successfully deploying to Android
CommandUtils.Run was disposing of processes started without NoWaitForExit, so any caller checking ProcessResult.HasExited would crash raising InvalidOperationException as the ProcessResult.Proc was junk.

Made the ProcessResult destructor call Proc.Dispose().

#code_review: Robert.Manuszewski

[CL 2285994 by Jack Porter in Main branch]
2014-09-05 04:49:13 -04:00
Robert Manuszewski
3054e34792 UAT: Log process exit code, always Dispose processes.
[CL 2248641 by Robert Manuszewski in Main branch]
2014-08-08 13:30:04 -04:00
Peter Sauerbrei
51fa18631b addition of errors to Launch On, Package, and Cook analytics
TTP341794
#ue4
#analytics

[CL 2240496 by Peter Sauerbrei in Main branch]
2014-08-01 20:30:13 -04:00
Robert Manuszewski
50b4037cf1 UAT: If killing a descendant process failes, log a warning instead of an error.
[CL 2229858 by Robert Manuszewski in Main branch]
2014-07-24 09:44:52 -04:00
Peter Sauerbrei
c3e87b2509 Fix for bad exit code on successful launch of game via UFE command-line
TTP338848
#ue4
#uat

[CL 2117320 by Peter Sauerbrei in Main branch]
2014-06-25 18:26:48 -04:00
Gil Gribb
68d392b169 Build script, half of the solution for "red after red" spam reduction
[CL 2103104 by Gil Gribb in Main branch]
2014-06-12 09:19:01 -04:00
Gil Gribb
54158eae4d build script, wait longer for process output
[CL 2082067 by Gil Gribb in Main branch]
2014-05-22 11:58:56 -04:00
Robert Manuszewski
d821cba445 UAT: WatchdogTimer improvements
[CL 2071897 by Robert Manuszewski in Main branch]
2014-05-13 14:31:45 -04:00
Robert Manuszewski
6072806f3e UAT: Another attempt to fix EC hangs. Re-enabling automated tests in GUBP
#codereview gil.gribb

[CL 2065776 by Robert Manuszewski in Main branch]
2014-05-07 13:10:24 -04:00
Robert Manuszewski
1de10e625e Back out changelist 2064485
[CL 2064746 by Robert Manuszewski in Main branch]
2014-05-06 14:39:20 -04:00
Robert Manuszewski
5b4d77eaf2 UAT: Fixing process exit event not being triggered. Re-enabled automation testing in GUBP
#codereview gil.gribb

[CL 2064485 by Robert Manuszewski in Main branch]
2014-05-06 10:42:37 -04:00
Robert Manuszewski
f3bf2567a0 UAT: Making killing processes safer (added a safe way of accessing process name)
[CL 2063595 by Robert Manuszewski in Main branch]
2014-05-05 12:41:07 -04:00
Gil Gribb
817c32c5a4 build script, timing for shared temp storage, spew reduction, 50 people, not 50 changes for spam reduction
[CL 2062211 by Gil Gribb in Main branch]
2014-05-02 12:44:39 -04:00
Robert Manuszewski
81779ddbc0 UAT: Prevent descendant processes from being killed twice on exit.
#codereview gil.gribb

[CL 2055629 by Robert Manuszewski in Main branch]
2014-04-24 13:08:51 -04:00
Robert Manuszewski
88138ebcaf #UE4 - UAT: Adding a list of process names that can not be killed by UAT.
#codereview gil.gribb

[CL 2054578 by Robert Manuszewski in Main branch]
2014-04-23 20:20:44 -04:00
Mike Fricker
92a3fa2c3c AutomationTool changes for source publishing
- Added better support for 'verbose' log output from P4 and Process commands (SpewIsVerbose arg and TraceEventType flags)
- Added new P4Connection.DescribeChangelists() that provides full changed file lists and edit types
- Added even better support for full changelist descriptions to P4Connection.Changes() function

#codereview Robert.Manuszewski, Gil.Gribb

[CL 2052302 by Mike Fricker in Main branch]
2014-04-23 19:55:50 -04:00
Steve Robb
c34468ca19 #ttp LOCALIZATION: EDITOR: Packaging log displays Unicode characters as ?
#change The engine now accepts a -UTF8Output command line argument which allows the output stream to be in the correct mode.
#change UAT accepts the same UTF8Output parameter to allow the connecting streams to be in the correct mode too (though it's currently only passed during the UnrealPak invocation).
#add FPlatformMisc::SetUTF8Output added to allow the opting-in of a UTF-8 output stream in Windows.

#codereview robert.manuszewski

[CL 2043167 by Steve Robb in Main branch]
2014-04-23 18:15:18 -04:00