-
Notifications
You must be signed in to change notification settings - Fork 473
Nuget Universal Props File #658
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
Nuget Universal Props File #658
Conversation
…2.0 directory. This should mean it executes for all platforms.
On windows I take the following steps to test nuget package.
I haven't tried this way in Linux or MAC because VS only supports Windows. Maybe dotnet cli has some instructions to use local path. |
I used the same approach with MacOS and Rider. |
Looks like this still doesn't fix it :( The issue only seems to happen when publishing as "self contained". |
…his has no special handling by the packager, and so doesn't get flattened when we don't want it to!
@AsakusaRinne @SignalRT thanks for the tips. I've been testing with a local folder as suggested and I think this now works. I'm not very confident though, I've never done much with nuget before! I'd really appreciate it if you guys could build packages and test them yourselves. The issue I'm trying to fix is:
This change should fix that last issue. |
I guess the tests failing tell me this did not, in fact, fix the problem :( |
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 haven't had any more time to look at it since last time, but it's been stalled because I didn't understand what caused CI to fail last time. It's obviously some kind of path resolution issue, but it's very painful to debug! I'll close this one for now since it doesn't work at the moment and we can go ahead with your more developed PRs. This is a really important issue though - I think it's probably the most important bug to fix in LLamaSharp! |
What about opening an issue for it so that we won't forget it? |
I think #382 covers it. |
@martindevans IIRC you have once tried flatten the libraries with different names but it somehow failed. May I ask about the reason of the failure? I couldn't find the related history. :) I'm looking into this issue and am wondering if it's a possible solution:
-- runtimes
-- native
-- win-x64
-- avx2
* win-x64-avx2-llama.dll
-- cuda11
* win-x64-cuda11-llama.dll
-- osx-arm64
...
-- linux-x64
...
# If we select windows cuda 11 and avx2 backend in proper order on Windows, the file structure will become what's shown below
-- runtimes
-- native
-- win-x64
-- avx2
* win-x64-avx2-llama.dll
* llama.dll # file is copied.
-- cuda11
* win-x64-cuda11-llama.dll
* llama.dll # file is copied.
-- osx-arm64
...
-- linux-x64
... TBH I suspected path could not be found correctly after publishing if we take the way below. Therefore I'm also wondering the following alternative. -- llama
* win-x64-avx2-llama.dll
* win-x64-cuda11-llama.dll
* linux-x64-cuda12-llama.so
...
# If we select windows cuda 11 and avx2 backend in proper order on Windows, the file structure will become what's shown below. In this way, the file structure will be resumed to what it is now!
-- llama
* win-x64-avx2-llama.dll
* win-x64-cuda11-llama.dll
* linux-x64-cuda12-llama.so
...
-- runtimes
-- win-x64
-- native
-- avx2
* llama.dll # file is copied.
-- cuda11
* llama.dll # file is copied. Thus, things partially went back to your previous work. So your answer will really help a lot. :) |
The issue was that I could rename the DLLs that we load directly (e.g. llama.dll). However, some DLLs we do not load ourselves (e.g. clblast.dll) and they cannot be renamed, so we could still need to handle them somehow. The folder hierarchy solves it by having the dependencies next to the ones we load directly.
Ideally I'd like a solution which doesn't need dynamically writing DLLs to folders. Most software should be installed in a readonly directory, and copying at runtime would be incompatible with that. If we can work out how to get the folder hierarchy distributed properly it's all fine. I think this PR was 90% of the way there, and actually was just breaking in CI. |
Thank you for the clarification! Glad to hear that it is going to be resolved. I'll head to another issues then |
Moved the .props file to build directory, instead of just netstandard2.0 directory. This should mean it executes for all platforms.
I haven't tested this, I'm not sure how to best test a nuget change. Any assistance there would be appreciated!