[xbuild] Disable pre-2.0 csc hack to use /debug:portable (#4322)
authorAnkit Jain <radical@gmail.com>
Fri, 3 Feb 2017 12:19:05 +0000 (07:19 -0500)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 3 Feb 2017 12:19:05 +0000 (13:19 +0100)
This hack should not be required now, as roslyn emits the correct debug
files with /debug:full and /debug:pdbonly, on non-windows platform.

This manifested as https://bugzilla.xamarin.com/show_bug.cgi?id=50710 ,
where the Xamarin.Mac targets override `$(CscToolExe)` to use `mcs`, but
xbuild's `ManagedCompiler` *always* converts `DebugType={full,pdbonly}`
to `/debug:portable`, which would cause mcs to complain.

mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ManagedCompiler.cs

index 19eec8686542011b04d2515874b9a86450136161..9d6404ee3ebc7632fa4edb3ef7fd68b6319907dc 100644 (file)
@@ -58,11 +58,7 @@ namespace Microsoft.Build.Tasks {
                        if (Bag ["CodePage"] != null)
                                commandLine.AppendSwitchIfNotNull ("/codepage:", CodePage.ToString ());
 
-                       var dtype = DebugType;
-                       if (string.Equals (dtype, "full", StringComparison.OrdinalIgnoreCase) || string.Equals (dtype, "pdbonly", StringComparison.OrdinalIgnoreCase))
-                               dtype = "portable";
-
-                       commandLine.AppendSwitchIfNotNull ("/debug:", dtype);
+                       commandLine.AppendSwitchIfNotNull ("/debug:", DebugType);
 
                        if (Bag ["DelaySign"] != null)
                                if (DelaySign)