From ea84d9d05f6c41b02a0430f3cf94594ce0476d32 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 26 Feb 2021 09:25:28 +0100 Subject: [PATCH 01/11] Bump to .NET 6.0.100-preview.3.21152.10 --- Make.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Make.config b/Make.config index 6747da3c2de0..760b7c338db5 100644 --- a/Make.config +++ b/Make.config @@ -497,10 +497,10 @@ DOTNET_FEED_DIR ?= $(DOTNET_DESTDIR)/nuget-feed # We're using preview versions, and there will probably be many of them, so install locally (into builds/downloads) if there's no system version to # avoid consuming a lot of disk space (since they're never automatically deleted). The system-dependencies.sh script will install locally as long # as there's a TARBALL url. -DOTNET6_VERSION=6.0.100-preview.2.21114.3 +DOTNET6_VERSION=6.0.100-preview.3.21152.10 DOTNET6_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET6_VERSION))) -DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.2.21114.3/dotnet-sdk-6.0.100-preview.2.21114.3-osx-x64.pkg -DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.2.21114.3/dotnet-sdk-6.0.100-preview.2.21114.3-osx-x64.tar.gz +DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21152.10/dotnet-sdk-6.0.100-preview.3.21152.10-osx-x64.pkg +DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21152.10/dotnet-sdk-6.0.100-preview.3.21152.10-osx-x64.tar.gz DOTNET6_TARBALL_NAME=$(notdir $(DOTNET6_TARBALL)) DOTNET6_DIR=$(abspath $(TOP)/builds/downloads/$(basename $(basename $(DOTNET6_TARBALL_NAME)))) DOTNET6=$(DOTNET6_DIR)/dotnet From 50a9ba3ffff1cea027380db149b755d24cf4c63c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 5 Mar 2021 18:31:15 +0100 Subject: [PATCH 02/11] Bump to 6.0.100-preview.3.21152.10. --- Make.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Make.config b/Make.config index 3600a0b84166..6bc17a914c80 100644 --- a/Make.config +++ b/Make.config @@ -498,10 +498,10 @@ DOTNET_FEED_DIR ?= $(DOTNET_DESTDIR)/nuget-feed # We're using preview versions, and there will probably be many of them, so install locally (into builds/downloads) if there's no system version to # avoid consuming a lot of disk space (since they're never automatically deleted). The system-dependencies.sh script will install locally as long # as there's a TARBALL url. -DOTNET6_VERSION=6.0.100-preview.3.21152.10 +DOTNET6_VERSION=6.0.100-preview.3.21154.16 DOTNET6_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET6_VERSION))) -DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21152.10/dotnet-sdk-6.0.100-preview.3.21152.10-osx-x64.pkg -DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21152.10/dotnet-sdk-6.0.100-preview.3.21152.10-osx-x64.tar.gz +DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21154.16/dotnet-sdk-6.0.100-preview.3.21154.16-osx-x64.pkg +DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21154.16/dotnet-sdk-6.0.100-preview.3.21154.16-osx-x64.tar.gz DOTNET6_TARBALL_NAME=$(notdir $(DOTNET6_TARBALL)) DOTNET6_DIR=$(abspath $(TOP)/builds/downloads/$(basename $(basename $(DOTNET6_TARBALL_NAME)))) DOTNET6=$(DOTNET6_DIR)/dotnet From 66a6671ab64438d603f74cd299dacf3040646114 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 11 Mar 2021 16:30:03 +0100 Subject: [PATCH 03/11] Bump to 6.0.100-preview.3.21161.7. --- Make.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Make.config b/Make.config index 6bc17a914c80..99a39c29ccbf 100644 --- a/Make.config +++ b/Make.config @@ -498,10 +498,10 @@ DOTNET_FEED_DIR ?= $(DOTNET_DESTDIR)/nuget-feed # We're using preview versions, and there will probably be many of them, so install locally (into builds/downloads) if there's no system version to # avoid consuming a lot of disk space (since they're never automatically deleted). The system-dependencies.sh script will install locally as long # as there's a TARBALL url. -DOTNET6_VERSION=6.0.100-preview.3.21154.16 +DOTNET6_VERSION=6.0.100-preview.3.21161.7 DOTNET6_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET6_VERSION))) -DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21154.16/dotnet-sdk-6.0.100-preview.3.21154.16-osx-x64.pkg -DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21154.16/dotnet-sdk-6.0.100-preview.3.21154.16-osx-x64.tar.gz +DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21161.7/dotnet-sdk-6.0.100-preview.3.21161.7-osx-x64.pkg +DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21161.7/dotnet-sdk-6.0.100-preview.3.21161.7-osx-x64.tar.gz DOTNET6_TARBALL_NAME=$(notdir $(DOTNET6_TARBALL)) DOTNET6_DIR=$(abspath $(TOP)/builds/downloads/$(basename $(basename $(DOTNET6_TARBALL_NAME)))) DOTNET6=$(DOTNET6_DIR)/dotnet From d601990ea7fa4a05c99838e7f7e2feb7362ec600 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 15 Mar 2021 07:58:06 +0100 Subject: [PATCH 04/11] Bump to .NET 6.0.100-preview.3.21161.23. --- Make.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Make.config b/Make.config index 8e3417a6324b..ff69a3840954 100644 --- a/Make.config +++ b/Make.config @@ -510,10 +510,10 @@ DOTNET_FEED_DIR ?= $(DOTNET_DESTDIR)/nuget-feed BUNDLED_NETCORE_PLATFORMS_PACKAGE_VERSION:=$(shell if test -f $(TOP)/builds/BundledNETCorePlatformsPackageVersion.txt; then cat $(TOP)/builds/BundledNETCorePlatformsPackageVersion.txt; else echo "run-make-in-builds-directory-first"; fi) -DOTNET6_VERSION=6.0.100-preview.3.21161.7 +DOTNET6_VERSION=6.0.100-preview.3.21161.23 DOTNET6_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET6_VERSION))) -DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21161.7/dotnet-sdk-6.0.100-preview.3.21161.7-osx-x64.pkg -DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21161.7/dotnet-sdk-6.0.100-preview.3.21161.7-osx-x64.tar.gz +DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21161.23/dotnet-sdk-6.0.100-preview.3.21161.23-osx-x64.pkg +DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.3.21161.23/dotnet-sdk-6.0.100-preview.3.21161.23-osx-x64.tar.gz DOTNET6_TARBALL_NAME=$(notdir $(DOTNET6_TARBALL)) DOTNET6_DIR=$(abspath $(TOP)/builds/downloads/$(basename $(basename $(DOTNET6_TARBALL_NAME)))) From 9e86b7a7585cbefd698a0bebdca788a25e9e0f52 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 16 Mar 2021 12:32:03 +0100 Subject: [PATCH 05/11] [dotnet-linker] Bump ILink and use the supported method of getting an assembly's location. --- tools/dotnet-linker/LinkerConfiguration.cs | 6 +----- tools/dotnet-linker/dotnet-linker.csproj | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/dotnet-linker/LinkerConfiguration.cs b/tools/dotnet-linker/LinkerConfiguration.cs index fad60f153868..fa499e33a5c4 100644 --- a/tools/dotnet-linker/LinkerConfiguration.cs +++ b/tools/dotnet-linker/LinkerConfiguration.cs @@ -296,11 +296,7 @@ public void Write () public string GetAssemblyFileName (AssemblyDefinition assembly) { - // See: https://github.com/mono/linker/issues/1313 - // Call LinkContext.Resolver.GetAssemblyFileName (https://github.com/mono/linker/blob/da2cc0fcd6c3a8e8e5d1b5d4a655f3653baa8980/src/linker/Linker/AssemblyResolver.cs#L88) using reflection. - var resolver = typeof (LinkContext).GetProperty ("Resolver").GetValue (Context); - var filename = (string) resolver.GetType ().GetMethod ("GetAssemblyFileName", new Type [] { typeof (AssemblyDefinition) }).Invoke (resolver, new object [] { assembly }); - return filename; + return Context.GetAssemblyLocation (assembly); } public void WriteOutputForMSBuild (string itemName, List items) diff --git a/tools/dotnet-linker/dotnet-linker.csproj b/tools/dotnet-linker/dotnet-linker.csproj index 71afb5b5dc91..fef0c4594e53 100644 --- a/tools/dotnet-linker/dotnet-linker.csproj +++ b/tools/dotnet-linker/dotnet-linker.csproj @@ -7,7 +7,7 @@ - + From 857a96ba68749fe7ed9d80ab9b66643f447fe77c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 22 Mar 2021 08:09:00 +0100 Subject: [PATCH 06/11] Bump to MSBuild.StructuredLogger 2.1.364 to get support for newer binlog versions. --- tests/bgen/bgen-tests.csproj | 2 +- tests/dotnet/UnitTests/DotNetUnitTests.csproj | 2 +- tests/generator/generator-tests.csproj | 2 +- tests/mmptest/mmptest.csproj | 4 +--- .../msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj | 2 +- tests/mtouch/mtouch.csproj | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/bgen/bgen-tests.csproj b/tests/bgen/bgen-tests.csproj index 9eebc1d90377..3bf2846ecd04 100644 --- a/tests/bgen/bgen-tests.csproj +++ b/tests/bgen/bgen-tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/tests/dotnet/UnitTests/DotNetUnitTests.csproj b/tests/dotnet/UnitTests/DotNetUnitTests.csproj index 2d5f0dee4e3c..63706ecac0be 100644 --- a/tests/dotnet/UnitTests/DotNetUnitTests.csproj +++ b/tests/dotnet/UnitTests/DotNetUnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/tests/generator/generator-tests.csproj b/tests/generator/generator-tests.csproj index 33fba224b1f5..3947d9ea106c 100644 --- a/tests/generator/generator-tests.csproj +++ b/tests/generator/generator-tests.csproj @@ -33,7 +33,7 @@ - + diff --git a/tests/mmptest/mmptest.csproj b/tests/mmptest/mmptest.csproj index ea27e430d5bf..1217669be7c1 100644 --- a/tests/mmptest/mmptest.csproj +++ b/tests/mmptest/mmptest.csproj @@ -40,9 +40,7 @@ ..\..\_mac-build\Library\Frameworks\Xamarin.Mac.framework\Versions\git\lib\mmp\mmp.exe - - 2.1.176 - + diff --git a/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj b/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj index 25e726d0cb23..29b74f11e6ea 100644 --- a/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj +++ b/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/tests/mtouch/mtouch.csproj b/tests/mtouch/mtouch.csproj index 809c71cfee66..f11c4a048468 100644 --- a/tests/mtouch/mtouch.csproj +++ b/tests/mtouch/mtouch.csproj @@ -28,7 +28,7 @@ - + From a788e61941ed029889f08f100f54f2f5f525cf4c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 23 Mar 2021 08:35:56 +0100 Subject: [PATCH 07/11] Fix build failure Fixes: TestHelpers/BuildEngine.cs(161,24): error CS0433: The type 'ProjectEvaluationFinishedEventArgs' exists in both 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'StructuredLogger, Version=2.1.0.0, Culture=neutral, PublicKeyToken=d4c7181801cb6448' [/Users/builder/azdo/_work/1/s/xamarin-macios/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj] --- tests/msbuild/Xamarin.MacDev.Tests/TestHelpers/BuildEngine.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/msbuild/Xamarin.MacDev.Tests/TestHelpers/BuildEngine.cs b/tests/msbuild/Xamarin.MacDev.Tests/TestHelpers/BuildEngine.cs index ab24a2cc72ad..1af79a3a5191 100644 --- a/tests/msbuild/Xamarin.MacDev.Tests/TestHelpers/BuildEngine.cs +++ b/tests/msbuild/Xamarin.MacDev.Tests/TestHelpers/BuildEngine.cs @@ -158,9 +158,9 @@ public void ParseBinLog (string log) } else if (args is ProjectEvaluationStartedEventArgs projectEvaluationStarted) { if (verbose) Console.WriteLine ($"ProjectEvaluationStarted: {projectEvaluationStarted.ProjectFile}"); - } else if (args is ProjectEvaluationFinishedEventArgs projectEvaluationFinished) { + } else if (args.GetType ().Name == "ProjectEvaluationFinishedEventArgs") { if (verbose) - Console.WriteLine ($"ProjectEvaluationFinished: {projectEvaluationFinished.ProjectFile}"); + Console.WriteLine ($"ProjectEvaluationFinished: {args}"); } else if (args is ProjectStartedEventArgs projectStarted) { if (verbose) Console.WriteLine ($"ProjectStarted: {projectStarted.ProjectFile}"); From 335bb662f5f3016397aff66a4444affb02d703da Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 23 Mar 2021 12:23:59 +0100 Subject: [PATCH 08/11] Update parsing binlog properties. --- tests/common/BinLog.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/common/BinLog.cs b/tests/common/BinLog.cs index 179b4ec90935..7a64c4201272 100644 --- a/tests/common/BinLog.cs +++ b/tests/common/BinLog.cs @@ -49,7 +49,8 @@ public static IEnumerable PrintToLines (string path) if (args is ProjectStartedEventArgs psea) { if (psea.Properties != null) { yield return "Initial Properties"; - foreach (var prop in psea.Properties.Cast ().OrderBy (v => v.Key)) + var dict = (Dictionary) psea.Properties; + foreach (var prop in dict.OrderBy (v => v.Key)) yield return $"{prop.Key} = {prop.Value}"; } } From d08d1750aa8995ecb03cf299bb74df57013362a5 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 23 Mar 2021 19:51:10 +0100 Subject: [PATCH 09/11] Be more defensive. --- tests/common/BinLog.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/common/BinLog.cs b/tests/common/BinLog.cs index 7a64c4201272..373c27ee5c6c 100644 --- a/tests/common/BinLog.cs +++ b/tests/common/BinLog.cs @@ -49,9 +49,13 @@ public static IEnumerable PrintToLines (string path) if (args is ProjectStartedEventArgs psea) { if (psea.Properties != null) { yield return "Initial Properties"; - var dict = (Dictionary) psea.Properties; - foreach (var prop in dict.OrderBy (v => v.Key)) - yield return $"{prop.Key} = {prop.Value}"; + var dict = psea.Properties as IDictionary; + if (dict == null) { + yield return $"Unknown property dictionary type: {psea.Properties.GetType ().FullName}"; + } else { + foreach (var prop in dict.OrderBy (v => v.Key)) + yield return $"{prop.Key} = {prop.Value}"; + } } } From fa9e6a626a9d8feecaebe095d5b1ccdb373dde2e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 23 Mar 2021 19:57:42 +0100 Subject: [PATCH 10/11] [tests] Make sure the InternalsVisibleToAttribute constructor isn't linked away. --- tests/linker/ios/link all/Main.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/linker/ios/link all/Main.cs b/tests/linker/ios/link all/Main.cs index 378d25b29ff6..10e8609d6fa3 100644 --- a/tests/linker/ios/link all/Main.cs +++ b/tests/linker/ios/link all/Main.cs @@ -16,4 +16,16 @@ static void Main (string[] args) } #endif // !__WATCHOS__ } + +#if NET + // https://github.com/mono/linker/issues/1913 + [Foundation.Preserve (AllMembers = true)] + class Preserver + { + public Preserver () + { + GC.KeepAlive (new System.Runtime.CompilerServices.InternalsVisibleToAttribute ("preserve this constructor")); + } + } +#endif } From 50afe74e9efc53dedaa8fac2c49a6c89cd6098b2 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 24 Mar 2021 09:08:50 +0100 Subject: [PATCH 11/11] [tests] Implement better printing of binlogs. The latest MSBuild.StructuredLogger made some internal changes to the Message property which confuses some of our test logic. So implement manual printing of the log entries that we care about to make sure they conform to the expected format by the tests (the output is mimicing what 'msbuild /v:diag foo.binlog' would show). --- tests/common/BinLog.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/common/BinLog.cs b/tests/common/BinLog.cs index 373c27ee5c6c..81cd4c2c72c8 100644 --- a/tests/common/BinLog.cs +++ b/tests/common/BinLog.cs @@ -59,6 +59,39 @@ public static IEnumerable PrintToLines (string path) } } + if (args is TaskParameterEventArgs tpea) { + switch (tpea.Kind) { + case TaskParameterMessageKind.AddItem: + yield return "Added Item(s)"; + break; + case TaskParameterMessageKind.RemoveItem: + yield return "Removed Item(s)"; + break; + case TaskParameterMessageKind.TaskInput: + yield return "Task Parameter"; + break; + case TaskParameterMessageKind.TaskOutput: + yield return "Output Item(s)"; + break; + default: + yield return $"Unknown Kind ({tpea.Kind})"; + break; + } + foreach (var item in tpea.Items) { + var taskItem = item as ITaskItem; + yield return $"\t{tpea.ItemType}="; + if (taskItem != null) { + yield return $"\t\t{taskItem.ItemSpec}"; + foreach (var metadataName in taskItem.MetadataNames) { + yield return $"\t\t\t{metadataName}={taskItem.GetMetadata (metadataName?.ToString ())}"; + } + } else { + yield return $"\t{item}"; + } + } + continue; + } + foreach (var line in args.Message.Split (eols, System.StringSplitOptions.RemoveEmptyEntries)) yield return line; }