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

Support OSX #187

Open
ermshiperete opened this issue Jun 21, 2023 · 8 comments
Open

Support OSX #187

ermshiperete opened this issue Jun 21, 2023 · 8 comments

Comments

@ermshiperete
Copy link
Member

macOS uses dylib files instead of so and the file pattern is libicuuc.[version].dylib instead of libicuuc.so.[version], so our current approach for loading unmanaged ICU doesn't work.

The relevant code is in source/icu.net/NativeMethods/NativeMethods.cs.

See discussion on Slack.

@ermshiperete
Copy link
Member Author

See also #141

@rmunn
Copy link

rmunn commented Jul 26, 2023

Since the Slack discussion may not be accessible to everyone (e.g., any open-source contributors who might find this), here's the important parts from the discussion:

Relevant code from source/icu.net/NativeMethods/NativeMethods.cs:

var libName = $"lib{basename}.so.{icuVersion}";

Relevant comment from Slack discussion:

It looks like we always assume non-Windows OSes name their libraries with .so. However, macOS (at least Catalina) uses dylib files, not so files. Also, while we assume the icuuc library would be libicuuc.so.[version], on macOS it looks like the file pattern is libicuuc.[version].dylib. On top of that, I only see icu4c available on macOS if you install Homebrew or build it yourself. (libicuuc is part of the icu4c package)

It looks like #142 was an attempt to fix this issue, but didn't completely solve it.

sillsdev/TheCombine#927 is probably caused by this as well.

@imnasnainaec
Copy link
Contributor

imnasnainaec commented Feb 27, 2024

@rmunn I was hoping to try out a fix on my mac: master...imnasnainaec:icu-dotnet:mac

...but I'm not sure how to build on/for macOSX to test it out.

(Attempting: #188)

@chrisvire
Copy link
Member

@ermshiperete What is the state of this issue?

@imnasnainaec
Copy link
Contributor

At least for its use in The Combine, the current hurdle is getting icu-dotnet to find my libicuuc. I'm not sure yet whether there's more required from the icu-dotnet side of things or if it's a matter of local setup.

@rmunn
Copy link

rmunn commented Aug 10, 2024

One issue I've discovered is that depending on how you installed icu4c, the installed .dylib files might not be on the standard library search path. Yesterday we tried running brew install icu4c and it installed libicuuc.74.2.dylib (and a libicuuc.74.dylib symlink) into /opt/homebrew/Cellar/icu4c/lib (I think, I'll have to go back and check).

One thing that might help is https://github.com/sickcodes/Docker-OSX which builds off the work done by https://github.com/kholia/OSX-KVM. Running Mac OS in a Docker container might allow automated testing, so we can make sure icu.net can find the libraries in all common install scenarios.

@lyonsil
Copy link
Contributor

lyonsil commented Aug 12, 2024

For Platform.Bible we bundle in the icu4c libraries along with our application builds so we don't have to worry about this. Since OSX doesn't provide them we assume we can't rely on them being anywhere in the path.

@imnasnainaec
Copy link
Contributor

For reference, prs #194, #198, #200 were toward resolving this issue.

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

No branches or pull requests

5 participants