From 6534528dfa74097951c9191634d30e48933ca750 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 12 Aug 2020 12:10:53 +0000 Subject: [PATCH 1/6] Update dependencies from https://github.com/mono/linker build 20200812.1 Microsoft.NET.ILLink.Tasks From Version 5.0.0-preview.3.20410.2 -> To Version 5.0.0-preview.3.20412.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e29792a48b2b..e78d3ba1dfb4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -69,9 +69,9 @@ https://github.com/microsoft/vstest ddb755f58160c0e7fab50964d665be1bf47ff579 - + https://github.com/mono/linker - 3e97f1b57526be93b1abff97ef112efd2f9b21b5 + fc5e4aa86ad543ab3a730e0e0e8dacc6a379d4a5 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 8ef07d694a4c..c663699442aa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -69,7 +69,7 @@ - 5.0.0-preview.3.20410.2 + 5.0.0-preview.3.20412.1 From 442e12edf39a5010e408642b2e53604b12085518 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 13 Aug 2020 14:28:59 +0000 Subject: [PATCH 2/6] Update dependencies from https://github.com/mono/linker build 20200813.1 Microsoft.NET.ILLink.Tasks From Version 5.0.0-preview.3.20410.2 -> To Version 5.0.0-preview.3.20413.1 --- NuGet.config | 1 + eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NuGet.config b/NuGet.config index 674d9a0a7ca7..8c02b50ebffd 100644 --- a/NuGet.config +++ b/NuGet.config @@ -11,4 +11,5 @@ + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e78d3ba1dfb4..6cdcd29090b3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -69,9 +69,9 @@ https://github.com/microsoft/vstest ddb755f58160c0e7fab50964d665be1bf47ff579 - + https://github.com/mono/linker - fc5e4aa86ad543ab3a730e0e0e8dacc6a379d4a5 + 2b04c065c84aa8f30600e3b1989c537fc77de95b https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index c663699442aa..fc2560004cfc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -69,7 +69,7 @@ - 5.0.0-preview.3.20412.1 + 5.0.0-preview.3.20413.1 From 03ef3858ee105520e1e7b07736bd4da25c73fa50 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 14 Aug 2020 16:31:18 +0000 Subject: [PATCH 3/6] Renumber warnings To reflect the changes in https://github.com/mono/linker/pull/1385 --- .../targets/Microsoft.NET.ILLink.targets | 12 ++++-- .../GivenThatWeWantToRunILLink.cs | 38 +++++++++---------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets index 1aff8074b3cc..aeded0188dde 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets @@ -153,11 +153,15 @@ Copyright (c) .NET Foundation. All rights reserved. copyused - - - $(NoWarn);IL2006 - $(NoWarn);IL2026 + + $(NoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061 + + $(NoWarn);IL2062;IL2063;IL2064;IL2065;IL2066 + + $(NoWarn);IL2067;IL2068;IL2069;IL2070;IL2071;IL2072;IL2073;IL2074;IL2075;IL2076;IL2077;IL2078;IL2079;IL2080;IL2081;IL2082;IL2083;IL2084;IL2085;IL2086;IL2087;IL2088;IL2089;IL2090;IL2091 + + $(NoWarn);IL2026 diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 4f54649947f9..3b96baefe55c 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -116,7 +116,7 @@ public void ILLink_links_simple_app_without_analysis_warnings_and_it_runs(string var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); publishCommand.Execute($"/p:RuntimeIdentifier={rid}", "/p:SelfContained=true", "/p:PublishTrimmed=true", $"/p:TrimMode={trimMode}") .Should().Pass() - .And.NotHaveStdOutContaining("warning IL2006") + .And.NotHaveStdOutContaining("warning IL2075") .And.NotHaveStdOutContaining("warning IL2026"); var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid); @@ -220,12 +220,12 @@ public void ILLink_analysis_warnings_are_disabled_by_default(string targetFramew publishCommand.Execute($"/p:RuntimeIdentifier={rid}", $"/p:SelfContained=true", "/p:PublishTrimmed=true") .Should().Pass() // trim analysis warnings are disabled - .And.NotHaveStdOutContaining("warning IL2006") + .And.NotHaveStdOutContaining("warning IL2075") .And.NotHaveStdOutContaining("warning IL2026") // warnings about invalid attributes still show up .And.HaveStdOutContaining("warning IL2043") .And.HaveStdOutContaining("warning IL2046") - .And.HaveStdOutContaining("warning IL2047"); + .And.HaveStdOutContaining("warning IL2093"); } [RequiresMSBuildVersionTheory("16.8.0")] @@ -241,11 +241,11 @@ public void ILLink_accepts_option_to_enable_analysis_warnings(string targetFrame var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); publishCommand.Execute($"/p:RuntimeIdentifier={rid}", $"/p:SelfContained=true", "/p:PublishTrimmed=true", "/p:SuppressTrimAnalysisWarnings=false") .Should().Pass() - .And.HaveStdOutMatching("warning IL2006.*Program.IL_2006") + .And.HaveStdOutMatching("warning IL2075.*Program.IL_2075") .And.HaveStdOutMatching("warning IL2026.*Program.IL_2026.*Testing analysis warning IL2026") .And.HaveStdOutMatching("warning IL2043.*Program.get_IL_2043") .And.HaveStdOutMatching("warning IL2046.*Program.Derived.IL_2046") - .And.HaveStdOutMatching("warning IL2047.*Program.Derived.IL_2047"); + .And.HaveStdOutMatching("warning IL2093.*Program.Derived.IL_2093"); } [RequiresMSBuildVersionTheory("16.8.0")] @@ -654,9 +654,9 @@ public void ILLink_can_treat_warnings_as_errors(string targetFramework) var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); publishCommand.Execute($"/p:RuntimeIdentifier={rid}", $"/p:SelfContained=true", "/p:PublishTrimmed=true", "/p:SuppressTrimAnalysisWarnings=false", - "/p:WarningsAsErrors=IL2006") + "/p:WarningsAsErrors=IL2075") .Should().Fail() - .And.HaveStdOutContaining("error IL2006") + .And.HaveStdOutContaining("error IL2075") .And.HaveStdOutContaining("warning IL2026"); } @@ -672,10 +672,10 @@ public void ILLink_can_treat_warnings_not_as_errors(string targetFramework) var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); publishCommand.Execute($"/p:RuntimeIdentifier={rid}", $"/p:SelfContained=true", "/p:PublishTrimmed=true", "/p:SuppressTrimAnalysisWarnings=false", - "/p:TreatWarningsAsErrors=true", "/p:WarningsNotAsErrors=IL2006") + "/p:TreatWarningsAsErrors=true", "/p:WarningsNotAsErrors=IL2075") .Should().Fail() .And.HaveStdOutContaining("error IL2026") - .And.HaveStdOutContaining("warning IL2006"); + .And.HaveStdOutContaining("warning IL2075"); } [RequiresMSBuildVersionTheory("16.8.0")] @@ -690,10 +690,10 @@ public void ILLink_can_ignore_warnings(string targetFramework) var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); publishCommand.Execute($"/p:RuntimeIdentifier={rid}", $"/p:SelfContained=true", "/p:PublishTrimmed=true", "/p:SuppressTrimAnalysisWarnings=false", - "/p:NoWarn=IL2006", "/p:WarnAsError=IL2006") + "/p:NoWarn=IL2075", "/p:WarnAsError=IL2075") .Should().Pass() - .And.NotHaveStdOutContaining("warning IL2006") - .And.NotHaveStdOutContaining("error IL2006") + .And.NotHaveStdOutContaining("warning IL2075") + .And.NotHaveStdOutContaining("error IL2075") .And.HaveStdOutContaining("warning IL2026"); } @@ -728,7 +728,7 @@ public void ILLink_respects_warning_level_independently(string targetFramework) publishCommand.Execute($"/p:RuntimeIdentifier={rid}", $"/p:SelfContained=true", "/p:PublishTrimmed=true", "/p:SuppressTrimAnalysisWarnings=false", "/p:ILLinkWarningLevel=0") .Should().Pass() - .And.NotHaveStdOutContaining("warning IL2006"); + .And.NotHaveStdOutContaining("warning IL2075"); } [RequiresMSBuildVersionTheory("16.8.0")] @@ -745,7 +745,7 @@ public void ILLink_can_treat_warnings_as_errors_independently(string targetFrame publishCommand.Execute($"/p:RuntimeIdentifier={rid}", $"/p:SelfContained=true", "/p:PublishTrimmed=true", "/p:SuppressTrimAnalysisWarnings=false", "/p:TreatWarningsAsErrors=true", "/p:ILLinkTreatWarningsAsErrors=false") .Should().Pass() - .And.HaveStdOutContaining("warning IL2006"); + .And.HaveStdOutContaining("warning IL2075"); } [Theory] @@ -1022,17 +1022,17 @@ public class Program { public static void Main() { - IL_2006(); + IL_2075(); IL_2026(); _ = IL_2043; new Derived().IL_2046(); - new Derived().IL_2047(); + new Derived().IL_2093(); } [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] public static string typeName; - public static void IL_2006() + public static void IL_2075() { _ = Type.GetType(typeName).GetMethod(""SomeMethod""); } @@ -1053,7 +1053,7 @@ public class Base [RequiresUnreferencedCode(""Testing analysis warning IL2046"")] public virtual void IL_2046() {} - public virtual string IL_2047() => null; + public virtual string IL_2093() => null; } public class Derived : Base @@ -1061,7 +1061,7 @@ public class Derived : Base public override void IL_2046() {} [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] - public override string IL_2047() => null; + public override string IL_2093() => null; } } "; From 1d3018b4ee66d9476aae42730015fe915068ce7e Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 14 Aug 2020 20:26:25 +0000 Subject: [PATCH 4/6] Suppress more trim analysis warnings The following also belong to the trim analysis category: - IL2050 (https://github.com/mono/linker/pull/1430) - Warnings about invalid attributes - Warnings about uses of removed attributes --- .../targets/Microsoft.NET.ILLink.targets | 14 ++++++++++++-- .../GivenThatWeWantToRunILLink.cs | 7 +++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets index aeded0188dde..1a4ed10fa71a 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets @@ -154,14 +154,24 @@ Copyright (c) .NET Foundation. All rights reserved. + + $(NoWarn);IL2026 + + $(NoWarn);IL2041;IL2042;IL2043;IL2056 + + $(NoWarn);IL2045 + + $(NoWarn);IL2046 + + $(NoWarn);IL2050 $(NoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061 $(NoWarn);IL2062;IL2063;IL2064;IL2065;IL2066 $(NoWarn);IL2067;IL2068;IL2069;IL2070;IL2071;IL2072;IL2073;IL2074;IL2075;IL2076;IL2077;IL2078;IL2079;IL2080;IL2081;IL2082;IL2083;IL2084;IL2085;IL2086;IL2087;IL2088;IL2089;IL2090;IL2091 - - $(NoWarn);IL2026 + + $(NoWarn);IL2092;IL2093;IL2094;IL2095 diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 3b96baefe55c..62a2f869e119 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -222,10 +222,9 @@ public void ILLink_analysis_warnings_are_disabled_by_default(string targetFramew // trim analysis warnings are disabled .And.NotHaveStdOutContaining("warning IL2075") .And.NotHaveStdOutContaining("warning IL2026") - // warnings about invalid attributes still show up - .And.HaveStdOutContaining("warning IL2043") - .And.HaveStdOutContaining("warning IL2046") - .And.HaveStdOutContaining("warning IL2093"); + .And.NotHaveStdOutContaining("warning IL2043") + .And.NotHaveStdOutContaining("warning IL2046") + .And.NotHaveStdOutContaining("warning IL2093"); } [RequiresMSBuildVersionTheory("16.8.0")] From fd0d182aedcc2f70c3514d86c187994914ae0a24 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 14 Aug 2020 23:07:26 +0000 Subject: [PATCH 5/6] Suppress IL2009 on 32-bit GetStubContextAddr rooted by the corelib XML only exists on 64-bit. --- .../targets/Microsoft.NET.ILLink.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets index 1a4ed10fa71a..eddf8d349a02 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets @@ -180,7 +180,7 @@ Copyright (c) .NET Foundation. All rights reserved. $(NoWarn);IL2037 - $(NoWarn);IL2012 + $(NoWarn);IL2009;IL2012 From eb852fd38ffedb720b596f7d8c166836a49dbf85 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 15 Aug 2020 12:15:14 +0000 Subject: [PATCH 6/6] Update dependencies from https://github.com/mono/linker build 20200814.2 Microsoft.NET.ILLink.Tasks From Version 5.0.0-preview.3.20410.2 -> To Version 5.0.0-preview.3.20414.2 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6cdcd29090b3..be1d20befa53 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -69,9 +69,9 @@ https://github.com/microsoft/vstest ddb755f58160c0e7fab50964d665be1bf47ff579 - + https://github.com/mono/linker - 2b04c065c84aa8f30600e3b1989c537fc77de95b + d5d4dc7d20d8c2a0389079bd56fb4a0b161cc2e3 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index fc2560004cfc..4172394fcf93 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -69,7 +69,7 @@ - 5.0.0-preview.3.20413.1 + 5.0.0-preview.3.20414.2