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

Use NativeLibrary for all OSes #200

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

imnasnainaec
Copy link
Contributor

No description provided.

Copy link
Contributor

@lyonsil lyonsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a high level these changes make sense to me. Other than the one thing I pointed out with dlerror, my only concern is how much testing this might need on Windows and Linux to make sure there isn't some unexpected impact. NativeLibrary should work fine, but I don't think the unit tests really exercise dynamic library loading deeply (e.g., does NativeLibrary follow all the same path searching rules that libdl uses?). I'm guessing it will not be a problem, but that's just a guess.

source/icu.net/NativeMethods/NativeMethods.cs Outdated Show resolved Hide resolved
@imnasnainaec
Copy link
Contributor Author

At a high level these changes make sense to me. Other than the one thing I pointed out with dlerror, my only concern is how much testing this might need on Windows and Linux to make sure there isn't some unexpected impact. NativeLibrary should work fine, but I don't think the unit tests really exercise dynamic library loading deeply (e.g., does NativeLibrary follow all the same path searching rules that libdl uses?). I'm guessing it will not be a problem, but that's just a guess.

@lyonsil Yeah, I was having similar concerns, so I left this in draft until it could be given more thorough consideration.

@imnasnainaec imnasnainaec marked this pull request as ready for review June 25, 2024 21:28
Copy link

github-actions bot commented Jun 25, 2024

Test Results

       5 files  ±0     403 suites  ±0   5s ⏱️ -1s
   431 tests ±0     427 ✔️ ±0    4 💤 ±0  0 ±0 
2 193 runs  ±0  2 095 ✔️ ±0  98 💤 ±0  0 ±0 

Results for commit 4137022. ± Comparison against base commit fddc930.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@lyonsil lyonsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The overall question about "how do we know that NativeLibrary will be functionally compatible with the previous approach for Windows and Linux users on .NET 6.0 or later?" is still there, but I don't see anything in these changes that looks like a regression or a problem.

@imnasnainaec
Copy link
Contributor Author

Looks good to me. The overall question about "how do we know that NativeLibrary will be functionally compatible with the previous approach for Windows and Linux users on .NET 6.0 or later?" is still there, but I don't see anything in these changes that looks like a regression or a problem.

I'll try to test it out more.

For reference, here's the code NativeLibrary uses: for Unix; for Windows

@imnasnainaec
Copy link
Contributor Author

For Unix, it uses [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_LoadLibrary", StringMarshalling = StringMarshalling.Utf8)] (in Interop.Sys)

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified (using a locally built package with FieldWorks) that this code does not disrupt the framework clients of the .dll, and I don't see any reason that it shouldn't work for dotnet clients on Windows.

@jasonleenaylor jasonleenaylor merged commit 9bce747 into sillsdev:master Jun 26, 2024
7 checks passed
@imnasnainaec imnasnainaec deleted the native-library branch June 26, 2024 17:32
@imnasnainaec imnasnainaec mentioned this pull request Aug 12, 2024
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

Successfully merging this pull request may close these issues.

3 participants