Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paket framework restriction differences

Tags:

f#

paket

I have added Argu to my project and about 700MB of packages were downloaded together with it. This is related to Paket installs extra packages however I would like to undestand the subtle differences in specifiying the framework restrictions with >= or just framework: net46.

On my first try I just added Argu to the paket.dependencies file:

nuget Argu

As this resulted in a download of almost a GB of packages, I asked:

.\.paket\paket.exe why nuget System.Threading.Thread

And paket replied:

Paket version 3.27.02  
NuGet System.Threading.Thread is a transitive dependency.  
It's a part of following dependency chains:  

-> Argu
  -> FSharp.Core
    -> System.Threading.Thread

-> MathNet.Numerics.FSharp
  -> FSharp.Core
    -> System.Threading.Thread

0 seconds - ready.  

Then I added the following restriction to paket.dependencies:

nuget Argu framework: >= net46

However this resulted in downloading the same packages.

Finally I did:

nuget Argu framework: net46

And this specific restriction did indeed remove all the unneccassary packages:

Garbage collecting Microsoft.NETCore.Platforms
Garbage collecting Microsoft.Win32.Primitives
Garbage collecting NETStandard.Library
Garbage collecting System.AppContext
Garbage collecting System.Collections.Concurrent
...

However all my other dependencies are specified like this (mostly as a result, but not always, as I was troubleshooting the original issue):

source https://www.nuget.org/api/v2
nuget FAKE framework: >= net46
nuget FileHelpers framework: >= net46
nuget FSharp.Collections.ParallelSeq 1.0.2 framework: >= net46
nuget Fsharp.Data framework: >= net46 
nuget MathNet.Numerics.FSharp 3.14.0-beta01 beta framework: >= net46
nuget MathNet.Numerics.MKL.Win-x64 2.2.0 framework: >= net46
nuget NuGet.CommandLine framework: >= net46 
nuget Streams 0.4.1 framework: >= net46
nuget System.Linq.Dynamic 1.0.7 framework: >= net46
nuget Fsharp.Configuration framework: >= net46

So my question is Argu special in some way, or should I always use framework restrictions and specifically target 46 (or 45) instead of >=.

like image 871
s952163 Avatar asked Nov 08 '22 04:11

s952163


1 Answers

This does not occur with later versions of paket. However it is still possible to nuget packages that will result in the download of extra transitive dependencies due to the way some packages declare a dependency only on netstandard and not the full framework. For details see: https://github.com/fsprojects/Paket/issues/2564.

like image 72
s952163 Avatar answered Jan 01 '23 20:01

s952163