dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.9k stars 4.63k forks source link

[cdacreader] Simplify build order and dependencies #104158

Open lambdageek opened 2 months ago

lambdageek commented 2 months ago

The original src/native/managed infrastructure was developed with the idea that we need to build libcdacreader.so/cdacreader.dll (or libcdacreader.a/cdacreader.a before static library support was abandoned) ahead of the main CoreCLR build so that we can link to the shared library during the CoreCLR build (specifically during the DAC build).

But we don't do that now. Instead the DAC shared library dynamically loads the cDAC using dlopen/LoadLibrary

That means we don't have a true build-time dependency between the cDAC and the rest of the CoreCLR build. So we don't need to hook it in via runtime-prereqs.proj. We can add it as a separate subset or as a ProjectReference some place else. The only requirements are:

  1. Must be available before we package up the runtime
  2. Must be available before we create Core_Root for runtime tests
  3. Must be available before we run library tests

This is also a first step for any plan to publish the cdacreader separately from the runtime (which is a long-term goal of the cdac effort: it should be possible to distribute and use cdacreader out of band)

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @hoyosjs See info in area-owners.md if you want to be subscribed.

jkoritzinsky commented 2 months ago

With these new requirements, is there interest in NativeAOT-ing it with the live-built NativeAOT runtime instead of the LKG SDK?

lambdageek commented 2 months ago

With these new requirements, is there interest in NativeAOT-ing it with the live-built NativeAOT runtime instead of the LKG SDK?

I think that would be a nice bonus.


It's a long term goal for cdac to be distributed out of band (so any new enough cdac can be used to examine a released .NET9+ runtime). So the shipping/packaging story will change.

But for a runtime developer inner loop it would certainly be nice that a live NativeAOT can build a live cdacreader which can debug a live CoreCLR as it runs tests

jkotas commented 2 months ago

a live NativeAOT can build a live cdacreader which can debug a live CoreCLR as it runs tests

If you are doing more intrusive changes in the runtime, live Native AOT is likely going to be broken too, and you are stuck with no debugging tools. I think using live NativeAOT to build tools is not helping with making us more productive.