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

dotnet pack --symbols fails with error about Compile entry not containing Update or Include attribute #4222

Open
moni-dips opened this issue Aug 15, 2023 · 0 comments

Comments

@moni-dips
Copy link

Description

If a project contains <Compile> tags with Remove, then paket pack --symbols fails with an error message.

No further details are provided with -v, such as what project contained the <Compile> entry that was in an unknown format.

Dropping --symbols makes the command complete successfully without errors.

Repro steps

  1. Set compiler to None for a .cs file in project
  2. Execute the command dotnet paket pack -v output --version 1.0.0 --symbols

Expected behavior

One of

  1. No error, symbols package is created
  2. An error message saying what project file contains the failing entry, including the xml fragment is shown

Actual behavior

Paket fails with the exception:

Paket failed with
-> The Compile entry is in unknown format and doesn't contain a Update or Include attribute.
   StackTrace:
        at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1439.Invoke(String message) in D:\a\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1439
        at <StartupCode$Paket-Core>.$ProjectFile.getCompileItem@2023.Invoke(Tuple`2 tupledArg) in C:\code\Paket\src\Paket.Core\PaketConfigFiles\ProjectFile.fs:line 2031
        at Microsoft.FSharp.Collections.Internal.IEnumerator.map@75.DoMoveNext(b& curr) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 78
        at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64
        at Microsoft.FSharp.Collections.Internal.IEnumerator.map@75.DoMoveNext(b& curr) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 77
        at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64
        at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@307[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 308
        at Paket.PackageProcess.convertToSymbols(ProjectFile projectFile, Boolean includeReferencedProjects, PackProcessCache cache, TemplateFile templateFile) in C:\code\Paket\src\Paket.Core\Packaging\PackageProcess.fs:line 103
        at Paket.PackageProcess.optWithSymbols@188-1.GenerateNext(IEnumerable`1& next) in C:\code\Paket\src\Paket.Core\Packaging\PackageProcess.fs:line 189
        at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 405
        at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 441
        at Paket.PackageProcess.allTemplates@213-3.GenerateNext(IEnumerable`1& next) in C:\code\Paket\src\Paket.Core\Packaging\PackageProcess.fs:line 213
        at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 405
        at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 441
        at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@300[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 302
        at Microsoft.FSharp.Collections.Internal.IEnumerator.map@75.DoMoveNext(b& curr) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 77
        at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64
        at Microsoft.FSharp.Core.CompilerServices.ListCollector`1.AddMany(IEnumerable`1 values) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 474
        at Microsoft.FSharp.Core.CompilerServices.ListCollector`1.AddManyAndClose(IEnumerable`1 values) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 494
        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 C:\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 C:\code\Paket\src\Paket.Core\PublicAPI.fs:line 759
        at Paket.Program.handleCommand@897-23.Invoke(ParseResults`1 results)
        at Paket.Program.processWithValidationEx[a](FSharpFunc`2 printUsage, Boolean silent, FSharpFunc`2 validateF, FSharpFunc`2 commandF, a result) in C:\code\Paket\src\Paket\Program.fs:line 47
        at Paket.Program.processWithValidation[T](Boolean silent, FSharpFunc`2 validateF, FSharpFunc`2 commandF, ParseResults`1 result) in C:\code\Paket\src\Paket\Program.fs:line 129
        at Paket.Program.processCommand[a](Boolean silent, FSharpFunc`2 commandF, ParseResults`1 result) in C:\code\Paket\src\Paket\Program.fs:line 132
        at Paket.Program.handleCommand(Boolean silent, Command command) in C:\code\Paket\src\Paket\Program.fs:line 897
        at Paket.Program.main() in C:\code\Paket\src\Paket\Program.fs:line 980

Known workarounds

Remove <Compile Remove= /> tags from project files

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

1 participant