Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[cdac] Create transport package and rename the cdac reader #114812

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

Merged
merged 17 commits into from
Apr 25, 2025

Conversation

steveisok
Copy link
Member

This change adds new cdac transport packages that are built for Windows, MacOS, and Linux. Each package contains a host specific native cdac library that is meant to ride along with various diagnostics tools.

The cdacreader was also renamed to cdac as part of this change. I picked what I thought was the best suggestion in #108720 (comment). Feel free to make alternate suggestions.
 
Contributes to #108720

@Copilot Copilot AI review requested due to automatic review settings April 18, 2025 02:49
@ghost ghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 18, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces new cdac transport packages for Windows, MacOS, and Linux and renames the cdacreader to cdac.

  • Updated comments and macro definitions in native library code to reflect the new cdac naming
  • Adjusted pipeline build arguments and subset names across YAML configuration files to align with the renaming

Reviewed Changes

Copilot reviewed 231 out of 237 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/debug/daccess/dacimpl.h Updated comments to refer to cdac instead of cdacreader
src/coreclr/debug/daccess/cdac.cpp Renamed macro definition and updated associated comments
eng/pipelines/runtime.yml Revised build arguments to use tools.cdac and tools.cdactests
eng/pipelines/runtime-diagnostics.yml Modified build arguments to reference the updated cdac nomenclature
eng/pipelines/common/evaluate-default-paths.yml Changed subset and include paths to reference cdac instead of cdacreader
Files not reviewed (6)
  • Directory.Build.props: Language not supported
  • eng/Subsets.props: Language not supported
  • eng/liveBuilds.targets: Language not supported
  • src/coreclr/debug/daccess/CMakeLists.txt: Language not supported
  • src/installer/pkg/projects/Microsoft.DotNet.CDac.Transport/Microsoft.DotNet.CDac.Transport.pkgproj: Language not supported
  • src/installer/pkg/projects/cdac-packages.proj: Language not supported

@steveisok steveisok requested review from a team April 18, 2025 02:49
@jkotas
Copy link
Member

jkotas commented Apr 18, 2025

The cdacreader was also renamed to cdac as part of this change

The namespace used by cdac is Microsoft.Diagnostics.DataContractReader. If we are renaming it, it would be nice to make the native binary name to be aligned with the namespace and APIs names to make the connection clear.

@steveisok
Copy link
Member Author

The cdacreader was also renamed to cdac as part of this change

The namespace used by cdac is Microsoft.Diagnostics.DataContractReader. If we are renaming it, it would be nice to make the native binary name to be aligned with the namespace and APIs names to make the connection clear.

I considered that initially and figured I would wait to see how others felt before going there. Thanks for the feedback.

@mikem8361
Copy link
Member

I can't tell from the changes but does the resulting package contain all the platform/architecture builds of the cda modules under a rid subdirectory? Something like tools/win-x64/cdac.dll, tools/linux-x64/libcdac.so, tools/osx-arm64/libcdac.dylib, etc.

@steveisok
Copy link
Member Author

I can't tell from the changes but does the resulting package contain all the platform/architecture builds of the cda modules under a rid subdirectory? Something like tools/win-x64/cdac.dll, tools/linux-x64/libcdac.so, tools/osx-arm64/libcdac.dylib, etc.

Yeah, it'll be runtimes/<rid>/native, but looking at that again it probably should be tools/<rid>/<library>

@jkotas
Copy link
Member

jkotas commented Apr 20, 2025

tools directory in nuget packages is meant for executables. cdac is a native library. runtimes looks right to me.

@am11 am11 added area-Infrastructure and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 21, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

@jkotas
Copy link
Member

jkotas commented Apr 21, 2025

CDac name does not follow the .NET naming conventions:

  • It is not an acronym in common usage. (I do not even know what this acronym stands for.) From .NET Framework design guidelines: "In general, it is important to avoid using acronyms in identifier names unless they are in common usage and are immediately understandable to anyone who might use the framework."
  • If we went with the acronym, it should be capitalized as Cdac. From .NET Framework design guidelines: "Acronyms of three or more characters follow the guidelines of any other word. Only the first letter is capitalized".

I think a longer self-descriptive name would be better.

@max-charlamb
Copy link
Contributor

@jkotas, would you be okay with contractdac?

@steveisok
Copy link
Member Author

I think a longer self-descriptive name would be better.
@jkotas, would you be okay with contractdac?

I have no strong opinion. I'll be glad to name it whatever we all think is best.

@am11
Copy link
Member

am11 commented Apr 23, 2025

The namespace used by cdac is Microsoft.Diagnostics.DataContractReader. If we are renaming it, it would be nice to make the native binary name to be aligned with the namespace and APIs names to make the connection clear.

The convention used by src/native/libs is <managed namespace>.Native, which produce libraries with same pattern, e.g. libSystem.IO.Ports.Native. This could be applied here as well?

@jkotas
Copy link
Member

jkotas commented Apr 23, 2025

System.IO.Ports.Native is a helper library for implementation of System.IO.Ports namespace. The cdacreader is not a helper library like that. cdacreader is a managed library built from https://github.com/dotnet/runtime/tree/main/src/native/managed/cdacreader/src/ that we build with PublishAot. The implementation namespace for this library is Microsoft.Diagnostics.DataContractReader.Legacy;, but that is very long name.

We had more offline conversation about the naming. Stay tuned.

@jkotas
Copy link
Member

jkotas commented Apr 23, 2025

Add something like this to https://github.com/dotnet/runtime/blob/main/docs/project/glossary.md:

CDAC Codename for (Data Contracts)[../design/datacontracts/datacontracts_design.md] project

@jkotas
Copy link
Member

jkotas commented Apr 24, 2025

Microsoft.DotNet.CDAC.Transport.pkgproj

Nit: The casing that follows .NET naming conventions would be Cdac: #114812 (comment)

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks

@@ -178,6 +178,7 @@

<PropertyGroup>
<DotNetHostBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(OutputRID).$(HostConfiguration)', 'corehost'))</DotNetHostBinDir>
<DotNetCDacBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'mscordaccore_universal', '$(Configuration)', '$(NetCoreAppCurrent)', '$(OutputRID)', 'publish'))</DotNetCDacBinDir>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: DotNetCDacBinDir -> DotNetCdacBinDir, _BuildCDacPack -> _BuildCdacPack

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - I'll do that in a quick follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants