fsprojects / fsprojects/Paket

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

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

Nobody has claimed this yet.

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

Description

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.

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 with the reported repro in paket.dependencies and run paket install with -v, then trace Paket.NuGetLocal.getDetailsFromLocalNuGetPackage from the stack trace. Compare the local source contents and package-resolution messages for the long runtime package. Done means the resolver avoids the unnecessary lookup or reports the actual cause instead of claiming the package is absent.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.