-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Improve LoadExtension to work correctly with dotnet run and lib* named libs #35617
base: main
Are you sure you want to change the base?
Conversation
@krwq - changes look straightforward, but I would like a review by @AndriySvyryd and @cincuranet once they are back from vacation to understand the entire workflow. |
} | ||
|
||
return searchDirs!.Split([ Path.PathSeparator ], StringSplitOptions.RemoveEmptyEntries); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return searchDirs!.Split([ Path.PathSeparator ], StringSplitOptions.RemoveEmptyEntries); | |
return searchDirs.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot change this because we're building against netstandard 2.0 where I'm getting:
- (for lack of
!
):error CS8602: Dereference of a possibly null reference.
- (using
(char, StringSplitOptions)
overload):error CS1503: Argument 2: cannot convert from 'System.StringSplitOptions' to 'char'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor code style changes, but otherwise LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Please hold off with merging until @roji tries out this change on OSX |
Currently if you package an SQLite extension in the nuget package by placing binaries in the
runtimes/<rid>/native
the extension will work fine when you dodotnet run -r <rid>
but when using justdotnet run
it won't pick up the dll because they end up in different directory than an app. Currently host uses propertyNATIVE_DLL_SEARCH_DIRECTORIES
to provide all paths where native dlls should be searched for but SQLite doesn't know about its existence. In normal scenario of just loading library this will happen automatically but since SQLite doesn't use that logic we need to account for it so this scenario works correctly.I've also added searching for libraries with
lib
prefixes because I noticed #24094 - please let me know if we don't want this (SQLite will only make sure correct extension is used for all OSes but it won't take care of thelib
prefix).Might also fix this but I haven't tested android: #24094