Skip to content
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

Paket pack fails when project container Compile Update entries #3752

Closed
thinkbeforecoding opened this issue Dec 9, 2019 · 4 comments
Closed

Comments

@thinkbeforecoding
Copy link
Contributor

Description

In C# NetSdk projects, all *.cs files are included by default, but it is possible to change files properties by using the Update attribute instead of Include. When present in a csproj file, paket pack with symbols fails when trying to package source

Repro steps

  1. Create a NetSdk project

  2. Add a property to a cs file:

<Compile Update="Progam.cs">
      <DependentUpon>OtherFile.cs</DependentUpon>
  </Compile>

  1. paket pack --symbols ./nugets/

Expected behavior

It should generate the nuget package

Actual behavior

It fails with a NullReferenceException:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at <StartupCode$Paket-Core>[email protected](Tuple`2 tupledArg)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@274[T,TResult](ConcatEnumerator`2 x, Unit unitVar0)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Paket.PackageProcess.convertToSymbols(ProjectFile projectFile, Boolean includeReferencedProjects, PackProcessCache cache, TemplateFile templateFile) in D:\code\Paket\src\Paket.Core\Packaging\PackageProcess.fs:line 106
   at [email protected](IEnumerable`1& next) in D:\code\Paket\src\Paket.Core\Packaging\PackageProcess.fs:line 190
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at [email protected](IEnumerable`1& next) in D:\code\Paket\src\Paket.Core\Packaging\PackageProcess.fs:line 213
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@267[T,TResult](ConcatEnumerator`2 x, Unit unitVar0)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.Generator.Microsoft-FSharp-Collections-Generator-Generator-1-get_Apply@412-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 pinProjectReferences, FSharpOption`1 interprojectReferencesConstraint, Boolean symbols, Boolean includeReferencedProjects, FSharpOption`1 projectUrl) in D:\code\Paket\src\Paket.Core\Packaging\PackageProcess.fs:line 208
   at Paket.Dependencies.Pack[b](String outputPath, FSharpOption`1 buildConfig, FSharpOption`1 buildPlatform, FSharpOption`1 version, FSharpOption`1 specificVersions, FSharpOption`1 releaseNotes, FSharpOption`1 templateFile, FSharpOption`1 workingDir, FSharpOption`1 excludedTemplates, FSharpOption`1 lockDependencies, FSharpOption`1 minimumFromLockFile, FSharpOption`1 pinProjectReferences, FSharpOption`1 interprojectReferencesConstraint, FSharpOption`1 symbols, FSharpOption`1 includeReferencedProjects, FSharpOption`1 projectUrl) in D:\code\Paket\src\Paket.Core\PublicAPI.fs:line 743
   at [email protected](ParseResults`1 results) in D:\code\Paket\src\Paket\Program.fs:line 853
   at Paket.Program.processWithValidationEx$cont@42[a](Boolean silent, FSharpFunc`2 commandF, a result, Unit unitVar) in D:\code\Paket\src\Paket\Program.fs:line 43         at Paket.Program.processWithValidationEx[a](FSharpFunc`2 printUsage, Boolean silent, FSharpFunc`2 validateF, FSharpFunc`2 commandF, a result) in D:\code\Paket\src\Paket\Program.fs:line 35
   at Paket.Program.handleCommand(Boolean silent, Command command) in D:\code\Paket\src\Paket\Program.fs:line 853
   at Paket.Program.main() in D:\code\Paket\src\Paket\Program.fs:line 934
   at <StartupCode$paket>.$Paket.Program.main@() in D:\code\Paket\src\Paket\Program.fs:line 945

Known workarounds

Avoid using the --symbols flag

@forki
Copy link
Member

forki commented Dec 10, 2019

could you please upload a zip which repros this? thx

@thinkbeforecoding
Copy link
Contributor Author

fix-update.zip

Run the build.cmd or build.sh 👍

@forki
Copy link
Member

forki commented Dec 12, 2019

thanks for reporting. it's fixed on 5.x and 6.x channels

@thinkbeforecoding
Copy link
Contributor Author

Thank you for fixing !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants