fsprojects / fsprojects/Paket

Transitive dependencies from generate-include-scripts fail to load in Fsi

Open
#1,975 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

In Linux (using Mono 4.6.1.5) the resolution behavior doesn't take into account transitive assemblies of any include script generated by Paket in your main script. Transitive dependencies from I can see are affected by the issue and FSI fails to evaluate/load the transitive assembly.

Repro steps

Please provide the steps required to reproduce the problem

  1. paket generate-include-scripts to generate the F# scripts.
  2. Reference the appropriate include script.
  3. Try using a type from an generated include script that has transitive dependencies on another Nuget package. (e.g a type inported from something like #load "include.main.fsx").
Expected behavior

F# script to just work with the correct dependencies.

Actual behavior

/path/to/current/dir/stdin(0,1): error FS0078: Unable to find the file 'TransitiveDep.dll' in any of
/usr/lib/mono/4.5

Known workarounds

For every assembly load (#r) generated by Paket do it instead via two steps (e.g if assembly is ./paket-files/net46/Newtonsoft.Json.dll):

  • Using the #I to register the directory ( #I /paket-files/net46/)
  • Loading the #r with or without the directory. (#r Newtonsoft.Json.dll)

If all assembly loads on all generated scripts are done this way it all works as expected.

Believe this is related to: https://github.com/fsharp/fsharp/issues/251.

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 failure with paket generate-include-scripts on Linux under Mono 4.6.1.5, then reference a generated include script with a transitive dependency. Compare the generated #r loads with the documented #I workaround; done means Fsi loads the transitive assembly and evaluates the script without FS0078.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.