Comments (20)
Thanks for the report! I think this should be fixed on the main
branch after #301
Are you seeing this using the latest release or from git?
from extism.
code.wasm
was from main 9e57369. And as can be seen in https://github.com/christophwille/ExtismHello/blob/c21f4c1eeb0bdaf54a273b0d61260505df0253e1/src/ExtismHello/ExtismHello.csproj#L11 I am using NuGet latest.
from extism.
@christophwille #301 is a change to the runtime which is unreleased. You're on the release 0.4.0. you can pull down the runtime and re-compile from source using this command: https://extism.org/docs/install#build-from-source
though I'm not sure it if it will work for windows or not. If you're having trouble we can publish a new version for you. Just let us know!
from extism.
You could also, maybe, try downgrading to 0.3.0
from extism.
@christophwille Actually, i just realized that there are 2 dotnet libraries. One that embeds the runtime and one that doesn't. Which one are you using?
https://www.nuget.org/packages/Extism.Sdk
https://www.nuget.org/packages/Extism.runtime.win-x64
from extism.
I have included both as per the documentation https://extism.org/docs/integrate-into-your-codebase/dotnet-host-sdk/ as I am on Windows.
from extism.
Btw, is this is a point-in-time thing that Windows behaves differently? I am using Wasmtime (.NET) someplace else, and that comes with batteries included no matter which platform I am on (Sqlite behaves very much the same, just to throw in another native dependency NuGet).
from extism.
Hmm are both meant to be installed? My understanding was that runtime.win-x64
one comes with the libextism runtime embedded in the library where the other one expects the shared object to be somewhere installed on the machine.
I bring it up because the fix is in the runtime: #301
Perhaps @mhmd-azeez can chime in
from extism.
Hello @bhelx, if you use the runtime.win-x64
nuget package you won't need to install extism on windows.
But I think @christophwille is saying (please correct me if I am wrong) that .NET wrappers for other native libraries (e.g. sqlite) ship native libraries for all platforms as nuget packages while extism only ships it for win-x64
.
from extism.
@bhelx I just realized I had misread your question. Yes, if you want to deploy your host on Windows, you should reference both the SDK nuget package and the runtime nuget package. The runtime nuget package only contains the native binaries and its release schedule is tied to extism itself.
The libraries that publish nuget packages for all platforms (i.e. runtime.all
) that references the individual platforms. If we had that, then the SDK nuget could have taken dependency on runtime.all
and users would't have to know about the runtime nuget packages at all. But it doesn't make much sense in our case because we only publish windows-x64 binaries as a nuget package
from extism.
Ignoring the original error for a second and getting back to the packages (I don't have my Air M1 nor my Surface X ARM64 on me at the moment) - given my original project referencing both NuGets:
- This works on Windows x64 (obviously, except of course the error that prompted this issue)
- On my ARM64 Windows machine, it won't. Given the runtime x64 NuGet, and no ARM64 runtime NuGet atm.
- On my Air M1 - what will happen there? Will it complain about the Windows x64 runtime NuGet? (never tried that) Or simply ignore it? And will it somehow tell me I am missing something else to make it work? (.NET Devs do expect that NuGets work across architectures)
What I am getting at here is the developer experience - do I need csproj gymnastics to make it work on multiple platforms, and if so, which ones? Is this a point in time thing, or will this always be the case?
Bonus question: why netstandard2.1? Which downlevel platforms really make this a necessity? (anything but 6.0 is out of support on the Core side of the house, netfw full never was supported for netstandard2.1, Xamarin is dead, Mono more or less too, and that old version of Unity?)
from extism.
This works on Windows x64 (obviously, except of course the error that prompted this issue)
This bug should be fixed once a new version of the Extism runtime is released, the fix is already merged #301
On my ARM64 Windows machine, it won't. Given the runtime x64 NuGet, and no ARM64 runtime NuGet atm.
Currently, Extism only publishes binaries for win-64
, so win-86
and win-arm64
don't have any published binaries, but I am guessing you can build them from source. Maybe @bhelx can comment on whether we will start building binaries for them too.
On my Air M1 - what will happen there? Will it complain about the Windows x64 runtime NuGet? (never tried that) Or simply ignore it? (.NET Devs do expect that NuGets work across architectures)
The Extism.runtime.win-x64
package basically contains the runtime DLL and copies it to the correct output folder. It doesn't affect the app when running on mac in any way. So you can safely ignore it if you intend to run the host on mac. Instead, you can install extism on the mac itself and it should work fine: https://extism.org/docs/install/
We had a long discussion on #119 and ended up with the current solution. Basically the idea is, for all other SDKs, the expectation is that the you install the Extism runtime on the machine. But because there is no straightforward way to install the runtime on Windows and Windows is an important target for .NET developers, we decided to publish the win-x64
runtime as a nuget package. I don't know if this will change in the future or not.
from extism.
Bonus question: why netstandard2.1? Which downlevel platforms really make this a necessity? (anything but 6.0 is out of support on the Core side of the house, netfw full never was supported for netstandard2.1, Xamarin is dead, Mono more or less too, and that old version of Unity?)
There was someone who was experimenting with using Extism in Unity. And I didn't want to unnecessarily exclude .NET Core versions. .netstandard2.1
has Span<T>
which was all that was necessary for a performant wrapper
from extism.
I updated to 0.5.0 https://github.com/christophwille/ExtismHello/blob/7b7c9c633d994040454662fb6ef1ba8a778a5bde/src/ExtismHello/ExtismHello.csproj#L11 just now (had to add an empty HostFunction[] https://github.com/christophwille/ExtismHello/blob/7b7c9c633d994040454662fb6ef1ba8a778a5bde/src/ExtismHello/Program.cs#L7)
However, I still get
{"count": 3}
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74\library\std\src\thread\mod.rs:1458:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
from extism.
I had a look around the filesystem - and instead of doing a Clean, I also decided to delete bin folder directly in Explorer to make sure I didn't screw up. But:
Note the file date - it says mid-March, and it has no version information (Extism.Sdk.dll does). Could it be that native is shipping the wrong binary?
from extism.
Looks like https://github.com/extism/extism/blob/main/.github/workflows/release-dotnet-native.yaml is downloading "some" artifact - and that might not be 0.5.0 (yes, please, there should be a version information in the .dll, not only the NuGet package)
from extism.
from extism.
https://www.nuget.org/packages/Extism.runtime.win-x64#versions-body-tab both the SDK and the runtime were published to 0.5.0
from extism.
both the SDK and the runtime were published to 0.5.0
I think the runtime publish was a mistake on my part. Fixing our docs. We will get a new runtime release out this week though. And I'm working on automating more of our release process so we can do it more often.
from extism.
@christophwille we pushed changes to the runtime and hosts. I think the upgrading the runtime (version 0.6.0 of this one https://www.nuget.org/packages/Extism.runtime.win-x64) should fix the problem. If not feel free to re-open or let us know
from extism.
Related Issues (20)
- feat: Add ability to dump memory to a file when an error occurs
- Rust SDK Example has an Error HOT 1
- Static linking extism with c and c++ sdks HOT 1
- Plugin Errors Propagating as segfault HOT 2
- Regression: Can't cancel multiple calls for the same plugin instance HOT 1
- Implement Java PDK HOT 1
- The runtime only returns a generic error when calling `extism_plugin_error` HOT 1
- Improve MSVC support HOT 5
- via proto conversation: refine extism error message when plugin calls fail
- via proto conversation: add example of using extism+tracing to rust runtime HOT 1
- Build linux libextism on manylinux/musllinux containers HOT 8
- Add extism_load_v128/extism_store_v128
- Double mutable borrow issue for `host_fn` with Rust SDK HOT 4
- Error when passing an empty String from Plugin to Runtime via a host function or a logging macro HOT 3
- Add building and installing cmake config mode package
- [Question] How to reload plugin with new wasm file? HOT 6
- extism_length returns garbage values when an ExtismPointer is not aligned with an alloc HOT 1
- feature: Give users a way to manage timeouts from inside host functions HOT 3
- [Question] nodejs call rust wasm function failed. HOT 2
- [Question] C plugin example build failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from extism.