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

ProtoGenTask fails when UseArtifactsOutput = true is active #2095

Open
lahma opened this issue Feb 4, 2024 · 0 comments
Open

ProtoGenTask fails when UseArtifactsOutput = true is active #2095

lahma opened this issue Feb 4, 2024 · 0 comments
Labels

Comments

@lahma
Copy link

lahma commented Feb 4, 2024

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants