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
[5.0.0-beta008] Paket does not add dependencies correctly #2378
Comments
So I have no idea if what nuget does is even correct ... Add FSharp.Core to a net461 project. Nuget: <?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FSharp.Core" version="4.1.17" targetFramework="net461" />
<package id="System.ValueTuple" version="4.3.0" targetFramework="net461" />
</packages> Paket:
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net45\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="mscorlib">
<Paket>True</Paket>
</Reference>
<Reference Include="System.Console">
<HintPath>..\..\packages\System.Console\lib\net46\System.Console.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="System.ComponentModel.Composition">
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="System.Numerics">
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="System.Threading.Thread">
<HintPath>..\..\packages\System.Threading.Thread\lib\net46\System.Threading.Thread.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="System.Threading.ThreadPool">
<HintPath>..\..\packages\System.Threading.ThreadPool\lib\net46\System.Threading.ThreadPool.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose> |
omg |
whooah strictly speaking I'd could say it's a packaging error of
Workaround is to add the ValueType to the reference file. IMHO this clearly shows the new restriction system is working as intended...
Solution is of course to clearly specify dependencies in the nuspec. /cc @forki |
Or nuget prefers the "any" group to the netstandard group in that case ... |
I think it is even more fucked up: https://github.com/dotnet/standard/blob/master/docs/versions.md
So the current nuget considers Net461 to support netstandard1.4, but NOT 1.6 FYI, my test was with VS2015.2, which does not contain the netstandard2 tooling afaik. |
/cc @enricosada |
Yeah It seems to change depending on what you select on nuget version: http://nugettoolsdev.azurewebsites.net/4.0.0/get-nearest-framework?project=net461&package=netstandard16%0D%0Aany
I don't think that is what the table tries to say. Basically they say that 4.6.2 no longer supports 1.5 |
But I still think paket is doing the "correct" thing if net461 is considered compatible with netstandard16 (which I'm assuming from both tables). |
@matthid Take note of Tooling1 vs Tooling2 |
|
I do interpret it that way ... |
Or maybe it does, and I have to rething this |
I think I read somewhere in passing (but can't remember) that net461 does NOT support netstandard1.6 ootb, and that they would need to somehow update the tooling to fix things up. But that means that even if paket is correct to resolve it this way, it may break people if the rest of the tools does not support net461=ns16. |
ah okey. We already added the mapping net461 -> netstandard20 into paket. Therefore we already are at tooling 2.0. |
|
We could remove that mapping. But fundamentally it's a |
https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/Versioning/FrameworkHandling.fs#L384 |
Then your use case would work, but still fundamentally FSharp.Core is broken, the error will just be delayed until tooling 2.0 arrives or we add that back... |
Ok, I agree that FSharp.Core is broken, so the original issue is solved. My question is now how to handle ns16 and whether any following tooling will break if we |
So everything isn't as bad as initially thought :) |
Not sure if it matters, there basically is not a lot of tooling atm to care about. So I think it's ok for paket to be already compat with 2.0. But I don't know everything maybe @enricosada can help there. |
It probably is not worth it to be compatible with both (1.0 tooling and 2.0 tooling) |
I would rather say it is impossible, because at resolve time you don't know which tooling will be used in the future. |
And this fallback group is really and edge case that only matters here. For most packages they properly specify their groups and paket will prefer the right one (for example full framework groups are prefered when building for full frameworks) so I guess there only a small number of packages where this actually matters. I hope that clarifies my view on this. |
We actually do know from the runtime graph (Basically if the Packaging.Tools package is there). But I don't think it's worth it |
I dont know if targeting I think the But is better ask nuget team for clarification |
Anyway yes, fsharp.core should restrict "System.ValueTuple"" to o lo the needed fw I'll check tomorrows 1.0 or 2.0 is not that different. |
any framework is not the same as net40? Yes they are not that much different but in this case it makes a difference. |
ref #2381 My vote is for disabling the ns16 <> net461 mapping until we have figured this stuff out. |
please send a pr to modify the line I was referencing above... |
Will do that in a few minutes... But that would once again just be a band-aid fix. Does anyone even understand how this shit is supposed to work? For example, I found dotnet/standard#342 and this states that you need to add Suddenly I feel like Java got it right by just mashing a few .class files together into one folder. |
sry but you have a bad timing, will look into this in a couple of days... |
I guess what matters are not the dlls in the build folder but the targets file which should be added |
The non-beta version still works, so no stress. I don't know about everyone else, but I am not blocked by this issue. PR sent: #2380 |
@matthid @0x53A sorry yesterday i was on mobile, and i read badly the issue (i had no access to zip repro)
@0x53A That's because they are using the new msbuild extensibility. if you see, the about this issue.I checked and <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="4.1.17" />
</ItemGroup>
</Project> the only ref (non facade) added are:
|
Dunno, I only tested old sdk. @enricosada This issue describes two problems, the first was that System.ValueTuple was not added, which afaik was concluded to be an authoring error. So closed from my side. The second problem is that I can't actually use a netstandard1.6 library from net461, it fails at runtime. I think this is an issue with paket, where some conditions are too strict, but can't investigate more at the moment. Will try to find out more in the evening after work. |
Yes, i was just trying to restrict the scenario. bug is in paket code for old sdk .
Ihmo, adding
Both old sdk and new sdk. if not, is a bug. As a note,
@0x53A using
Yes, is there to stay. But for |
I don't agree
I'll give a more detailed answer in a couple of days: But the problem is the reverse. It does remove it for all frameworks which are compatible with netstandard1.6. So it WILL remove it for net47 (Or NuGet just does weird things I don't understand). |
Atm that dependency is in the fallback group. that mean is used for all target framework except |
I have extracted the netstandard1.6 stuff into it's own issue, otherwise it get's confusing: #2381 |
@enricosada since when do framework dependency groups have to match exactly? I thought we take the dependency group which is most compatible? For net47 netstandard16 is clearly more compatible than the fallback rule? What are the exact rules there? Are they defined anywhere or are you just assuming (as we are)? |
@enricosada I commented on the FSharp.Core issue, which hopefully makes my point more clear. Feel free to ping me somewhere if you have more information on this as it seems that I just can't get your point :/ |
So the dependency on System.ValueTuple was removed anyway :) |
I think we need to support 4.1 for quite some time as it's the only package providing xamarin support until everything works with netstandard20... But yeah this is not a paket bug :P |
paket4 did not yet contain the mapping net461 <> ns16, right? So even though this may be a packaging issue, it should not actually occur. |
@0x53A Well as long as they don't decide to make net47 compatible with netstandard16 for tooling 1.0, yes. |
Full zip at the end.
paket.dependencies
paket.references
FSharp.Core
pakettest.zip
The text was updated successfully, but these errors were encountered: