Skip to content

Local build of runtime failing when running CDac tool #107936

@ericstj

Description

@ericstj
  Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'stream')
     at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32
  bufferSize, Boolean leaveOpen)
     at System.IO.StreamReader..ctor(Stream stream, Encoding encoding)
     at Microsoft.DotNet.Diagnostics.DataContract.BuildTool.ContractDescriptorSourceFileEmitter.GetTemplateString() in
  C:\src\dnceng\dotnet-runtime\src\coreclr\tools\cdac-build-tool\ContractDescriptorSourceFileEmitter.cs:line 30
     at Microsoft.DotNet.Diagnostics.DataContract.BuildTool.ContractDescriptorSourceFileEmitter.Emit(TextWriter dest) i
  n C:\src\dnceng\dotnet-runtime\src\coreclr\tools\cdac-build-tool\ContractDescriptorSourceFileEmitter.cs:line 60
     at Microsoft.DotNet.Diagnostics.DataContract.BuildTool.ComposeCommand.Run(ParseResult parse, CancellationToken tok
  en) in C:\src\dnceng\dotnet-runtime\src\coreclr\tools\cdac-build-tool\ComposeCommand.cs:line 77
     at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancell
  ationToken)
  [74/302] Building CXX object tools\superpmi\superpmi\CMakeFiles\superpmi.dir\cycletimer.cpp.obj
  FAILED: debug/runtimeinfo/cdac/contract-descriptor.c C:/src/dnceng/dotnet-runtime/artifacts/obj/coreclr/windows.x64.R
  elease/debug/runtimeinfo/cdac/contract-descriptor.c

Seems like

return typeof(ContractDescriptorSourceFileEmitter).Assembly.GetManifestResourceStream(TemplateResourceName)!;
is returning null for resource with name
public const string TemplateResourceName = "Microsoft.DotNet.Diagnostics.DataContract.Resources.contract-descriptor.c.in";

Which seems to me like some file is missing from the resources of this assembly. I can't determine where that is supposed to come from because it looks like a wildcard includes it:

<EmbeddedResource Include="$(RepoRoot)docs\design\datacontracts\data\**\*.jsonc" LogicalName="$(BaselineManifestResourcePrefix)%(RecursiveDir)%(Filename)%(Extension)" />

But I see nothing that matches the filename https://github.com/dotnet/runtime/tree/8ae3796ef109962725833610c26e3f0bb06e2988/docs/design/datacontracts/data

If I disassemble the tool built in my local build I see the following resource:
image

@lambdageek @elinor-fung

Metadata

Metadata

Assignees

Labels

area-Diagnostics-coreclrin-prThere is an active PR which will close this issue when it is mergedneeds-author-actionAn issue or pull request that requires more info or actions from the author.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions