Skip to content

Find a way to let the tool work without a global tool installation #17

@Arshia001

Description

@Arshia001

I'd rather not have the users of this library need to install a global tool. For one thing, it's impossible to make a consistent version of the tool available on the machines of all developers of a project. Then there's the fact that global tool installation complicates project setup and Dockerfiles.

The global tool is needed because a locally installed tool cannot be run as a stand-alone executable, instead needing to be called via the dotnet command line, e.g. dotnet protoc-gen-fsharp instead of protoc-gen-fsharp.

One way to work around this limitation would be to include the plugin with the Tools package. We're already checking the user's OS and calling the correct version of protoc; if we had access to the plugin's executables for each platform, we could pass it in to the compiler with --plugin=protoc-gen-fsharp=....

To do this, we need to compile and publish the plugin for each of the 3 main OS's, and include the published binaries in the final Tools package. However, this is further complicated by the fact that we don't know the user's runtime environment in advance, so we can't decide on one framework to publish for, so we'd have to bundle for multiple runtimes on multiple OS's, which will grow the Tools package's size even further.

We could also forgo the platform-specific binaries, and go with shell scripts instead:

#! /usr/bin/env bash

dotnet_version=$(dotnet --version | extract-version-in-some-way)
dotnet ../$dotnet_version/FSharp.GrpcCodeGenerator.dll

However, this creates an additional dependency on the existence of specific shells on the user's system, which is undesirable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions