ionide / ionide/FsAutoComplete

Detect environment for snap installs

Open
#654 11 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
F#
Stars
486
Forks
169
Avg merge
2d 8h
Merged PRs (30d)
5

Description

_(from a conversation in the F# Slack "general" channel September 20th)_

The current VS Code / Ionide combination is not detecting the .NET Core environment if that environment comes from a Linux snap package. As [snaps are the preferred method of acquiring the environment](https://github.com/dotnet/core/blob/master/release-notes/5.0/preview/5.0.0-rc.1-install-instructions.md#install-using-snap) (per Microsoft), these projects should be able to detect and run regardless of where the framework is installed.

_(The below is my extraction from snap implementation on Ubuntu (20.04); as Canonical is the company behind both snaps and Ubuntu, this could easily be considered the reference implementation.)_

When snap support is installed, `/snap/bin` is added to the path (after `/usr/bin`, so "normal" packages win if there's a conflict). The snap package install creates an executable `dotnet-sdk.dotnet`; on initial install of the package, the command `dotnet` does nothing. There's a recommended post-install step `sudo snap alias dotnet-sdk.dotnet dotnet`, which creates a `dotnet` executable in `/snap/bin`. When I do `which dotnet`, the result is `/snap/bin/dotnet`; `which dotnet-sdk.dotnet` returns `/snap/bin/dotnet-sdk.dotnet`. For completeness, detection of `dotnet` may want to also check for this permutation.

Within `/snap/dotnet-sdk/current` (which is a symlink to the currently-effective snap), here is the directory tree: _(under `sdk`, only top-level directories are listed)_

```
├── etc
│   ├── gss
│   │   └── mech.d
│   └── ldap
├── host
│   └── fxr
│   └── 5.0.0-rc.1.20451.14
├── lib
│   └── x86_64-linux-gnu
├── meta
├── packs
│   ├── Microsoft.AspNetCore.App.Ref
│   │   └── 5.0.0-rc.1.20451.17
│   │   ├── data
│   │   └── ref
│   │   └── net5.0
│   ├── Microsoft.NETCore.App.Host.linux-x64
│   │   └── 5.0.0-rc.1.20451.14
│   │   └── runtimes
│   │   └── linux-x64
│   │   └── native
│   ├── Microsoft.NETCore.App.Ref
│   │   └── 5.0.0-rc.1.20451.14
│   │   ├── data
│   │   └── ref
│   │   └── net5.0
│   └── NETStandard.Library.Ref
│   └── 2.1.0
│   ├── data
│   └── ref
│   └── netstandard2.1
├── sdk
│   └── 5.0.100-rc.1.20452.10
│   ├── AppHostTemplate
│   ├── cs
│   ├── Current
│   ├── de
│   ├── DotnetTools
│   ├── en
│   ├── es
│   ├── Extensions
│   ├── fr
│   ├── FSharp
│   ├── it
│   ├── ja
│   ├── ko
│   ├── Microsoft
│   ├── pl
│   ├── pt-BR
│   ├── ref
│   ├── Roslyn
│   ├── ru
│   ├── runtimes
│   ├── SdkResolvers
│   ├── Sdks
│   ├── TestHost
│   ├── tr
│   ├── zh-Hans
│   └── zh-Hant
├── shared
│   ├── Microsoft.AspNetCore.App
│   │   └── 5.0.0-rc.1.20451.17
│   └── Microsoft.NETCore.App
│   └── 5.0.0-rc.1.20451.14
├── snap
│   └── command-chain
├── templates
│   └── 5.0.0-rc.1.20452.10
├── testing
└── usr
├── lib
│   ├── gcc
│   │   └── x86_64-linux-gnu
│   │   └── 8
│   ├── sasl2
│   └── x86_64-linux-gnu
│   ├── krb5
│   │   └── plugins
│   │   └── libkrb5
│   ├── openssl-1.0.0
│   │   └── engines
│   └── sasl2
└── share
├── doc
│   ... all the docs ...
├── gcc-8
│   └── python
│   └── libstdcxx
│   └── v6
├── gdb
│   └── auto-load
│   └── usr
│   └── lib
│   └── x86_64-linux-gnu
├── lintian
│   └── overrides
└── man
└── man5
```
I'd be happy to provide any more information as required - just let me know.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.