Sitelet https://github.com/fsprojects/Paket/issues/1586
Skip to content

"paket.exe pack" with "include-referenced-projects" and "minimum-from-lock-file" does not work when project references have a paket.template file #1586

Description

@Rcomian

Description

Packing nuget packages does not work when you have this situation:

  • Project references to other nuget packages
  • the switch include-referenced-projects
  • the switch minimum-from-lock-file

Repro steps

  • Create a solution with 2 c# projects PackageA & PackageB
  • Give both projects a minimally working paket.template file with the line type project
  • Add a reference from PackageB to PackageA
  • run the command .paket\paket.exe pack output . include-referenced-projects minimum-from-lock-file

Expected behavior

  • 2 Packages, PackageA.nupkg & PackageB.nupkg
  • PackageB.nupkg includes a reference to PackageA.nupkg but not its assembly

Actual behavior

Command fails with:

Paket failed with:
        The input sequence was empty.
Parameter name: source

With the -v switch we get the stack trace:

StackTrace:
     at Microsoft.FSharp.Collections.SeqModule.Head[T](IEnumerable`1 source)
   at Paket.PackageMetaData.findDependencies@294-4.Invoke(Tuple`2 tupledArg)
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x)
   at Paket.PackageMetaData.findDependencies[a](DependenciesFile dependenciesFile, String config, String platform, TemplateFile template, ProjectFile project, Boolean lockDependencies, Boolean minimumFromLockFile, FSharpMap`2 map, Boolean includeReferencedProjects, FSharpOption`1 version, a specificVersions)
   at Paket.PackageProcess.allTemplates@172.Invoke(Tuple`2 tupledArg)
   at Microsoft.FSharp.Collections.IEnumerator.map@111.DoMoveNext(b& )
   at Microsoft.FSharp.Collections.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.Generator.Microsoft-FSharp-Collections-Generator-Generator-1-get_Apply@542-1.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Collections.Generator.appG[a](Generator`1 g)
   at Microsoft.FSharp.Collections.Generator.EnumeratorWrappingLazyGenerator`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Paket.PackageProcess.Pack[a](String workingDir, DependenciesFile dependenciesFile, String packageOutputPath, FSharpOption`1 buildConfig, FSharpOption`1 buildPlatform, FSharpOption`1 version, IEnumerable`1 specificVersions, FSharpOption`1 releaseNotes, FSharpOption`1 templateFile, FSharpOption`1 excludedTemplates, Boolean lockDependencies, Boolean minimumFromLockFile, Boolean symbols, Boolean includeReferencedProjects, FSharpOption`1 projectUrl)
   at Paket.Program.handler@350-21.Invoke(ParseResults`1 results)
   at Paket.Program.processWithValidation[T](FSharpFunc`2 validateF, FSharpFunc`2 commandF, Command command, String[] args)
   at Paket.Program.processCommand@61-1.Invoke(Command command, String[] args)
   at Paket.Program.main()

Known workarounds

  • Remove switch include-referenced-projects
  • Remove switch minimum-from-lock-file
  • Remove the reference between the two projects
  • Remove the paket.template from PackageA

However, all of these options affect the output nupkg.
The least damaging is probably removing the minimum-from-lock-file flag.

Related information

  • Windows 7
  • Main release
  • .NET Runtime 4.5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions