Skip to content

Conversation

@AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Oct 20, 2025

This is the first step in consume the cDAC scenario on WASM.

Removes duplication of the ContractDescriptor data structure.
Links together the cdac contracts so include directories flow correctly.
Exports a method during WASM builds so the Node.js APIs can acquire the
address of the data contract.

@dotnet-policy-service
Copy link
Contributor

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

Co-authored-by: Jeremy Koritzinsky <[email protected]>
@AaronRobinsonMSFT AaronRobinsonMSFT marked this pull request as ready for review October 21, 2025 01:34
Copilot AI review requested due to automatic review settings October 21, 2025 01:34
@AaronRobinsonMSFT AaronRobinsonMSFT requested a review from kg as a code owner October 21, 2025 01:34
Copy link
Contributor

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 enables the cDAC (Contract Data Access) data contract descriptor to be exposed and consumed on WebAssembly (WASM) platforms. Previously, the contract descriptor functionality was conditionally excluded from WASM builds.

Key changes:

  • Removed conditional exclusion of GC_DESCRIPTOR compilation flag for WASM targets
  • Added WASM-specific export function to expose the contract descriptor symbol
  • Refactored contract descriptor structure definition into a shared header file

Reviewed Changes

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

Show a summary per file
File Description
src/coreclr/vm/wks/CMakeLists.txt Enabled GC_DESCRIPTOR compilation flag for WASM by removing the conditional exclusion
src/coreclr/interpreter/CMakeLists.txt Minor CMake syntax cleanup (endif formatting)
src/coreclr/dlls/mscoree/exports.cpp Added WASM-specific export function to expose contract descriptor symbol using Emscripten's keepalive attribute
src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt Simplified CMake configuration by removing conditional variables and reordering link dependencies for consistency
src/coreclr/debug/datadescriptor-shared/inc/contract-descriptor.h Created new shared header file defining the ContractDescriptor structure
src/coreclr/debug/datadescriptor-shared/contractdescriptorstub.c Removed duplicate structure definition, now includes shared header
src/coreclr/debug/datadescriptor-shared/contractconfiguration.h.in Added include for shared contract descriptor header
src/coreclr/debug/datadescriptor-shared/contract-descriptor.c.in Removed duplicate structure definition and unnecessary include, now uses shared header
src/coreclr/clrdatadescriptors.cmake Added include directory configuration for the new shared header location

@kg
Copy link
Member

kg commented Oct 21, 2025

I don't know anything about cDAC but the changes in here look fine to me. Not comfortable giving it a green check until someone who knows the area better takes a look.

Copy link
Member

@max-charlamb max-charlamb left a comment

Choose a reason for hiding this comment

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

cDAC changes look good to me. I don't have as much insight into the other build changes.

Running the runtime-diagnostics pipeline since it was excluded from these changes.

Copy link
Member

@max-charlamb max-charlamb left a comment

Choose a reason for hiding this comment

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

Pipeline passed

Copy link
Member

@radekdoulik radekdoulik left a comment

Choose a reason for hiding this comment

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

LGTM

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit b4161e2 into dotnet:main Oct 22, 2025
105 of 107 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the daccess_oop branch October 22, 2025 03:00
@EgorBo
Copy link
Member

EgorBo commented Oct 22, 2025

@AaronRobinsonMSFT this change broke windows-x86 Release Libraries_NET481 pipeline it seems:

D:\a\_work\1\s\artifacts\obj\coreclr\windows.x86.Release\vm\datadescriptor\cdac-gc_svr_descriptor\contractconfiguration.h(3):
 fatal error C1083: Cannot open include file: 'contract-descriptor.h': No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-VM-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants