dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.59k stars 1.03k forks source link

Support AOT tools in .NET tools #40931

Open baronfel opened 1 month ago

baronfel commented 1 month ago

Tools of all kinds benefit from fast execution speeds, so compiling them for AOT makes sense. .NET Tools are a very easy way to distribute tools, so it would seem natural that tools be able to be AOT compiled. There are a few hurdles that would need to be cleared first, though:

Another, potentially more crazy idea might be to on-demand AOT a tool for the current platform on tool install. This could require data that we don't already have packaged in the tool, and might require dependencies like a C/C++ compiler that aren't part of our already-expressed dependency tree for the SDK.

knocte commented 1 month ago

potentially more crazy idea might be to on-demand AOT a tool for the current platform on tool install.

IMO it's not that crazy. It would save lots of disk space on the nuget side of things (not to mention simplifying the solution for this github issue), and if you think about it, a user that installs a dotnet tool is in most cases a dev, so it's not too insane to require him to have some compiler tools to be able to have his tool optimized for speed.

(Just my 2 cents)

KalleOlaviNiemitalo commented 1 month ago

If a user installs a global tool by using an x86 .NET SDK on an x64 operating system, then would dotnet tool install AOT-compile that tool for x86, for x64, or both?