-
Notifications
You must be signed in to change notification settings - Fork 564
[build] Bump to Mono with MSBuild 16.10 #6014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The windows issues are likely a result of: https://github.com/xamarin/xamarin-android-tools/blob/bdcf899968d6549fd07917819d295f0feb0db562/src/Microsoft.Android.Build.BaseTasks/MSBuildReferences.projitems#L21-L38. We copy some MSBuild assemblies from the Mono installation to our test output directory when building our MSBuild tests. We then upload the test assemblies from the macOS build and use them on both macOS and Windows environments. |
jonathanpeppers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the error we get is:
System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Stack trace
at Microsoft.Build.Evaluation.Expander`2.MetadataExpander.ExpandMetadataLeaveEscaped(String expression, IMetadataTable metadata, ExpanderOptions options, IElementLocation elementLocation)
at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Evaluation/Expander.cs:line 414
at Microsoft.Build.Evaluation.ToolsetReader.ExpandPropertyUnescaped(ToolsetPropertyDefinition property, Expander`2 expander) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ToolsetReader.cs:line 683
at Microsoft.Build.Evaluation.ToolsetReader.EvaluateAndSetProperty(ToolsetPropertyDefinition property, PropertyDictionary`1 properties, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties, String& toolsPath, String& binPath, Expander`2& expander) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ToolsetReader.cs:line 659
at Microsoft.Build.Evaluation.ToolsetReader.ReadToolset(ToolsetPropertyDefinition toolsVersion, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ToolsetReader.cs:line 456
at Microsoft.Build.Evaluation.ToolsetReader.ReadEachToolset(Dictionary`2 toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ToolsetReader.cs:line 423
at Microsoft.Build.Evaluation.ToolsetReader.ReadToolsets(Dictionary`2 toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties, String& msBuildOverrideTasksPath, String& defaultOverrideToolsVersion) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ToolsetReader.cs:line 357
at Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary`2 toolsets, ToolsetRegistryReader registryReader, ToolsetConfigurationReader configurationReader, PropertyDictionary`1 environmentProperties, PropertyDictionary`1 globalProperties, ToolsetDefinitionLocations locations) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ToolsetReader.cs:line 144
at Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetRegistryReader registryReader, ToolsetConfigurationReader configReader) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ProjectCollection.cs:line 1763
at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary`2 globalProperties, IEnumerable`1 loggers, IEnumerable`1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ProjectCollection.cs:line 362
at Microsoft.Build.Evaluation.ProjectCollection.get_GlobalProjectCollection() in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Definition/ProjectCollection.cs:line 420
at Xamarin.ProjectTools.DotNetXamarinProject.Construct() in /Users/builder/azdo/_work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetXamarinProject.cs:line 97
at Xamarin.ProjectToo...
Can you try updating xamarin-android-tools to use 16.10?
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4857598&view=logs&j=fb3518d4-6415-56d8-56e7-3e01113bd696&t=339edcd9-c55f-51d5-0409-e3f1c4277c4d Context: https://discord.com/channels/732297728826277939/732297837953679412/852637194221125683 Context: dotnet#6014 Looks like dotnet#6014 attempted to bump to a system mono, and that bump broke ~everything: 226) Error : Xamarin.Android.Build.Tests.SingleProjectTest.AndroidManifestProperties System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at Microsoft.Build.Evaluation.Expander`2.MetadataExpander.ExpandMetadataLeaveEscaped(String expression, IMetadataTable metadata, ExpanderOptions options, IElementLocation elementLocation) at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Evaluation/Expander.cs:line 414 … Set `$(MonoRequiredMaximumVersion)` to 6.12.0.137, to *constrain* which system mono we use. Hopefully this will "un-bork" CI.
Xamarin.Android v11.4.0 will be shipped as part of Visual Studio 2019 16.11 Preview 3 and subsequent releases. Changes: https://github.com/xamarin/monodroid/compare/76c04cd15eca7afc269a6d26296e9d2db6f79be2...fab2d0b3e5205cb97d03e7a33a367245dbd211aa * xamarin/monodroid@fab2d0b3e: Branching for d16-11. (#1209) Update `azure-pipelines.yaml` so that the macOS Designer Tests use the xamarin/UITools/d16-10 branch, *not* the default d16-11 branch. Using the UITools/d16-11 branch results in build errors: /Users/runner/work/1/s/UITools/Designer/external/Xamarin.PropertyEditing/Xamarin.PropertyEditing.Mac/Controls/BaseDateTimeEditorControl.cs(2,7): error CS0246: The type or namespace name 'AppKit' could not be found (are you missing a using directive or an assembly reference?) [/Users/runner/work/1/s/UITools/Designer/external/Xamarin.PropertyEditing/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj] …plus 931 other errors… Finally, constrain mono to v6.12.0.137 by updating `$(MonoRequiredMaximumVersion)`. This is done to "work around" some unit test errors we observed because #6014 had updated the system mono: 226) Error : Xamarin.Android.Build.Tests.SingleProjectTest.AndroidManifestProperties System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at Microsoft.Build.Evaluation.Expander`2.MetadataExpander.ExpandMetadataLeaveEscaped(String expression, IMetadataTable metadata, ExpanderOptions options, IElementLocation elementLocation) at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation) in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/Evaluation/Expander.cs:line 414 … Limiting system mono to 6.12.0.137 prevents these errors.
Context: dotnet#6014 We are occasionally seeing test failures with many forms of: Could not load file or assembly 'Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. This seems to be caused by Mono 6.12.0.145 installed on some of the build machines. We can undo this change when dotnet#6014 goes in.
Context: #6014 We are occasionally seeing test failures with many forms of: Could not load file or assembly 'Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. This seems to be caused by Mono 6.12.0.145 installed on some of the build machines. We can undo this change when #6014 goes in.
I'm still seeing dotnet/msbuild#2554 on macOS when using MSBuild 16.10.0 NuGet packages, so I think we'll still need some OS specific logic for now... |
1bc3fcb to
a874e82
Compare
|
The workaround to set the |
43978ee to
7290658
Compare
Context: dotnet#6014 We are occasionally seeing test failures with many forms of: Could not load file or assembly 'Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. This seems to be caused by Mono 6.12.0.145 installed on some of the build machines. We can undo this change when dotnet#6014 goes in.
|
@pjcollins I tested this branch in VSCode on Mac OS. I can still debug the MSBuild Task tests so this looks good to me :) |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetXamarinProject.cs
Show resolved
Hide resolved
Related: dotnet/android#6014 Drops the OS specific MSBuild NuGet and system references and instead uses MSBuild 16.10.0 NuGet packages. This introduces an issue in our usage of `Microsoft.Build.Construction.ProjectRootElement.Create` in xamarin/xamarin-android on macOS, however we can work around it there.
Changes: http://github.com/xamarin/monodroid/compare/1f2ce156245ef1bf63ec8014882d283b3224216b...36536006a74d9fa9b08b14301f73b2e7da93d75d * xamarin/monodroid@d111a7a: [tools/msbuild] Add additional fallbacks to GetPrimaryCpuAbi. * xamarin/monodroid@3653600: Bump to xamarin/androidtools@14e679e and dotnet/android@ee49249 Changes: dotnet/android-tools@49936d6...c055fa8 * dotnet/android-tools@c055fa8: [Microsoft.Android.Build] Bump to MSBuild 16.10.0 We've been seeing a NuGet restore issue when running prepare on a macOS system with .NET 6 Preview 4 (or greater) installed: Restoring packages for /Users/peter/source/java.interop/tools/logcat-parse/logcat-parse.csproj... NU1202: Package Mono.CSharp 4.0.0.143 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Mono.CSharp 4.0.0.143 supports: net45 (.NETFramework,Version=v4.5) ... Errors in /Users/peter/source/java.interop/tools/logcat-parse/logcat-parse.csproj NU1202: Package Mono.CSharp 4.0.0.143 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Mono.CSharp 4.0.0.143 supports: net45 (.NETFramework,Version=v4.5) I have encountered other issues with .NET 6 Preview 4 and greater when building some projects targeting net6.0: Version 'x' of the .NET Core SDK requires at least version 16.10.0 of MSBuild. The current available version of MSBuild is 16.9.0. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available. These issues should be addressed by using MSBuild 16.10 on macOS.
7290658 to
59ea618
Compare
|
This should be ready to go, I think the emulator test issues against JDK 1.8 are being discussed/addressed in #6033 |
Changes: xamarin/monodroid@1f2ce15...3653600 * xamarin/monodroid@d111a7a: [tools/msbuild] Add additional fallbacks to GetPrimaryCpuAbi. * xamarin/monodroid@3653600: Bump to xamarin/androidtools@14e679e and ee49249 Changes: dotnet/android-tools@49936d6...c055fa8 * dotnet/android-tools@c055fa8: [Microsoft.Android.Build] Bump to MSBuild 16.10.0 We've been seeing a NuGet restore issue when running prepare on a macOS system with .NET 6 Preview 4 (or greater) installed: Restoring packages for /Users/peter/source/java.interop/tools/logcat-parse/logcat-parse.csproj... NU1202: Package Mono.CSharp 4.0.0.143 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Mono.CSharp 4.0.0.143 supports: net45 (.NETFramework,Version=v4.5) ... Errors in /Users/peter/source/java.interop/tools/logcat-parse/logcat-parse.csproj NU1202: Package Mono.CSharp 4.0.0.143 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Mono.CSharp 4.0.0.143 supports: net45 (.NETFramework,Version=v4.5) I have encountered other issues with .NET 6 Preview 4 and greater when building some projects targeting net6.0: Version 'x' of the .NET Core SDK requires at least version 16.10.0 of MSBuild. The current available version of MSBuild is 16.9.0. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available. These issues should be addressed by using MSBuild 16.10 on macOS.
Changes: https://github.com/xamarin/monodroid/compare/1f2ce156245ef1bf63ec8014882d283b3224216b...36536006a74d9fa9b08b14301f73b2e7da93d75d
Changes: dotnet/android-tools@49936d6...c055fa8
We've been seeing a NuGet restore issue when running prepare on a macOS
system with .NET 6 Preview 4 (or greater) installed:
I have encountered other issues with .NET 6 Preview 4 and greater when
building some projects targeting net6.0:
These issues should be addressed by using MSBuild 16.10 on macOS.