Streamline convert-from-nuget to fit common defaults
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 2.1k
- Forks
- 528
- Avg merge
- 1d 12m
- Merged PRs (30d)
- 54
Description
Description
Not a bug, but a feature improvement. convert-from-nuget is a very useful command, but its utility is limited in the net core world because it takes a long time to convert on a brand new project. Consider the following scenario:
- You create a brand new F# console app using
dotnet new console -lang F#. This creates a nugetified F# project with no dependencies. - Run
convert-from-nuget. This creates apaket.dependenciesfile and immediately runs anpaket install:
source https://www.nuget.org/api/v2/
nuget FSharp.Core
- It takes 72 seconds to parse the graph for this.
- It supports all frameworks, even though realistically I only want netstandard and netcore.
- It downloads all packages into the local folder, using disk space and taking time, even though I have them all in the
.nugetfolder.
- I now update the dependencies file to reflect these changes and run
paket installto process the changes:
source https://www.nuget.org/api/v2/
framework: netstandard2.0, netcoreapp2.2
storage: none
nuget FSharp.Core
- This updates the lock file and GCs all the packages.
- This takes another 11 seconds (plus the time taken to update the dependencies file).
- You're now in a position to actually add your own dependencies. Let's say Saturn - we modify the dependencies file to add Saturn as well.
- This takes another 77 seconds to parse the new graph.
Expected behavior
To get to point 4 above takes around 3-4 minutes and involves manually modifying the dependencies file as well as a full dependency pull. I would suggest a target of < 5 seconds for this entire process.
How?
Here are a few ideas for how we could improve this.
- Switch the default dependencies file to include
storage: noneby default.generate-load-scriptsworks in 99% of cases in my experience and is perfectly usable with this option. - Generate specific TFMs, at least in the case of:
- There is a single project in the repo / folder.
- There is a single TFM specified in the project.
- The TFM specified is a netcore one.
In this case, generate a framework: tag of netstandard and netcore.
3. Consider not adding FSharp.Core by default. This will at least mean that the migration completes much more quickly. Besides, many packages use FSharp.Core anyway so it's likely that the first F# library that you use will get it anyway.
4. Consider not running paket install automatically (although I suspect this would create other usability issues)
5. Alternatively, we can consider hosting a centralised cache of "known good" lock files for very common dependency graphs. This may be just for single packages like FSharp.Core on common TFMs. Perhaps this could in time be used across more complex graphs, since instead of calculating the FSharp.Core graph manually we could pull from the cache and then merge in memory (sounds good in theory, I have no clue if that would be feasible).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the convert-from-nuget command and inspect how it generates paket.dependencies and invokes paket install. Define a single agreed default behavior from the listed proposals, then validate the generated framework and storage settings and the end-to-end conversion against the stated scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100