microsoft / ClearScript

A library for adding scripting to .NET applications. Supports V8 (Windows, Linux, macOS) and JScript/VBScript (Windows).
https://microsoft.github.io/ClearScript/
MIT License
1.74k stars 148 forks source link

Single cross-platform package? #515

Closed jcoc611-microsoft closed 1 year ago

jcoc611-microsoft commented 1 year ago

Is there a single ClearScript V8 package we could include that automatically works on all supported platforms?

Our package reference looks like this:

<PackageReference Include="Microsoft.ClearScript;Microsoft.ClearScript.osx-x64;Microsoft.ClearScript.osx-arm64;Microsoft.ClearScript.linux-x64" />

We sometimes get customers using new platforms and have to spend a lot of time debugging why the program isn't working on their end. It would be helpful if we could reduce this down to a single cross-platform package.

ClearScriptLib commented 1 year ago

Hello @jcoc611-microsoft,

Can you say more about your customer scenario? For example, is ClearScript a dependency of a NuGet package that your team provides?

Thanks!

jcoc611-microsoft commented 1 year ago

In our setup, ClearScript is a dependency of a C# project included in a end-user desktop application

ClearScriptLib commented 1 year ago

ClearScript is a dependency of a C# project included in a end-user desktop application.

Sorry, we aren't clear on the problem. Is it not possible for your application to depend on multiple packages?

jcoc611-microsoft commented 1 year ago

It is possible, we are just wondering if there could be a Microsoft.ClearScript.All package that imports all available platforms rather than having to list them out explicitly on our end

ClearScriptLib commented 1 year ago

we are just wondering if there could be a Microsoft.ClearScript.All package that imports all available platforms

That should certainly be possible. Out of curiosity, how is your application packaged and distributed? Bundling all the native V8 assemblies could impact your package size significantly.

jcoc611-microsoft commented 1 year ago

Something like this

dotnet build --no-self-contained --runtime $(BuildRuntime)

Would passing an explicit runtime prune the packages auto-magically?

ClearScriptLib commented 1 year ago

Would passing an explicit runtime prune the packages auto-magically?

A dotnet build probably fetches all the dependencies. However, once your project is built, something like dotnet publish only bundles cross-platform files and those that apply to the specified target platform(s).

In any case, we'll take a closer look at this for a future release.

Thank you!

ClearScriptLib commented 1 year ago

The ClearScript.Complete NuGet package is now available.