Skip to content

DependencyProvider: Add a stable path which is tooling independent  #8880

@smoothdeveloper

Description

@smoothdeveloper

@smoothdeveloper The spec for dependency manager resolution seems not to be implemented - it references things like "fsx-extensions" but that string doesn't occur anywhere in the F# codebase.

So it's kind of hard to discern how things are intended to work, or how things are actually resolved today, or how things could be adjusted.

I'd say the first thing is to update the spec to clarify what is there today. I'll adjust this issue to track that, also close #12895 as a duplicate since everything else depends on that.


Problem

The dependency provider feature has extensibility points to allow third party providers to hook into the resolution.

The current search paths are tooling dependent (VS has its own, Ionide its own, Rider its own, dotnet fsi its own, etc.) as they are based on location of compiler assemblies used by the tooling.

This makes impossible a one step system wide or user account wide installation, working across all the toolchains. It will hurt adoption of third party providers and yield fair amount of support requests.

Location of the search paths AFAIK:

let assemblySearchPaths = lazy (
[
let assemblyLocation = typeof<IDependencyManagerProvider>.GetTypeInfo().Assembly.Location
yield Path.GetDirectoryName assemblyLocation
yield AppDomain.CurrentDomain.BaseDirectory
])

Describe the solution you'd like

A stable search path under user account may be added to the list. Maybe a system wide can be added as well.

Another aproach would be for referenced assemblies to be probed as well, it would enable using existing #r syntax to load the extension from a known path or an already installed handler. Albeit this has an extra runtime cost, maybe a baked-in extension should have this role:

#r @"load-extension: path/to/extension.dll"

Although those incur extra code in the scripts.

Describe alternatives you've considered

Looking for some, please share your insight, provide feedback on this feature request.

Additional context

The RFC had hints on such location: https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1027-fsi-references.md#handler-resolution

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions