Optimize package references of modules, uncluttering paket.lock. #2493
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Build script modules reference many packages (such as
System.Net.Http
) that do not target .NET Standard 2.0. When used by a .NET Standard library (such as our build script), these packages load their dependencies from a lower version of .NET Standard, which causes a truckload of other packages with primitive types (such asSystem.Runtime
, or much worse, native packages) to be loaded, producing apaket.lock
like this (the overwhelming majority of these 800ish lines start withSystem.
):Most of these "bad" packages have not been updated since 2016. Fortunately, .NET Standard 2.0 eliminated all this dependency clutter by automatically including these packages, so they were removed. 3rd-part packages that still reference these legacy libraries are
NuGet.Protocol
which was fixed by its latest version, MSBuild andFSharp.Compiler.Services
, for which I have opened PRs to fix their dependencies.A bad package I could not remove was
System.Runtime.Loader
(whose existence is a mistake: it allows .NET Framework code to access the .NET Core-onlyAssemblyLoadContext
) because it would require some architectural changes (such as moving the assembly cache over to the FAKE executable). But that's not important whatsoever, and can be eventually resolved by something like targeting .NET 5 everywhere in FAKE 6.