GithubHelp home page GithubHelp logo

Comments (20)

zshipko avatar zshipko commented on May 9, 2024

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.

christophwille avatar christophwille commented on May 9, 2024

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.

bhelx avatar bhelx commented on May 9, 2024

@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.

bhelx avatar bhelx commented on May 9, 2024

You could also, maybe, try downgrading to 0.3.0

from extism.

bhelx avatar bhelx commented on May 9, 2024

@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.

christophwille avatar christophwille commented on May 9, 2024

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.

christophwille avatar christophwille commented on May 9, 2024

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.

bhelx avatar bhelx commented on May 9, 2024

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.

mhmd-azeez avatar mhmd-azeez commented on May 9, 2024

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.

mhmd-azeez avatar mhmd-azeez commented on May 9, 2024

@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.

christophwille avatar christophwille commented on May 9, 2024

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.

mhmd-azeez avatar mhmd-azeez commented on May 9, 2024

@christophwille

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.

mhmd-azeez avatar mhmd-azeez commented on May 9, 2024

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.

christophwille avatar christophwille commented on May 9, 2024

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.

christophwille avatar christophwille commented on May 9, 2024

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:
image
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.

christophwille avatar christophwille commented on May 9, 2024

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.

bhelx avatar bhelx commented on May 9, 2024

from extism.

christophwille avatar christophwille commented on May 9, 2024

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.

bhelx avatar bhelx commented on May 9, 2024

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.

bhelx avatar bhelx commented on May 9, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.