New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paket adds wrong dependencies when using NuGet v3 source #2652

Closed
csmager opened this Issue Aug 23, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@csmager
Contributor

csmager commented Aug 23, 2017

Description

Paket is installing a dependency for Portable+Win81+Wpa81 when the target framework is net45. This only seems to happen for the v3 NuGet feed.

The package is ReactiveUI, and you can see the nuspec here.

<group targetFramework="net45" >
    <dependency id="Rx-Main" version="2.2.5" />
    <dependency id="Splat" version="[1.4.0,2)" />
    <dependency id="Rx-Xaml" version="2.2.5" />
</group>
<group targetFramework="Portable-Win81+Wpa81" >
    <dependency id="Rx-Main" version="2.2.5" />
    <dependency id="Splat" version="[1.4.0,2)" />
    <dependency id="Rx-Xaml" version="2.2.5" />
    <dependency id="Rx-WinRT" version="2.2.5" />
</group>

When I install the package, I get this in my lock file:

RESTRICTION: == net452
NUGET
  remote: https://api.nuget.org/v3/index.json
    reactiveui (7.4)
      reactiveui-core (7.4)
    reactiveui-core (7.4)
      Rx-Main (>= 2.2.5)
      Rx-Main (>= 2.2.5)
      Rx-WinRT (>= 2.2.5)
      Rx-Xaml (>= 2.2.5)
      Splat (>= 1.4 < 2.0)
      Splat (>= 1.4 < 2.0)

And this in my project file:

<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
  <ItemGroup>
	<Reference Include="System.Reactive.WindowsRuntime">
	  <HintPath>packages\Rx-WinRT\lib\portable-win81+wpa81\System.Reactive.WindowsRuntime.dll</HintPath>
	  <Private>True</Private>
	  <Paket>True</Paket>
	</Reference>
  </ItemGroup>
</When>

Repro steps

Run paket install with a paket.dependencies file containing these lines:

framework: net452
source https://api.nuget.org/v3/index.json
nuget reactiveui

Known workarounds

Change the source to https://www.nuget.org/api/v2

@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid Aug 23, 2017

Member

cann you post the lockfile without framework restriction?
Does paket print any warnings?

It feels like paket fails to properly detect / parse the metadata.

Member

matthid commented Aug 23, 2017

cann you post the lockfile without framework restriction?
Does paket print any warnings?

It feels like paket fails to properly detect / parse the metadata.

@csmager

This comment has been minimized.

Show comment
Hide comment
@csmager

csmager Aug 23, 2017

Contributor

Sure. Lock file below.

NUGET
  remote: https://api.nuget.org/v3/index.json
    reactiveui (7.4)
      reactiveui-core (7.4)
    reactiveui-core (7.4)
      Rx-Core (>= 2.2.5) - restriction: == uap10.0
      Rx-Interfaces (>= 2.2.5) - restriction: == uap10.0
      Rx-Linq (>= 2.2.5) - restriction: == uap10.0
      Rx-Main (>= 2.2.5)
      Rx-Main (>= 2.2.5) - restriction: == net45
      Rx-Main (>= 2.2.5) - restriction: >= portable-win81+wpa81
      Rx-Main (>= 2.2.5) - restriction: == win8
      Rx-PlatformServices (>= 2.2.5) - restriction: == uap10.0
      Rx-WindowStoreApps (>= 2.2.5) - restriction: == uap10.0
      Rx-WinRT (>= 2.2.5) - restriction: >= portable-win81+wpa81
      Rx-WinRT (>= 2.2.5) - restriction: == uap10.0
      Rx-WinRT (>= 2.2.5) - restriction: == win8
      Rx-Xaml (>= 2.2.5) - restriction: == net45
      Rx-Xaml (>= 2.2.5) - restriction: >= portable-win81+wpa81
      Rx-Xaml (>= 2.2.5) - restriction: == win8
      Splat (>= 1.6.2) - restriction: == uap10.0
      Splat (>= 1.4 < 2.0)
      Splat (>= 1.4 < 2.0) - restriction: == net45
      Splat (>= 1.4 < 2.0) - restriction: >= portable-win81+wpa81
      Splat (>= 1.4 < 2.0) - restriction: == win8
      System.Collections (>= 4.0.10) - restriction: == uap10.0
      System.Diagnostics.Debug (>= 4.0.10) - restriction: == uap10.0
      System.Diagnostics.Tools (>= 4.0) - restriction: == uap10.0
      System.IO (>= 4.0.10) - restriction: == uap10.0
      System.Linq (>= 4.0) - restriction: == uap10.0
      System.Linq.Expressions (>= 4.0.10) - restriction: == uap10.0
      System.ObjectModel (>= 4.0.10) - restriction: == uap10.0
      System.Reflection (>= 4.0.10) - restriction: == uap10.0
      System.Reflection.Extensions (>= 4.0) - restriction: == uap10.0
      System.Runtime (>= 4.0.20) - restriction: == uap10.0
      System.Runtime.Extensions (>= 4.0.10) - restriction: == uap10.0
      System.Runtime.InteropServices.WindowsRuntime (>= 4.0) - restriction: == uap10.0
      System.Runtime.Serialization.Primitives (>= 4.1) - restriction: == uap10.0
      System.Runtime.Serialization.Xml (>= 4.1) - restriction: == uap10.0
      System.Text.Encoding (>= 4.0.10) - restriction: == uap10.0
      System.Threading (>= 4.0.10) - restriction: == uap10.0
      System.Threading.Tasks (>= 4.0.10) - restriction: == uap10.0
    Rx-Core (2.2.5)
      Rx-Interfaces (>= 2.2.5)
    Rx-Interfaces (2.2.5)
    Rx-Linq (2.2.5)
      Rx-Core (>= 2.2.5)
      Rx-Interfaces (>= 2.2.5)
    Rx-Main (2.2.5)
      Rx-Core (>= 2.2.5)
      Rx-Interfaces (>= 2.2.5)
      Rx-Linq (>= 2.2.5)
      Rx-PlatformServices (>= 2.2.5)
    Rx-PlatformServices (2.3)
      Rx-Core (>= 2.2)
      Rx-Interfaces (>= 2.2)
    Rx-WindowStoreApps (2.2.5) - restriction: == uap10.0
      Rx-Main (>= 2.2.5)
      Rx-WinRT (>= 2.2.5)
    Rx-WinRT (2.2.5) - restriction: || (== win8) (>= portable-win81+wpa81)
      Rx-Main (>= 2.2.5)
    Rx-Xaml (2.2.5) - restriction: || (== net45) (== win8) (>= portable-win81+wpa81)
      Rx-Main (>= 2.2.5)
    Splat (1.6.2) - restriction: == win8
    System.Collections (4.3) - restriction: == uap10.0
    System.Diagnostics.Debug (4.3) - restriction: == uap10.0
    System.Diagnostics.Tools (4.3) - restriction: == uap10.0
    System.IO (4.3) - restriction: == uap10.0
    System.Linq (4.3) - restriction: == uap10.0
    System.Linq.Expressions (4.3) - restriction: == uap10.0
    System.ObjectModel (4.3) - restriction: == uap10.0
    System.Reflection (4.3) - restriction: == uap10.0
    System.Reflection.Extensions (4.3) - restriction: == uap10.0
    System.Runtime (4.3) - restriction: == uap10.0
    System.Runtime.Extensions (4.3) - restriction: == uap10.0
    System.Runtime.InteropServices.WindowsRuntime (4.3) - restriction: == uap10.0
    System.Runtime.Serialization.Primitives (4.3) - restriction: == uap10.0
    System.Runtime.Serialization.Xml (4.3) - restriction: == uap10.0
    System.Text.Encoding (4.3) - restriction: == uap10.0
    System.Threading (4.3) - restriction: == uap10.0
    System.Threading.Tasks (4.3) - restriction: == uap10.0

This adds these lines to my project file (for the Rx-WinRT bits):

<Choose>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v5.0')) Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.tvOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.watchOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile32')">
  <ItemGroup>
	<Reference Include="System.Reactive.WindowsRuntime">
	  <HintPath>packages\Rx-WinRT\lib\portable-win81+wpa81\System.Reactive.WindowsRuntime.dll</HintPath>
	  <Private>True</Private>
	  <Paket>True</Paket>
	</Reference>
  </ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETCore'">
  <ItemGroup>
	<Reference Include="System.Reactive.WindowsRuntime">
	  <HintPath>packages\Rx-WinRT\lib\windows8\System.Reactive.WindowsRuntime.dll</HintPath>
	  <Private>True</Private>
	  <Paket>True</Paket>
	</Reference>
  </ItemGroup>
</When>
</Choose>

If I run against the v2 source, I get a single line for all those packages that are duplicated. The line for Rx-WinRT looks like this.

Rx-WinRT (>= 2.2.5) - restriction: || (&& (< net45) (< win8) (>= portable-win81+wpa81)) (>= uap10.0) (&& (>= win8) (< portable-win81+wpa81))

The only warnings I get are related to the fact the Rx-* packages have been unlisted. It's probably not relevant.

The owner of Rx-Core 2.2.5 has unlisted the package. This could mean that the package version is deprecated or shouldn't be used anymore.

Contributor

csmager commented Aug 23, 2017

Sure. Lock file below.

NUGET
  remote: https://api.nuget.org/v3/index.json
    reactiveui (7.4)
      reactiveui-core (7.4)
    reactiveui-core (7.4)
      Rx-Core (>= 2.2.5) - restriction: == uap10.0
      Rx-Interfaces (>= 2.2.5) - restriction: == uap10.0
      Rx-Linq (>= 2.2.5) - restriction: == uap10.0
      Rx-Main (>= 2.2.5)
      Rx-Main (>= 2.2.5) - restriction: == net45
      Rx-Main (>= 2.2.5) - restriction: >= portable-win81+wpa81
      Rx-Main (>= 2.2.5) - restriction: == win8
      Rx-PlatformServices (>= 2.2.5) - restriction: == uap10.0
      Rx-WindowStoreApps (>= 2.2.5) - restriction: == uap10.0
      Rx-WinRT (>= 2.2.5) - restriction: >= portable-win81+wpa81
      Rx-WinRT (>= 2.2.5) - restriction: == uap10.0
      Rx-WinRT (>= 2.2.5) - restriction: == win8
      Rx-Xaml (>= 2.2.5) - restriction: == net45
      Rx-Xaml (>= 2.2.5) - restriction: >= portable-win81+wpa81
      Rx-Xaml (>= 2.2.5) - restriction: == win8
      Splat (>= 1.6.2) - restriction: == uap10.0
      Splat (>= 1.4 < 2.0)
      Splat (>= 1.4 < 2.0) - restriction: == net45
      Splat (>= 1.4 < 2.0) - restriction: >= portable-win81+wpa81
      Splat (>= 1.4 < 2.0) - restriction: == win8
      System.Collections (>= 4.0.10) - restriction: == uap10.0
      System.Diagnostics.Debug (>= 4.0.10) - restriction: == uap10.0
      System.Diagnostics.Tools (>= 4.0) - restriction: == uap10.0
      System.IO (>= 4.0.10) - restriction: == uap10.0
      System.Linq (>= 4.0) - restriction: == uap10.0
      System.Linq.Expressions (>= 4.0.10) - restriction: == uap10.0
      System.ObjectModel (>= 4.0.10) - restriction: == uap10.0
      System.Reflection (>= 4.0.10) - restriction: == uap10.0
      System.Reflection.Extensions (>= 4.0) - restriction: == uap10.0
      System.Runtime (>= 4.0.20) - restriction: == uap10.0
      System.Runtime.Extensions (>= 4.0.10) - restriction: == uap10.0
      System.Runtime.InteropServices.WindowsRuntime (>= 4.0) - restriction: == uap10.0
      System.Runtime.Serialization.Primitives (>= 4.1) - restriction: == uap10.0
      System.Runtime.Serialization.Xml (>= 4.1) - restriction: == uap10.0
      System.Text.Encoding (>= 4.0.10) - restriction: == uap10.0
      System.Threading (>= 4.0.10) - restriction: == uap10.0
      System.Threading.Tasks (>= 4.0.10) - restriction: == uap10.0
    Rx-Core (2.2.5)
      Rx-Interfaces (>= 2.2.5)
    Rx-Interfaces (2.2.5)
    Rx-Linq (2.2.5)
      Rx-Core (>= 2.2.5)
      Rx-Interfaces (>= 2.2.5)
    Rx-Main (2.2.5)
      Rx-Core (>= 2.2.5)
      Rx-Interfaces (>= 2.2.5)
      Rx-Linq (>= 2.2.5)
      Rx-PlatformServices (>= 2.2.5)
    Rx-PlatformServices (2.3)
      Rx-Core (>= 2.2)
      Rx-Interfaces (>= 2.2)
    Rx-WindowStoreApps (2.2.5) - restriction: == uap10.0
      Rx-Main (>= 2.2.5)
      Rx-WinRT (>= 2.2.5)
    Rx-WinRT (2.2.5) - restriction: || (== win8) (>= portable-win81+wpa81)
      Rx-Main (>= 2.2.5)
    Rx-Xaml (2.2.5) - restriction: || (== net45) (== win8) (>= portable-win81+wpa81)
      Rx-Main (>= 2.2.5)
    Splat (1.6.2) - restriction: == win8
    System.Collections (4.3) - restriction: == uap10.0
    System.Diagnostics.Debug (4.3) - restriction: == uap10.0
    System.Diagnostics.Tools (4.3) - restriction: == uap10.0
    System.IO (4.3) - restriction: == uap10.0
    System.Linq (4.3) - restriction: == uap10.0
    System.Linq.Expressions (4.3) - restriction: == uap10.0
    System.ObjectModel (4.3) - restriction: == uap10.0
    System.Reflection (4.3) - restriction: == uap10.0
    System.Reflection.Extensions (4.3) - restriction: == uap10.0
    System.Runtime (4.3) - restriction: == uap10.0
    System.Runtime.Extensions (4.3) - restriction: == uap10.0
    System.Runtime.InteropServices.WindowsRuntime (4.3) - restriction: == uap10.0
    System.Runtime.Serialization.Primitives (4.3) - restriction: == uap10.0
    System.Runtime.Serialization.Xml (4.3) - restriction: == uap10.0
    System.Text.Encoding (4.3) - restriction: == uap10.0
    System.Threading (4.3) - restriction: == uap10.0
    System.Threading.Tasks (4.3) - restriction: == uap10.0

This adds these lines to my project file (for the Rx-WinRT bits):

<Choose>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v5.0')) Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.tvOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.watchOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile32')">
  <ItemGroup>
	<Reference Include="System.Reactive.WindowsRuntime">
	  <HintPath>packages\Rx-WinRT\lib\portable-win81+wpa81\System.Reactive.WindowsRuntime.dll</HintPath>
	  <Private>True</Private>
	  <Paket>True</Paket>
	</Reference>
  </ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETCore'">
  <ItemGroup>
	<Reference Include="System.Reactive.WindowsRuntime">
	  <HintPath>packages\Rx-WinRT\lib\windows8\System.Reactive.WindowsRuntime.dll</HintPath>
	  <Private>True</Private>
	  <Paket>True</Paket>
	</Reference>
  </ItemGroup>
</When>
</Choose>

If I run against the v2 source, I get a single line for all those packages that are duplicated. The line for Rx-WinRT looks like this.

Rx-WinRT (>= 2.2.5) - restriction: || (&& (< net45) (< win8) (>= portable-win81+wpa81)) (>= uap10.0) (&& (>= win8) (< portable-win81+wpa81))

The only warnings I get are related to the fact the Rx-* packages have been unlisted. It's probably not relevant.

The owner of Rx-Core 2.2.5 has unlisted the package. This could mean that the package version is deprecated or shouldn't be used anymore.

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Aug 24, 2017

Member

We think we found the root cause and hope to provide a fix later today or tomorrow. Currently you can work around it by using the v2 nuget url

Member

forki commented Aug 24, 2017

We think we found the root cause and hope to provide a fix later today or tomorrow. Currently you can work around it by using the v2 nuget url

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Aug 24, 2017

Member

ok I pushed a temporary workaround which automatically uses v2 feed. This gives us a bit time until we do the correct fix

Member

forki commented Aug 24, 2017

ok I pushed a temporary workaround which automatically uses v2 feed. This gives us a bit time until we do the correct fix

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Aug 24, 2017

Member

you may need to use -f to invalidate the cache.

Member

forki commented Aug 24, 2017

you may need to use -f to invalidate the cache.

forki added a commit that referenced this issue Aug 24, 2017

matthid added a commit that referenced this issue Aug 24, 2017

@forki forki closed this in bd0a8f3 Aug 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment