fsprojects / fsprojects/Paket

Using paket from fsharp interactive doesn't work when running it as a fsx script in `dotnet fsi`

Open
#3,777 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

This is more of a question since I suspect I'm doing something wrong here.

Description

Using paket from fsharp interactive (https://fsprojects.github.io/Paket/reference-from-repl.html) doesn't work when running it as a fsx script in dotnet fsi

Repro steps

Paste first and second snippet plus first line in third snippet in https://fsprojects.github.io/Paket/reference-from-repl.html into a fsx file (base.fsx)

open System
open System.IO

Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

if not (File.Exists "paket.exe") then
    let url = "http://fsprojects.github.io/Paket/stable"
    use wc = new Net.WebClient()
    let tmp = Path.GetTempFileName()
    let stable = wc.DownloadString(url)
    wc.DownloadFile(stable, tmp)
    File.Move(tmp,Path.GetFileName stable)

#r "paket.exe"
open Paket

// Locate the paket.dependencies file.
let dependencies = Dependencies.Locate(__SOURCE_DIRECTORY__)
// Install a package.
dependencies.Add "FSharp.Data"
Expected behavior

It should work

Actual behavior
error FS0192: internal error: convMethodRef: could not bind to method '"Add"' of type 'Paket.Dependencies, paket, Version=5.241.6.0, Culture=neutral, PublicKeyToken=null'
Known workarounds

None at the moment

Environment ´dotnet --info´:
.NET Core SDK (reflecting any global.json):
 Version:   3.1.100
 Commit:    cd82f021f4

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.100\

Host (useful for support):
  Version: 3.1.0
  Commit:  65f04fb6db

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the snippets from the Paket reference-from-REPL page in base.fsx with dotnet fsi, using the reported .NET SDK environment. Compare the failure at dependencies.Add with the documented workflow; done means the script runs without the FS0192 error and adds FSharp.Data as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.