question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Streamline convert-from-nuget to fit common defaults

See original GitHub issue

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:

  1. You create a brand new F# console app using dotnet new console -lang F#. This creates a nugetified F# project with no dependencies.
  2. Run convert-from-nuget. This creates a paket.dependencies file and immediately runs an paket 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 .nuget folder.
  1. I now update the dependencies file to reflect these changes and run paket install to 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).
  1. 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.

  1. Switch the default dependencies file to include storage: none by default. generate-load-scripts works in 99% of cases in my experience and is perfectly usable with this option.
  2. 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).

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Tarmilcommented, Jun 19, 2019

No, auto-detect actually parses *.fsproj to look for TFMs. It’s equivalent to listing the TFMs that your projects use.

0reactions
isaacabrahamcommented, Jun 19, 2019

@Tarmil however doing this would preclude the possiblity of easily pre-generating a lock file. Or at least, the cache would need to be injected quite deep into Paket I would imagine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coree.NuPack 0.1.30327.10743
With "Coree.Nupack", you can create customized NuGet packages quickly and easily, without having to manually adjust your project settings. Key Features<br> ...
Read more >
Common NuGet configurations
NuGet.Config files control NuGet's behavior, and can be modified with nuget config command.
Read more >
Consume NuGet packages | JetBrains Rider Documentation
By default, the Packages tab of the window shows all packages installed in the whole solution, but you can change the view to...
Read more >
NuGet packages in the Package Registry
Install a package with the NuGet CLI. By default, nuget checks the official source at nuget.org first. If you have ...
Read more >
Getting Started with Paket – Part 1 - The Cockney Coder
By default, NuGet will check out the lowest version of transitive dependencies (i.e. the “child” dependencies for the dependency that you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found