asynkron/protoactor-dotnet

ProtoGenTask fails when UseArtifactsOutput = true is active

lahma opened this issue · 0 comments

lahma commented

To reproduce, add new artifacts output layout directive to examples/Directory.Build.props (requires .NET 8 SDK):

<UseArtifactsOutput>true</UseArtifactsOutput>

The directive moves obj/bin folders and friends to more desirable locations under root artifacts folder. More information about the new artifacts layout introduced in NET 8 SDK.

Build fails with:

Processing Project file: D:\Work\protoactor-dotnet\examples\ClusterPubSub\ClusterPubSub.csproj
Intermediate OutputPath: D:\Work\protoactor-dotnet\examples\artifacts\obj\ClusterPubSub\debug\
ProtoFile Item File:protos.proto, Imports:, Templates:
Processing Proto file: protos.proto
Output file path: D:\Work\protoactor-dotnet\examples\artifacts\obj\ClusterPubSub\debug\protopotato\protos-56802139B417225BEDE61EE36CF7AAEC.cs
2>Proto.Cluster.CodeGen.props(17,9): Error MSB4018 : The "ProtoGenTask" task failed unexpectedly.
System.ArgumentException: Paths should be relative to the import paths, not rooted (Parameter 'name')
   at Google.Protobuf.Reflection.FileDescriptorSet.Add(String name, Boolean includeInOutput, TextReader source, FileDescriptorProto fromFile) in /_/src/protobuf-net.Reflection/Parsers.cs:line 123
   at Google.Protobuf.Reflection.FileDescriptorSet.Add(String name, Boolean includeInOutput, TextReader source) in /_/src/protobuf-net.Reflection/Parsers.cs:line 117
   at Proto.Cluster.CodeGen.Generator.Generate(FileInfo input, FileInfo output, IEnumerable`1 importPath, TaskLoggingHelper log, String rootPath, String template)
   at Proto.Cluster.CodeGen.ProtoGenTask.GenerateFile(String projectDirectory, String objDirectory, FileInfo inputFileInfo, DirectoryInfo[] importPaths, String template, String outputFileName)
   at Proto.Cluster.CodeGen.ProtoGenTask.ProcessFile(String projectDirectory, String objDirectory, String protoFile, String additionalImportDirsString, String templateFilesString)
   at Proto.Cluster.CodeGen.ProtoGenTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)