-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Build Debug and Release device tests #14392
Conversation
Seems @mandel-macaque wants to make this consume the nupkg created here, and we already build them in debug/release |
seems some failures on release mode for Android, soem related with leak tests, any ideas @jonathanpeppers @PureWeen ? |
In 880ce09, I made XamlC try `System.Private.CoreLib` for XAML like: xmlns:sys="clr-namespace:System;assembly=mscorlib" This fixed cases where `mscorlib.dll` is trimmed away in `Release` mode. However, building the device tests this morning in `Release` mode I got the error: Elements\RadioButton\RadioButtonUsing.xaml Failed to resolve assembly: 'System.Private.CoreLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' at Microsoft.Maui.Controls.Build.Tasks.XamlCAssemblyResolver.Resolve(AssemblyNameReference name) in C:\src\maui\src\Controls\src\Build.Tasks\XamlCAssemblyResolver.cs:line 25 at Microsoft.Maui.Controls.Build.Tasks.ModuleDefinitionExtensions.<>c__DisplayClass21_0.<GetTypeDefinition>b__0(ValueTuple`2 x) in C:\src\maui\src\Controls\src\Build.Tasks\ModuleDefinitionExtensions.cs:line 257 at Microsoft.Maui.Controls.Build.Tasks.XamlCache.GetOrAdd[TKey,TValue](Dictionary`2 dictionary, TKey key, Func`2 valueFactory) in C:\src\maui\src\Controls\src\Build.Tasks\XamlCache.cs:line 27 at Microsoft.Maui.Controls.Build.Tasks.ModuleDefinitionExtensions.GetTypeDefinition(ModuleDefinition module, XamlCache cache, ValueTuple`3 type) in C:\src\maui\src\Controls\src\Build.Tasks\ModuleDefinitionExtensions.cs:line 255 at Microsoft.Maui.Controls.Build.Tasks.XmlTypeExtensions.<>c__DisplayClass3_0.<TryGetTypeReference>b__0(ValueTuple`3 typeInfo) in C:\src\maui\src\Controls\src\Build.Tasks\XmlTypeExtensions.cs:line 88 at Microsoft.Maui.Controls.Xaml.XmlTypeXamlExtensions.GetTypeReference[T](XmlType xmlType, IEnumerable`1 xmlnsDefinitions, String defaultAssemblyName, Func`2 refFromTypeInfo) in C:\src\maui\src\Controls\src\Xaml\XmlTypeXamlExtensions.cs:line 96 at Microsoft.Maui.Controls.Build.Tasks.XmlTypeExtensions.TryGetTypeReference(XmlType xmlType, XamlCache cache, ModuleDefinition module, IXmlLineInfo xmlInfo, TypeReference& typeReference) in C:\src\maui\src\Controls\src\Build.Tasks\XmlTypeExtensions.cs:line 85 at Microsoft.Maui.Controls.Build.Tasks.XmlTypeExtensions.GetTypeReference(XmlType xmlType, XamlCache cache, ModuleDefinition module, IXmlLineInfo xmlInfo) in C:\src\maui\src\Controls\src\Build.Tasks\XmlTypeExtensions.cs:line 99 at Microsoft.Maui.Controls.Build.Tasks.CreateObjectVisitor.Visit(ElementNode node, INode parentNode) at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in C:\src\maui\src\Controls\src\Xaml\XamlNode.cs:line 161 at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in C:\src\maui\src\Controls\src\Xaml\XamlNode.cs:line 152 at Microsoft.Maui.Controls.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in C:\src\maui\src\Controls\src\Xaml\XamlNode.cs:line 209 at Microsoft.Maui.Controls.Build.Tasks.XamlCTask.TryCoreCompile(MethodDefinition initComp, ILRootNode rootnode, String xamlFilePath, TaskLoggingHelper loggingHelper, Exception& exception) in C:\src\maui\src\Controls\src\Build.Tasks\XamlCTask.cs:line 280 `XamlCAssemblyResolver` needed to add a case for `System.Private.CoreLib`. I'm not sure why I didn't hit this earlier, but we should hopefully catch this on CI next time when this one lands: dotnet#14392
The memory leak tests are passing for me locally on device & emulator, but I found this issue: #14492 Let me try it a few more times. |
I pushed a change that seems like it made these tests pass 3 times in a row in Release mode. Let's see how it does on CI? |
/rebase |
Hopefully these make it pass in Release mode?
9977e99
to
c8a9b81
Compare
Ok these look real failures on Android in release, IsInAccessibleTree |
In 880ce09, I made XamlC try `System.Private.CoreLib` for XAML like: xmlns:sys="clr-namespace:System;assembly=mscorlib" This fixed cases where `mscorlib.dll` is trimmed away in `Release` mode. However, building the device tests this morning in `Release` mode I got the error: Elements\RadioButton\RadioButtonUsing.xaml Failed to resolve assembly: 'System.Private.CoreLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' at Microsoft.Maui.Controls.Build.Tasks.XamlCAssemblyResolver.Resolve(AssemblyNameReference name) in C:\src\maui\src\Controls\src\Build.Tasks\XamlCAssemblyResolver.cs:line 25 at Microsoft.Maui.Controls.Build.Tasks.ModuleDefinitionExtensions.<>c__DisplayClass21_0.<GetTypeDefinition>b__0(ValueTuple`2 x) in C:\src\maui\src\Controls\src\Build.Tasks\ModuleDefinitionExtensions.cs:line 257 at Microsoft.Maui.Controls.Build.Tasks.XamlCache.GetOrAdd[TKey,TValue](Dictionary`2 dictionary, TKey key, Func`2 valueFactory) in C:\src\maui\src\Controls\src\Build.Tasks\XamlCache.cs:line 27 at Microsoft.Maui.Controls.Build.Tasks.ModuleDefinitionExtensions.GetTypeDefinition(ModuleDefinition module, XamlCache cache, ValueTuple`3 type) in C:\src\maui\src\Controls\src\Build.Tasks\ModuleDefinitionExtensions.cs:line 255 at Microsoft.Maui.Controls.Build.Tasks.XmlTypeExtensions.<>c__DisplayClass3_0.<TryGetTypeReference>b__0(ValueTuple`3 typeInfo) in C:\src\maui\src\Controls\src\Build.Tasks\XmlTypeExtensions.cs:line 88 at Microsoft.Maui.Controls.Xaml.XmlTypeXamlExtensions.GetTypeReference[T](XmlType xmlType, IEnumerable`1 xmlnsDefinitions, String defaultAssemblyName, Func`2 refFromTypeInfo) in C:\src\maui\src\Controls\src\Xaml\XmlTypeXamlExtensions.cs:line 96 at Microsoft.Maui.Controls.Build.Tasks.XmlTypeExtensions.TryGetTypeReference(XmlType xmlType, XamlCache cache, ModuleDefinition module, IXmlLineInfo xmlInfo, TypeReference& typeReference) in C:\src\maui\src\Controls\src\Build.Tasks\XmlTypeExtensions.cs:line 85 at Microsoft.Maui.Controls.Build.Tasks.XmlTypeExtensions.GetTypeReference(XmlType xmlType, XamlCache cache, ModuleDefinition module, IXmlLineInfo xmlInfo) in C:\src\maui\src\Controls\src\Build.Tasks\XmlTypeExtensions.cs:line 99 at Microsoft.Maui.Controls.Build.Tasks.CreateObjectVisitor.Visit(ElementNode node, INode parentNode) at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in C:\src\maui\src\Controls\src\Xaml\XamlNode.cs:line 161 at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in C:\src\maui\src\Controls\src\Xaml\XamlNode.cs:line 152 at Microsoft.Maui.Controls.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in C:\src\maui\src\Controls\src\Xaml\XamlNode.cs:line 209 at Microsoft.Maui.Controls.Build.Tasks.XamlCTask.TryCoreCompile(MethodDefinition initComp, ILRootNode rootnode, String xamlFilePath, TaskLoggingHelper loggingHelper, Exception& exception) in C:\src\maui\src\Controls\src\Build.Tasks\XamlCTask.cs:line 280 `XamlCAssemblyResolver` needed to add a case for `System.Private.CoreLib`. I'm not sure why I didn't hit this earlier, but we should hopefully catch this on CI next time when this one lands: #14392
Fixes: dotnet#9422 Context: https://github.com/dotnet/maui/blob/51df629f946122945cee8f57baed80eb48e45c4e/src/Controls/src/Core/Properties/AssemblyInfo.cs#L79 In `Microsoft.Maui.Core.dll`, the default `x` namespace is defined as: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] The problem being that in apps on iOS and Android where `PublishTrimmed` is `true`, `mscorlib.dll` will get trimmed away and callsites will use `System.Private.CoreLib.dll` instead. This is very much related to the issue fixed in 880ce09. Unfortunately, my fix wasn't sufficient, because the `AssemblyName` name in this case is the full name: AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" To solve the issue, let's also check for `StartsWith("mscorlib,")`. We *could* add a new `XmlnsDefinition`, but this doesn't feel right: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] It doesn't make sense for a "private" assembly to appear in XAML intellisense. I also moved these tests to a new `XamlTests` class, as it didn't really make sense to put them with `RadioButton` tests. Note that these new tests wouldn't fail until we start running device tests in `Release` mode: dotnet#14392
Fixes: #9422 Context: https://github.com/dotnet/maui/blob/51df629f946122945cee8f57baed80eb48e45c4e/src/Controls/src/Core/Properties/AssemblyInfo.cs#L79 In `Microsoft.Maui.Core.dll`, the default `x` namespace is defined as: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] The problem being that in apps on iOS and Android where `PublishTrimmed` is `true`, `mscorlib.dll` will get trimmed away and callsites will use `System.Private.CoreLib.dll` instead. This is very much related to the issue fixed in 880ce09. Unfortunately, my fix wasn't sufficient, because the `AssemblyName` name in this case is the full name: AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" To solve the issue, let's also check for `StartsWith("mscorlib,")`. We *could* add a new `XmlnsDefinition`, but this doesn't feel right: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] It doesn't make sense for a "private" assembly to appear in XAML intellisense. I also moved these tests to a new `XamlTests` class, as it didn't really make sense to put them with `RadioButton` tests. Note that these new tests wouldn't fail until we start running device tests in `Release` mode: #14392
Seems we still have 2 failing tests on android/ release IsInAccessibleTree and ExcludedWithChildren |
/rebase |
Fixes: #9422 Context: https://github.com/dotnet/maui/blob/51df629f946122945cee8f57baed80eb48e45c4e/src/Controls/src/Core/Properties/AssemblyInfo.cs#L79 In `Microsoft.Maui.Core.dll`, the default `x` namespace is defined as: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] The problem being that in apps on iOS and Android where `PublishTrimmed` is `true`, `mscorlib.dll` will get trimmed away and callsites will use `System.Private.CoreLib.dll` instead. This is very much related to the issue fixed in 880ce09. Unfortunately, my fix wasn't sufficient, because the `AssemblyName` name in this case is the full name: AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" To solve the issue, let's also check for `StartsWith("mscorlib,")`. We *could* add a new `XmlnsDefinition`, but this doesn't feel right: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] It doesn't make sense for a "private" assembly to appear in XAML intellisense. I also moved these tests to a new `XamlTests` class, as it didn't really make sense to put them with `RadioButton` tests. Note that these new tests wouldn't fail until we start running device tests in `Release` mode: #14392
Fixes: #9422 Context: https://github.com/dotnet/maui/blob/51df629f946122945cee8f57baed80eb48e45c4e/src/Controls/src/Core/Properties/AssemblyInfo.cs#L79 In `Microsoft.Maui.Core.dll`, the default `x` namespace is defined as: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] The problem being that in apps on iOS and Android where `PublishTrimmed` is `true`, `mscorlib.dll` will get trimmed away and callsites will use `System.Private.CoreLib.dll` instead. This is very much related to the issue fixed in 880ce09. Unfortunately, my fix wasn't sufficient, because the `AssemblyName` name in this case is the full name: AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" To solve the issue, let's also check for `StartsWith("mscorlib,")`. We *could* add a new `XmlnsDefinition`, but this doesn't feel right: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] It doesn't make sense for a "private" assembly to appear in XAML intellisense. I also moved these tests to a new `XamlTests` class, as it didn't really make sense to put them with `RadioButton` tests. Note that these new tests wouldn't fail until we start running device tests in `Release` mode: #14392
Description of Change
Current state:
This PR:
Everything is both Debug and Release
Issues Fixed
Fixes #14390