-
Notifications
You must be signed in to change notification settings - Fork 525
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
Framework restriction is lost for global build folder #2263
Comments
Urgh, this is a mess: It only depends on So that means that even if the .targets / .props is in the /build/ folder, it may need a conditional import. I think this partition will need a small nudge: @matthid what are your framework restrictions? |
I have no restrictions in the dependencies file |
After downloading half the internet I can reproduce it. The easiest fix would be to revert #2234, which would resolve this, but break #2227 again. Because FSharp.NET.Sdk is only a dependency for NetStandard1.6, it has a framework restriction at install-time, even though the overall paket.dependencies does not have a framework restriction. Because of that, the partition will incorrectly tag it as global: So basically we would need to get the global restriction list, not the per-package restriction list, because these two may differ. @forki, @matthid do you know how I could access the global (for the group) framework restriction from ```ProjectFile.updateReferences``? |
Note to myself: This also means my improvement in the fix_dotnetcore branch is incorrect as well. |
My proposed fix would be to plumb through the framework restrictions of the group, and compare LibFolder.Targets against that. This is based on an assumption I made in my original PR, and which I would like to get confirmed. It was also touched upon here: #2245 (comment). I assume that if a group has a restriction, and a project uses a package of that group, then the project implicitly fits that restriction. E.g. if I have That's what I had wanted to implement with https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/Files/ProjectFile.fs#L799. Unfortunately that didn't exactly do what I had wanted it to do, because the set it compared against was not that of the group, but that of the package, which in this case contains a framework restriction against NetStandard, even though the group itself has no such restriction. |
I think the assumption is correct, but there is one exception: there is this paket feature where you can set conditions to a group or package. Those need to be respected... |
In case both the group and the package have a restriction, the one that should be used is the intersection, right? e.g.
should both result in using net462 for MyPackage. Or should the package restriction override the group restriction? |
intersection makes the most sense imho. I never understood the package specific restrictions. Especially considering the consistent world view we have... |
I think the restrictions are generally just a workaround to reduce download size / resolve time. If no one else tackles this until then I will try to code something up on the weekend ... |
Paket seems to already use the intersection when resolving: paket.dependencies:
paket.lock:
I think wrt installing the targets, we can ignore the package restrictions and just compare against the group restrictions. My reasoning is that even in the worst case, an import may be tagged as fw-specific, even though it should be tagged global, but never the other way around. If we wanted to also take the package restrictions into account, then we would need to walk the dependency chain(s), and look where something was imported from. |
use group framework restrictions to decide if a package is global or fw-specific
Description
I just did some
paket install
on FakeLib and got the following changeThe project did no longer compile.
Known workarounds
It might or might not be related to #2234 /cc @0x53A
I think there are actually two problems
FSharp.NET.Sdk
at allThe text was updated successfully, but these errors were encountered: