Skip to content
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

Make LurchTable work on Xamarin.iOS #16

Open
ste8 opened this issue Nov 4, 2019 · 6 comments
Open

Make LurchTable work on Xamarin.iOS #16

ste8 opened this issue Nov 4, 2019 · 6 comments

Comments

@ste8
Copy link

ste8 commented Nov 4, 2019

We are trying to run Lucene.Net 4.8 on a Xamarin.iOS app, but it doesn't work due to the fact that it depends on LurchTable, that uses some instructions not fully supported by Xamarin.iOS compiler.

In particular, the compiler seems to have problems with the structs that implement generic interfaces, and within LurchTable there are several of them.

This problem has been discussed here mono/mono#7016
It seems that the guys at Mono tried to support these instructions, but I think it didn't work and in one of the last comments they say "The LurchTable was quite a complex code that was not necessary for the particular use. In fact it used so complex generics that it managed to break Mono AOT in some cases".

In Lucene.Net, LurchTable was preferred to other LruCache implementations because their performance weren't good enough, so it make sense to continue to use LurchTable, but we'd like to find a way to make it work on Xamarin.iOS as well (Lucene.Net is trying to support also this platform).

We made a test, converting the generic structs inside LurchTable with classes: the test worked, but we don't know if this fix is right, regarding both performance and correctness.

Can you suggest the correct way to make LurchTable work in Xamarin.iOS as well?

PS: just to be clear, LurchTable works on Xamarin.iOS when the app is compiled for iOS simulator, but it doesn't work when is compiled for the devices, using the AOT compiler.

@NightOwl888
Copy link

@ste8

Any chance you could share the changes you made that fixed the error from happening when using LurchTable on Xamarin.iOS?

@ste8
Copy link
Author

ste8 commented Dec 11, 2019

We only modified the struct "AddInfo", converting it to a class, and it worked for us... but it was just a simple test.

@NightOwl888
Copy link

Thanks. Just out of curiosity, does it work on Xamarin.iOS if you de-nest the AddInfo struct and change its definition to the following?

struct AddInfo<TKey, TValue> : ICreateOrUpdateValue<TKey, TValue>

If that test works, I think we have a way forward without sacrificing any performance.

@NightOwl888
Copy link

Do note that I am working on getting Lucene.NET beta00007 out within the next few days. We'd like to include a fix for this, if possible. I have attempted to do the above test myself, but it is much more involved than I thought it would be to get Xamarin.iOS up and running on Azure DevOps.

@NightOwl888
Copy link

Great. We have confirmation the above fix will work @ LUCENENET-602

@csharptest - Are you still around to maintain this project? If I submit a PR with the fix, will you release it on NuGet?

Also, we will need to add targets for

  • .NET Standard 1.x
  • .NET Standard 2.0

to be completely compatible with our project.

@NightOwl888
Copy link

Ping.

@csharptest - Any chance we can update this library to work with .NET Standard/Xamarin.iOS so we can remove LurchTable from our codebase?

There already is a clone here that upgraded the project to .NET Standard, but we would prefer to utilize the original library as a dependency, if possible.

It also doesn't look like you have strong named the assembly, which we will also need.

If you don't want to maintain the library anymore, could you please at least agree to give me permission to update the package on NuGet.org so I can maintain it from a fork?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants