Paket 7 wrongly patches dependencies versions in NuSpec for multi target projects
Open
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 2.1k
- Forks
- 528
- Avg merge
- 1d 12m
- Merged PRs (30d)
- 54
Description
Description
I want to build NuGet package with different fixed versions for different target frameworks. It worked in Paket 6(.2.1) via dedicated dependency groups but stopped with version 7(0.2).
Repro steps
- Create paket.dependencies file with 2 groups:
group Net5
framework: net5.0
nuget FSharp.Core ~> 5
...
group Net6
framework: net6.0
nuget FSharp.Core ~> 6
...
- Create paket.references for project targeting both net5.0 and net6.0:
group Net5
FSharp.Core
group Net6
FSharp.Core
- Create package with dotnet pack:
Expected behavior
NuSpec:
<dependencies>
<group targetFramework="net5.0">
<dependency id="FSharp.Core" version="5.0.2" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0">
<dependency id="FSharp.Core" version="6.0.3" exclude="Build,Analyzers" />
</group>
</dependencies>
Actual behavior
NuSpec with same FSharpCore version:
<dependencies>
<group targetFramework="net5.0">
<dependency id="FSharp.Core" version="6.0.3" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0">
<dependency id="FSharp.Core" version="6.0.3" exclude="Build,Analyzers" />
</group>
</dependencies>
Paket outputs some info:
...FSharp.Core is a direct dependency and requires version patching...
Known workarounds
Downgrade to Paket 6.2.1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown paket.dependencies and paket.references files, then run dotnet pack and inspect the generated NuSpec dependency groups. Compare Paket 7 with Paket 6.2.1; done means net5.0 retains FSharp.Core 5.0.2 while net6.0 retains 6.0.3.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100