megabyte-labs / install.doctor

A glorious combination of application / theme settings and a performant cross-platform, desktop-oriented software suite.
https://megabyte.space
Other
99 stars 22 forks source link

`dotnet` CLI not working #67

Open ProfessorManhattan opened 1 year ago

ProfessorManhattan commented 1 year ago

❔ What are you experiencing an issue with?

Latest Release

❔ Version

N/A

🐞 Description

The dotnet CLI gets installed and then a few plugins are installed which are listed at the bottom of the software.yml file. The plugins appears to install but once they are installed and you try to invoke them, they all report an error that looks like this:

❯ git-credential-manager configure
You must install or update .NET to run this application.

App: /Users/bzalewski/.config/dotnet/.dotnet/tools/git-credential-manager
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '7.0.8' (x64)
.NET location: /usr/local/Cellar/dotnet/7.0.100/libexec

The following frameworks were found:
  7.0.0 at [/usr/local/Cellar/dotnet/7.0.100/libexec/shared/Microsoft.NETCore.App]

Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.8&arch=x64&rid=osx.13-x64

We need to figure out how to make the dotnet CLI install tools that can be invoked with the system's .NET version.

⏺️ Steps To Reproduce

No response

πŸ“’ Relevant Log Output

No response

πŸ’‘ Possible Solution

No response

enggnr commented 1 year ago

@ProfessorManhattan, git-credential-manager plugin requires .Net version 7.0.8, whereas the version installed by Homebrew is 7.0.1. The formula has not been updated for a few months now. The latest version available is 7.0.9. I believe that the plugin should work once the formula is updated to install the latest version. I tried the roll-forward options but that did not help (probably because the installed version is less than what is required). This plugin works on linux (installed dotnet using the official repo).

Installing the latest minus 1 version of this plugin did not work, as it requires .Net 6.0.16. Tried it just to see if that can be configured in the input.

The other 2 plugins work on MacOS as well as linux.

On a related note, do we want to review the exports related to dotnet? DOTNET_CLI_HOME is not found in the documentation but it is respected when I set it and installed a plugin. XDG_CONFIG_HOME was causing failures on MacOS (and will cause issues on linux as well if the variable is not set). The variable DOTNET_ROOT is needed.

### Dotnet
export DOTNET_CLI_HOME="$XDG_CONFIG_HOME/dotnet"
if [ -d /Applications ] && [ -d /Library ]; then
  export DOTNET_ROOT="/usr/local/opt/dotnet/libexec"
elif [ -d /home/linuxbrew/.linuxbrew/opt/dotnet ]; then
  export DOTNET_ROOT="/home/linuxbrew/.linuxbrew/opt/dotnet/libexec"
fi
export PATH="$PATH:$XDG_CONFIG_HOME/dotnet/.dotnet/tools"