fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 520 forks source link

Paket is not telling the truth: "The package can't be found" in local nuget source #3130

Open matthid opened 6 years ago

matthid commented 6 years ago

Description

I think we have a parsing bug when using a local nuget source and some long package names (or maybe we cannot parse this particular package name). Paket tells me:

  Trying to resolve runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple >= 4.3 (from runtime.native.System.Security.Cryptography.Apple 4.3.0)
 - runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0
Source 'C:\\temp\\offline_nuget' yielded (0): []
 - Request 'C:\temp\offline_nuget' finished with: []
Source 'C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1' yielded (0): [4.0.1 ; 4.3.0]
 - Request 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder' finished with: [4.0.1 ; 4.3.0]

Source 'C:\\temp\\offline_nuget' yielded (0): []
 - Request 'C:\temp\offline_nuget' finished with: []
Source 'C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1' yielded (0): [4.1.0 ; 4.3.0]
 - Request 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder' finished with: [4.1.0 ; 4.3.0]

Source 'C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1' exception: System.Exception: The package runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 can't be found in C:\Program Files\dotnet\sdk\NuGetFallbackFolder.
Please check the feed definition in your paket.dependencies file.
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Paket.NuGetLocal.getDetailsFromLocalNuGetPackage@86.Invoke(Unit unitVar)
   at Microsoft.FSharp.Control.AsyncBuilderImpl.callA@839.Invoke(AsyncParams`1 args)
GetPackageDetails failed: System.Exception: Couldn't get package details for package runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 on C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1. ---> System.Exception: The package runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 can't be found in C:\Program Files\dotnet\sdk\NuGetFallbackFolder.
Please check the feed definition in your paket.dependencies file.
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Paket.NuGetLocal.getDetailsFromLocalNuGetPackage@86.Invoke(Unit unitVar)
   at Microsoft.FSharp.Control.AsyncBuilderImpl.callA@839.Invoke(AsyncParams`1 args)
   --- End of inner exception stack trace ---
   at Paket.Utils.rethrowf@26.Invoke(String msg)
   at Paket.NuGet.getPackageDetails@337-20.Invoke(Unit unitVar)
   at Microsoft.FSharp.Control.AsyncBuilderImpl.callA@839.Invoke(AsyncParams`1 args)
Source 'C:\\temp\\offline_nuget' yielded (0): []
 - Request 'C:\temp\offline_nuget' finished with: []
Source 'C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1' yielded (0): [4.0.0 ; 4.3.0 ; 4.4.0]
 - Request 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder' finished with: [4.0.0 ; 4.3.0 ; 4.4.0]

Source 'C:\\temp\\offline_nuget' yielded (0): []
 - Request 'C:\temp\offline_nuget' finished with: []
Source 'C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1' yielded (0): [1.2.0 ; 1.3.0 ; 1.3.1 ; 1.4.0]
 - Request 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder' finished with: [1.2.0 ; 1.3.0 ; 1.3.1 ; 1.4.0]

Source 'C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1' exception: System.Exception: The package runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 can't be found in C:\Program Files\dotnet\sdk\NuGetFallbackFolder.
Please check the feed definition in your paket.dependencies file.
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Paket.NuGetLocal.getDetailsFromLocalNuGetPackage@86.Invoke(Unit unitVar)
   at Microsoft.FSharp.Control.AsyncBuilderImpl.callA@839.Invoke(AsyncParams`1 args)
    Package not available.
      Message: Unable to retrieve package details for 'runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple'-4.3.0
  Conflict detected:
   - runtime.native.System.Security.Cryptography.Apple 4.3.0 requested package runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple: >= 4.3
   - Available versions:
     - (4.3.0, [C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1])

But my local nuget source looks like this: image

Therefore paket is straight up lying to me and doesn't tell me the root cause.

Repro steps

Probably (not tested)

source C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1
nuget runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple

paket install

Expected behavior

Do not print the above error (captured with -v)

Actual behavior

The message is wrong (but paket recovers itself for some reason):

   Retrieved Explored Package  runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
Resolution finished, but some errors were encountered:
-> One or more errors occurred. (Unable to retrieve package details for 'runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple'-4.3.0)
-> Unable to retrieve package details for 'runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple'-4.3.0
   StackTrace:
        at Paket.PackageResolver.getPackageDetailsBlock@1034.Invoke(GetPackageDetailsParameters details)
        at Paket.PackageResolver.explorePackageConfig(FSharpFunc`2 getPackageDetailsBlock, PackageConfig pkgConfig)
-> Couldn't get package details for package runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 on C:\\PROGRA~1\\dotnet\\sdk\\NUGETF~1.
-> The package runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 can't be found in C:\Program Files\dotnet\sdk\NuGetFallbackFolder.
   Please check the feed definition in your paket.dependencies file.

Why is paket even trying to resolve that package when it doesn't actually need it?

Known workarounds

Please provide a description of any known workarounds.

forki commented 6 years ago

are you going to fix it?