-
Notifications
You must be signed in to change notification settings - Fork 520
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
Support group-specific dependencies #140
Comments
Note that the nuspec reference is quite unclear if not wrong on what happens if multiple groups specify a compatible target framework. The behavior of NuGet itself is equivalent to the /lib/net40 style folders, i.e. the "best" fit wins and the others are ignored. From the nuspec reference: "All dependencies inside a group are installed together if the target framework is compatible with the project's framework profile.". This could be interpreted in a way that all groups with a compatible target framework should be installed - and the current Paket behavior correct. However, that would make it impossible to restrict to specific versions only (= constraint) and is not how NuGet behaves. |
Verbose Output:
|
Thanks! Just noticed this is also used in the Octokit nuspec testfile where the dependency on |
it already is a big pain.... |
boah. this thing is really really ugly. |
Related stuff at end of #68 |
this is completely fucked up. and I don't even see a way to solve this with @ilkerde's strict mode. |
Most cases where such monkey-patching is needed is bad packages not restricting their target platforms properly, so ideally this could be fixed there instead. But this is not always possible unfortunately. |
after think about this: There is no way to do this without computing the whole installation model in advance. This will probably improve some other things too. But it will take a while. So please manually edit to:
Notice I also remoded the paket flag. This will make the nodes for paket to not touch it again. |
Yes, this will work for me as workaround. Thanks! |
It's interesting that there seem to be two ways of modelling conditional NuGet package dependencies -
It seems the latter is more sustainable or downstream packages are not respecting the Law of Demeter (though it's tempting if System.Threading only needs to be shimmed in @cdrnet #145 and #146 address the two concerns you note re octokit
@cdrnet How about renaming this issue to "support group-specific dependencies" (or calving a new issue and closing this)
@forki (or @ilkerde) Can you explain what you mean by strict mode wrt this issue? (I'd like to understand it for #154). I've come across it in the docs but to be honest they didnt speak to me and I hence wasnt able to arrive a sufficient understanding to be able to verify whether it was explained wlll or whether I'm just missing a concept (or 3!) |
@bartelink I don't quite understand how the mentioned
|
@cdrnet No, not suggesting one can always be expressed in terms of the other. Just saying they use a Null Object pattern in some cases. I agree your example def can not be expressed that way. The specific thing I was referring to is that in 4.0 there is a DLL whereas in 4.5 its in core FW. They could have extracted a package for 4.0 and put in a conditional dep but they have not yet. (They have quite a few DLLs in there and arguably they should split to avoid having to put so many redundant copies of things). But obviously that leads to stacks of packages. Old DRY vs Rule of 2-3+ thing etc. |
Ah ok, thanks for the clarification. |
the current Paket version generates the following lockfile for your case:
So it should only reference TaskParallelLibrary for .NET 3.5. Can you check if it works? |
It seems to work, the resulting project file looks good to me! Thanks! There is now an issue with a group-specific framework assembly reference, but I'll open a new issue on this. |
Project A has a dependency on B, which in turn depends on TaskParallelLibrary, but only for target platform .Net 3.5. TaskParallelLibrary is an indirect dependency only and not mentioned in paket.references or or paket.dependencies (but is mentioned in paket.lock).
The nuspec dependencies of B look like the following:
With Paket v0.2.26, the following references are generated in A:
The first one for v3.5 seems to be correct, but the latter should not be there, as it causes TaskParallelLibrary to be referenced in v4.0 and newer as well.
See: https://github.com/mathnet/mathnet-symbolics/blob/paket/src/Symbolics/Symbolics.fsproj
Does Paket not support framework-conditional dependencies at all yet or is this merely a resolver issue?
The text was updated successfully, but these errors were encountered: