-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
MonoTests.System.Reflection.Emit.SaveTest.Save test fails in Release configuration with BCL linking on #1186
Comments
This doesn't look like a linker bug, as the assembly is created by the test itself, not by the linker. |
@radekdoulik: While that is indeed the case, it's only with a linked BCL that the problem occurs. Running the test with a Debug/unlinked BCL results in the test passing. We don't understand why or how linking would be involved, but it's the straw we're grasping at. |
Further looking into that, I have put the code from the test to simple android app and it works OK in the Release configuration. The first interface is So not sure yet what might be broken here. |
OK, the issue is the test is wrong :-) In the documentation it is clearly stated, that the interfaces are not returned in any particular order. https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2 |
@radekdoulik yes, it's not documented but @marek-safar stated that the runtime team aim for 100% compatibility with .NET, and the ordering tested for is what .NET does. As @jonpryor said, we're clutching at straws here as the linking was the only real difference between the builds and it is consistently reproducible. |
@grendello not sure I understand you here, when you say that it is not documented . The documentation says
|
@marek-safar Do you have link to our current |
@radekdoulik By 'not documented' I meant it isn't stated that the order must be kept. The wording you pasted states that it 'must not' depend on the order, which would make the test invalid, but as @marek-safar stated we want to keep compatibility with .NET as there might be code out there which relies on the particular behavior of .NET (even if it isn't a documented one) |
You might just be getting lucky with some idioms/patterns in .NET, and might change with others, or might change across other implementations. The documentation is right, we should fix the test. |
On the implementation side of things, it appears that I'm going to hazard a guess that |
I'm ok with the test fix but we have bug reports like https://bugzilla.xamarin.com/show_bug.cgi?id=31020 and similar so you could actually end up fixing this issue in XA for real |
Updated the System.Reflection.Emit/SaveTest to not depend on order of interfaces returned from the System.Type::GetInterfaces method, as the order is not guaranted. As described in the [documentation][0]. Also see github [issue][1] for more information and reasoning. [0]: https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2 [1]: dotnet/android#1186
Updated the System.Reflection.Emit/SaveTest to not depend on order of interfaces returned from the System.Type::GetInterfaces method, as the order is not guaranted. As described in the [documentation][0]. Also see github [issue][1] for more information and reasoning. [0]: https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2 [1]: dotnet/android#1186
Updated the System.Reflection.Emit/SaveTest to not depend on order of interfaces returned from the System.Type::GetInterfaces method, as the order is not guaranted. As described in the [documentation][0]. Also see github [issue][1] for more information and reasoning. [0]: https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2 [1]: dotnet/android#1186
Updated the System.Reflection.Emit/SaveTest to not depend on order of interfaces returned from the System.Type::GetInterfaces method, as the order is not guaranted. As described in the [documentation][0]. Also see github [issue][1] for more information and reasoning. [0]: https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2 [1]: dotnet/android#1186
Updated the System.Reflection.Emit/SaveTest to not depend on order of interfaces returned from the System.Type::GetInterfaces method, as the order is not guaranted. As described in the [documentation][0]. Also see github [issue][1] for more information and reasoning. [0]: https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2 [1]: dotnet/android#1186
Updated the System.Reflection.Emit/SaveTest to not depend on order of interfaces returned from the System.Type::GetInterfaces method, as the order is not guaranted. As described in the [documentation][0]. Also see github [issue][1] for more information and reasoning. [0]: https://msdn.microsoft.com/en-us/library/system.type.getinterfaces(v=vs.110).aspx#Anchor_2 [1]: dotnet/android#1186
And enable the SaveTest again for Release configuration.
…cations. (dotnet#5708) Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1288717 Context: xamarin/monodroid@83de4b4 Changes: xamarin/monodroid@b2a750a...4163ee9 * xamarin/monodroid@4163ee947: [Xamarin.Android.Build.Tasks] Support FastDev for System Apps (dotnet#1177) (dotnet#1186) * xamarin/monodroid@947c6ef72: Bump to xamarin/xamarin-android/d16-9@877f5727 (dotnet#1183) The new fast deployment system (xamarin/monodroid@767f6471) broke fast deployment for system-installed applications. This is fixed in xamarin/monodroid@4163ee94. Adds unit tests to stop this kind of regression in the future. In order to install a `system` application we need a few things: 1. The emulator MUST be started with the `-system-writable` argument 2. The `.apk` needs to be signed with a platform keystore, found at: https://github.com/aosp-mirror/platform_build/tree/master/target/product/security 3. `AndroidManifest.xml` must set [`/manifest/@android:sharedUserId`][0] to `android.uid.system`: <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:sharedUserId="android.uid.system" …> </manifest> See also: * https://medium.com/xrpractices/android-system-apps-development-d73bedfb8def [0]: https://developer.android.com/guide/topics/manifest/manifest-element#uid
…cations. (#5708) Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1288717 Context: xamarin/monodroid@83de4b4 Changes: xamarin/monodroid@b2a750a...4163ee9 * xamarin/monodroid@4163ee947: [Xamarin.Android.Build.Tasks] Support FastDev for System Apps (#1177) (#1186) * xamarin/monodroid@947c6ef72: Bump to xamarin/xamarin-android/d16-9@877f5727 (#1183) The new fast deployment system (xamarin/monodroid@767f6471) broke fast deployment for system-installed applications. This is fixed in xamarin/monodroid@4163ee94. Adds unit tests to stop this kind of regression in the future. In order to install a `system` application we need a few things: 1. The emulator MUST be started with the `-system-writable` argument 2. The `.apk` needs to be signed with a platform keystore, found at: https://github.com/aosp-mirror/platform_build/tree/master/target/product/security 3. `AndroidManifest.xml` must set [`/manifest/@android:sharedUserId`][0] to `android.uid.system`: <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:sharedUserId="android.uid.system" …> </manifest> See also: * https://medium.com/xrpractices/android-system-apps-development-d73bedfb8def [0]: https://developer.android.com/guide/topics/manifest/manifest-element#uid
A test from the Mono BCL test suite (MonoTests.System.Reflection.Emit.SaveTest.Save) fails when the tests are built in Release mode with linking set to SdkOnly.
It seems that the linker somehow changes the order of interfaces in emitted code since turning BCL linking off makes the test work again. The test also works fine in Debug configuration (with the linker off)
Steps to Reproduce
make CONFIGURATION=Release run-apk-tests
from the top Xamarin.Android dirTestResult-Xamarin.Android.Bcl_Tests.nunit-Release.xml
in the top Xamarin.Android directory)Expected Behavior
The test should run fine with BCL linking on
Actual Behavior
The test fails when executed with BCL linking on
Version Information
Xamarin.Android/master (
c4e81655ac22b06806e732e9dd0bc729e8d2c1d7
)Test failure
The text was updated successfully, but these errors were encountered: