fsharp / fsharp.org

The F# Software Foundation website
https://fsharp.org
291 stars 276 forks source link

Use F# on Linux instructions did not work #899

Closed ScottHutchinson closed 1 year ago

ScottHutchinson commented 2 years ago

https://github.com/fsharp/fsfoundation/blob/gh-pages/use/linux/index.md#option-1-install-the-cli-tools-and-use-your-own-editor

Following these instructions in WSL2 resulted in:

scott@xx:/mnt/c/Users/hutchinsons$ dotnet --info
dotnet: command not found
scott@xx:/mnt/c/Users/hutchinsons$ whereis dotnet
dotnet: /mnt/c/Program Files/dotnet/dotnet.exe /mnt/c/Program Files (x86)/dotnet/dotnet.exe
scott@xx:/mnt/c/Users/hutchinsons$ /mnt/c/Program Files/dotnet/dotnet --info
-bash: /mnt/c/Program: No such file or directory
scott@xx:/mnt/c/Users/hutchinsons$

@cartermp

cartermp commented 2 years ago

Which instructions?

ScottHutchinson commented 2 years ago

The ones the link points to.

ScottHutchinson commented 2 years ago

curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current

cartermp commented 2 years ago

This is what I use (well, contributed) to gitpod to install and provision docker images with the right .NET installed. Works in those environments, which are proper linux and not WSL. So I'm not sure what else to do here.

The alternative is to follow the existing link on those pages, which eventually brings you here: https://docs.microsoft.com/en-us/dotnet/core/install/linux

As you can see, there's no real one-size-fits-all for linux installs unless you use the dotnet-install script.

cartermp commented 2 years ago

Ah, actually, I wonder if DOTNET_ROOT needs to get set? IIRC the default path is $HOME/.dotnet and so DOTNET_ROOT=/$HOME/.dotnet might be needed?

ScottHutchinson commented 2 years ago

The script seems to have created the .dotnet folder in the working directory instead of the user's home directory on Linux. The working directory was my user folder in Windows (/mnt/c/Users/hutchinsons). I'm not sure whether that .dotnet folder was already there and whether I need it on Windows; otherwise I would delete it and try again with my Linux home directory as the working directory.

ShalokShalom commented 1 year ago

Can this be reproduced/closed?

ScottHutchinson commented 1 year ago

I will look into this tomorrow.

ScottHutchinson commented 1 year ago

It looks like the script has changed, so I'm closing this issue.

baronfel commented 1 year ago

Worth noting these days that many repos have first class packages for the .Net SDK. e.g. for Ubuntu it's just 'apt install dotnet-sdk-7.0'. these instructions should probably take that into account.