Bootstrap builds should use ExitingTraceListener

The bootstrap builds of the compiler today are using the default trace
listener which presents a dialog. That means when a `Debug.Assert` call
fires we end up hanging the build in Azure.

The intent was always for the bootstrap builds to use the
`ExitingTraceListener`. This way they exit with a crash and call stack
that allows the compiler team to diagnose the failure.

The behavior of `Debug.Assert` showing a dialog is the most likely
explanation for our current random hangs in the determinism leg. That is
the only place we still use a `DEBUG + BOOTSTRAP` build. The symptoms
line up. If that's the case this will start showing us the stack trace
of the assert.
上级 d0781848
......@@ -25,6 +25,10 @@ public static int Main(string[] args)
private static int MainCore(string[] args)
{
#if BOOTSTRAP
ExitingTraceListener.Install();
#endif
#if NET472
var loader = new DesktopAnalyzerAssemblyLoader();
#else
......
......@@ -14,6 +14,10 @@ public static int Main(string[] args)
NameValueCollection appSettings;
try
{
#if BOOTSTRAP
ExitingTraceListener.Install();
#endif
#if NET472
appSettings = System.Configuration.ConfigurationManager.AppSettings;
#else
......
......@@ -24,6 +24,12 @@ public override void WriteLine(string message)
Exit(message);
}
internal static void Install()
{
Trace.Listeners.Clear();
Trace.Listeners.Add(new ExitingTraceListener());
}
private static void Exit(string originalMessage)
{
var builder = new StringBuilder();
......
......@@ -25,6 +25,10 @@ public static int Main(string[] args)
private static int MainCore(string[] args)
{
#if BOOTSTRAP
ExitingTraceListener.Install();
#endif
#if NET472
var loader = new DesktopAnalyzerAssemblyLoader();
#else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册