Skip to content
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

Is there a way to package a binary as a global tool #9503

Open
sanisoclem opened this issue Jun 14, 2018 · 5 comments
Open

Is there a way to package a binary as a global tool #9503

sanisoclem opened this issue Jun 14, 2018 · 5 comments
Labels
Milestone

Comments

@sanisoclem
Copy link

Steps to reproduce

I have native binaries (one for each platform) that I want to package as global CLI tools to make it available in my dotnet projects. I would prefer to not rewrite it in C#. I know that there are non .net projects in nuget like https://github.com/edenhill/librdkafka but can't find any info/example of a native dotnet tool.
Is this possible?

I also raised this question in SO

Expected behavior

Packaging a set of native binaries with metadata (entry point, supported platforms) in a .nupkg will be installable with dotnet tool install -g. It would choose the appropriate binaries based on the platform and ~/.dotnet/tools.

Actual behavior

Can't find a way to do this in the documentation.

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   2.1.300
 Commit:    adab45bf0c

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.3.9600
 OS Platform: Windows
 RID:         win81-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.300\

Host (useful for support):
  Version: 2.1.0
  Commit:  caa7b7e2ba

.NET Core SDKs installed:
  1.0.0-preview4-004233 [C:\Program Files\dotnet\sdk]
  1.0.4 [C:\Program Files\dotnet\sdk]
  2.0.3 [C:\Program Files\dotnet\sdk]
  2.1.2 [C:\Program Files\dotnet\sdk]
  2.1.201 [C:\Program Files\dotnet\sdk]
  2.1.300 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
@livarcocc
Copy link
Contributor

This is not currently supported. It is in our backlog but we don't really have a milestone planned to implement the feature at the moment.

@livarcocc
Copy link
Contributor

@wli3 @peterhuene do we already have a bug for this that we can point to or should we use this one?

@wli3
Copy link

wli3 commented Jun 14, 2018

I don't think we have one. Let's use this one.

On another thread. I find a lot of the questions can be answered by my internal document. I wonder if we can organize it and make it available.

@sanisoclem thank you for your question

Under the tools folder is a folder called dotnetcoreapp2.1. Can I keep the folder name even if my app is not dotnet core?

This is TFM your tool is targeting. So under our current model, IF binary is supported, it should be any.

What does the dotnetcoreapp2.1/any folder mean?

It is TFM/RID. Currently only any (has to be OS agnostic) is supported, so this field need to be any.

In DotnetToolSettings.xml, what are the valid values for the Runner attribute? All the examples I saw has a "dotnet" runner

Only dotnet is valid runner today. We do plan to expend it. So the field is left for future.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the Backlog milestone Jan 31, 2020
@zkat
Copy link

zkat commented Aug 11, 2021

what would it take to make this possible?

@wli3
Copy link

wli3 commented Aug 19, 2021

it would be more of a product discussion. Tool's benefit today is the producer would only need to consider their .NET project since we can make the assumption of .NET SDK and runtime being available on the both side(transfer IL). However, there are many solutions today available to distribute binary like Windows store and homebrew. And also because of the inherent complexity of delivery machine specific binary, I don't think .NET SDK will bring much to the table.

carstencodes added a commit to carstencodes/protolint that referenced this issue Apr 9, 2024
Currently, .NET cannot handle native packages.
So, this is WiP and still draft.
Fore details refer to dotnet/sdk#9503

First contribution for yoheimuta#337
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants