Skip to content

Commit

Permalink
[One .NET] default $(SuppressTrimAnalysisWarnings) to true (#5781)
Browse files Browse the repository at this point in the history
Fixes: #5751

After bumping to .NET 6 Preview 3, we get hundreds of ILLINK warnings.
This is because of:

dotnet/sdk#16327

We need to default `$(SuppressTrimAnalysisWarnings)` to ignore these
warnings for now.

We should continue to use `TrimMode=link`, as that is the behavior
Xamarin developers get today.
  • Loading branch information
jonathanpeppers authored Mar 26, 2021
1 parent 640c12b commit 3137b6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<TrimMode Condition=" '$(PublishTrimmed)' == 'true' and '$(TrimMode)' == '' ">link</TrimMode>
<AndroidLinkMode Condition=" '$(AndroidLinkMode)' == '' and '$(PublishTrimmed)' == 'true' ">SdkOnly</AndroidLinkMode>
<AndroidLinkMode Condition=" '$(AndroidLinkMode)' == '' ">None</AndroidLinkMode>
<SuppressTrimAnalysisWarnings Condition=" '$(SuppressTrimAnalysisWarnings)' == '' ">true</SuppressTrimAnalysisWarnings>
<!-- Prefer $(RuntimeIdentifiers) plural -->
<RuntimeIdentifiers Condition=" '$(RuntimeIdentifier)' == '' And '$(RuntimeIdentifiers)' == '' ">android-arm64;android-x86</RuntimeIdentifiers>
<RuntimeIdentifier Condition=" '$(RuntimeIdentifiers)' != '' And '$(RuntimeIdentifier)' != '' " />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,7 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease)
var dotnet = CreateDotNetBuilder (proj);
Assert.IsTrue (dotnet.Build (), "`dotnet build` should succeed");

// TODO: run for release once illink warnings are gone
// context: https://github.com/xamarin/xamarin-android/issues/4708
if (!isRelease)
Assert.IsTrue (StringAssertEx.ContainsText (dotnet.LastBuildOutput, " 0 Warning(s)"), "Should have no MSBuild warnings.");
Assert.IsTrue (StringAssertEx.ContainsText (dotnet.LastBuildOutput, " 0 Warning(s)"), "Should have no MSBuild warnings.");

var outputPath = Path.Combine (FullProjectDirectory, proj.OutputPath);
var intermediateOutputPath = Path.Combine (FullProjectDirectory, proj.IntermediateOutputPath);
Expand Down

0 comments on commit 3137b6d

Please sign in to comment.