-
Notifications
You must be signed in to change notification settings - Fork 147
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
Hardcoded DllImportResolver always chooses libclang 3.5 #229
Comments
Note that this logic effectively skips libclang installed from libclang.runtime.ubuntu.18.04-x64 nuget package rendering said package to be useless. |
This resolves the libraries based on the default search paths for the system and so it will preference an exact match before trying to fallback to just The NuGet restore cache is not part of the default search locations for native library resolution and so there is no attempt to search for the package there. Any attempt to manually use the NuGet restore cache would be dependent on knowing the correct RID resolution logic in relation to the host platform, which is effectively a non-starter. The native library not being copied to the output on Linux (it is correctly copied on Windows and macOS) is due to a NuGet issue in that it only looks for something matching Until NuGet provides the appropriate fix for copying the binaries to the output, you will need to do something to ensure the correct package can be resolved. Some options include:
NuGet/Home#10571 tracks the largest issue around native packages for NuGet and I'd recommend upvoting it |
Closing this as the original issue was answered. Newer versions of ClangSharp now validate the loaded version of libClang matches the expected version. |
Ubuntu 18.04
Installed packages:
/usr/lib/x86_64-linux-gnu/libclang.so.1
symlink points to 3.5This code
https://github.com/microsoft/ClangSharp/blob/dd684be635c90cb31e4c228e9896ca1fc7d47d7b/sources/ClangSharp/Interop.Extensions/clang.ResolveLibrary.cs#L13-L36
prevents me from changing that horrible behavior since static ctor will fail with TypeInitializationException if I try to set my own resolver.
The text was updated successfully, but these errors were encountered: