Repository navigation
Fixes for #4183 - #4184
Merged
Merged
Fixes for #4183#4184
Conversation
TheAngryByrd
force-pushed
the
4183-multitarget-pack
branch
5 times, most recently
from
November 10, 2022 04:47
2441975 to
ecd66b3
Compare
TheAngryByrd
force-pushed
the
4183-multitarget-pack
branch
from
November 10, 2022 04:49
ecd66b3 to
3f71e6c
Compare
TheAngryByrd
commented
Nov 10, 2022
TheAngryByrd
left a comment
Contributor
Author
There was a problem hiding this comment.
Left self code review
| "sdk": { | ||
| "version": "6.0.301" | ||
| "version": "6.0.301", | ||
| "rollForward": "latestMinor" |
Contributor
Author
There was a problem hiding this comment.
Needed since dotnet versions keep moving on
Comment on lines
+1058
to
+1094
| let ``#4183 writes ranges for floating deps``() = | ||
| let scenario = "i004183-apply-with-multiple-groups" | ||
| use __ = prepareSdk scenario | ||
| let scenarioRoot = scenarioTempPath scenario | ||
| let fsprojPath = Path.Combine(scenarioRoot, "before.fsproj") | ||
|
|
||
| let inputNuspecPath = Path.Combine(scenarioRoot, "before.nuspec") | ||
| let refFile = Path.Combine(scenarioRoot, "paket.references") | ||
| let inputDeps = scrapeDeps inputNuspecPath | ||
|
|
||
| let dispose, messages = paket (sprintf "fix-nuspecs files %s project-file %s" inputNuspecPath fsprojPath) scenario | ||
| use __ = dispose | ||
| let outputDeps = scrapeDeps inputNuspecPath | ||
|
|
||
| let actualPackages = outputDeps |> Seq.filter (fst>>(=)"FSharp.Core") | ||
| let expectedVersionRanges = | ||
| [ | ||
| "[4.7.2,5.0.0)" | ||
| "[7.0.0,8.0.0)" | ||
| ] | ||
| |> Set.ofSeq | ||
|
|
||
| let actualVersionRanges = | ||
| actualPackages | ||
| |> Seq.map snd | ||
| |> Set.ofSeq | ||
|
|
||
| let diff = Set.difference expectedVersionRanges actualVersionRanges | ||
|
|
||
|
|
||
| if diff |> Seq.length = 0 then () | ||
| else | ||
|
|
||
| failwithf "Expected to modify deps for FSharp.Core package with floating version constraint.\nBefore:\t%A\nAfter:\t%A\nMessages:\t%A" | ||
| inputDeps | ||
| outputDeps | ||
| messages |
Contributor
Author
There was a problem hiding this comment.
Test to simulate multi-targeting
Comment on lines
+9
to
+14
| <group targetFramework=".NETStandard2.0"> | ||
| <dependency id="FSharp.Core" version="4.7.2" exclude="Build,Analyzers" /> | ||
| </group> | ||
| <group targetFramework=".NETStandard2.1"> | ||
| <dependency id="FSharp.Core" version="7.0.0" exclude="Build,Analyzers" /> | ||
| </group> |
Contributor
Author
There was a problem hiding this comment.
Multi-target nuspec file
Comment on lines
+2
to
+14
| group testGroup1 | ||
| source https://api.nuget.org/v3/index.json | ||
| storage: none | ||
| nuget FSharp.Core ~> 4 | ||
| framework: netstandard2.0 | ||
| condition: netstandard2_0 | ||
|
|
||
| group testGroup2 | ||
| source https://api.nuget.org/v3/index.json | ||
| storage: none | ||
| nuget FSharp.Core ~> 7 | ||
| framework: netstandard2.1 | ||
| condition: netstandard2_1 No newline at end of file |
Contributor
Author
There was a problem hiding this comment.
paket.dependencies file with multi-targeting
| let k = g.Key,p.Name | ||
| if usedPackages.ContainsKey k |> not then | ||
| usedPackages.Add(k,p) | ||
| usedPackages.Add(k,{p with Settings = lockGroup.Options.Settings}) |
Contributor
Author
There was a problem hiding this comment.
We we're getting the lock file's framework restrictions here. Let me know if I should use another way to get this and revert this change.
Comment on lines
+984
to
+997
| let targetFramework = | ||
| attr "targetFramework" node.ParentNode | ||
| |> Option.bind(fun tfm -> | ||
| PlatformMatching.forceExtractPlatforms tfm |> fun p -> p.ToTargetProfile true | ||
| ) | ||
| let results = | ||
| targetFramework | ||
| |> Option.map(fun tfm -> | ||
| allFrameworkRestrictions | ||
| |> Seq.filter(fun (_, _, fr) -> fr.IsMatch tfm) | ||
| |> Seq.toList | ||
|
|
||
| ) | ||
| |> Option.defaultValue [] |
Contributor
Author
There was a problem hiding this comment.
Code to align the nuspec group's targetFramework with a paket group.
Contributor
Author
|
@forki is there anything I can do to help this along? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for #4183
cc @baronfel