rules_dotnet icon indicating copy to clipboard operation
rules_dotnet copied to clipboard

Support for "host" toolchain

Open oakad opened this issue 3 years ago • 4 comments

Bazel rules for go support using a "host" toolchain, that is, whatever toolchain is invoked by "go" command found in system path.

Is it possible for rules dotnet support the same functionality, that is run whatever toolchain is invoked by "dotnet" commadn found in system path?

oakad avatar May 09 '21 08:05 oakad

It is not possible.

tomaszstrejczek avatar May 09 '21 09:05 tomaszstrejczek

Most languages are roughly the same when compilation is concerned.

For example, this clearly works:

  1. dotnet --info to get the active framework path
  2. dotnet <framework path>/Roslyn/bincore/csc.dll to invoke the compiler

oakad avatar May 09 '21 10:05 oakad

To elaborate a bit more: when building in all sorts of constrained environments, simply assuming something can be downloaded as needed is not an option.

On the other hand:

  1. The sdk download results in a tree layout rather identical to what is installed out of the box by OS supplied dotnet core package
  2. Bazel is capable of attaching the workspace and build files to any sort of "local repository" out of that repo tree

This sort of makes using the host dotnet core install look like a non-insurmountable task.

Moreover, MS dotnet core team is pretty responsive and we can actually ask them to change things here and there. :-)

oakad avatar May 09 '21 10:05 oakad

I think adding support for this in the next branch should be a small task. Keeping this open for tracking this.

purkhusid avatar Aug 05 '22 11:08 purkhusid

Doing some issue cleanup. Closing this since I don't plan on adding this but would be open to an contribution. If you still need this then feel free to reopen.

purkhusid avatar Apr 03 '24 15:04 purkhusid