fsprojects / fsprojects/Paket

`paket convert-from-nuget` creates irrelevant package references

Open
#3,278 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

paket convert-from-nuget has no way to restrict the platforms to be used and thus considers all of them. That results in unnecessarily enormous lock files and project file entries even for small solutions and can cause unresolvable dependency conflicts on large ones. I had one case when converting a large solution where I had to cancel the resolution triggered by convert-from-nuget, add framework restrictions to the dependencies file, and then manually call paket install, because the resolution would never finish due to version conflicts.

Repro steps
  1. Create a new .NET 4.6.1 F# console application project/solution
  2. Add Paket, run paket convert-from-nuget
Expected behavior

Paket references only the required packages (FSharp.Core and System.ValueTuple).

Actual behavior

Paket creates a lock file of over 400 lines referencing things for every platform it knows about, and adds a lot of "clutter" to the project file.

Known workarounds

None before the fact. Adding framework restrictions and running paket install again retroactively solves the immediate problem, but as mentioned above, it can be necessary to cancel the initial convert-from-nuget run to even get there.


I'm not sure what a good solution would look like. There should probably be a way to make Paket add an appropriate framework: line to the generated dependencies file. I can think of two options here:

  • a parameter that allows specifying a list of frameworks, exactly as they will appear in the dependencies file.
  • a parameter that causes auto-detection of the frameworks to use from all the projects found

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 at the paket convert-from-nuget command entry point and reproduce the .NET 4.6.1 F# project scenario described here. Inspect how the command generates the dependencies file, lock file, and project references, then determine how framework restrictions should be carried into that output. Done means conversion avoids irrelevant platform references while retaining the required packages.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.