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

Add DNMD into src/native #107961

Draft
wants to merge 235 commits into
base: main
Choose a base branch
from
Draft

Conversation

jkoritzinsky
Copy link
Member

@jkoritzinsky jkoritzinsky commented Sep 17, 2024

Add dnmd into the dotnet/runtime repo for usage by cDAC (and in the future, usage as the native ECMA-335 metadata library for the repo as a whole).

Depends on #107889

Includes basic structure, readme.md and Cmake for building.
Update CoTaskMemAlloc to 8-byte align.
Add base COM interfaces
Update C++ #ifdef
Add == operator for GUIDs
Updates GUID and BSTR tests.
Scenario tests broken on Windows.
uppercase hexidecmal strings for GUIDs.
Move util.h out of public inc/ dir
Add test for InvalidCastException
Fix memory leak in scenario test
Add dncp::com_ptr smart pointer for IUnknown
Add common wide string APIs
Create dotnet based project system for ease of use.

Create MSBuild system that works with
the basic dotnet commands.

Add notes to readme on how to test using
the dotnet SDK.
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 Sep 21, 2024

for usage by cDAC

Is it actually going to be a net win to use unmanaged metadata reader in cDAC?

@jkotas
Copy link
Member

jkotas commented Sep 21, 2024

usage as the native ECMA-335 metadata library for the repo as a whole

It would make more sense to me to focus on this part: prove that this metadata reader is at least as good as the existing runtime reader and replace the current the runtime reader.

void (*func)(const uint8_t*, size_t, uint8_t*);
sha1_func()
{
void* img_handle = dlopen("libcrypto.so", RTLD_LAZY);
Copy link
Member

Choose a reason for hiding this comment

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

I do not think we want to introduce a core runtime dependency on OpenSSL. OpenSSL (and other real crypto stacks) can be locked down in various ways. We do not want to the core runtime to fail to start if they decide to lock down the legacy hash alg. It creates a whole new set of failure modes.

The core runtime has an exception for non-crypto use of the legacy crypto hash algorithms. If we wanted to do something about it, we would take a breaking change to switch to non-crypto hash algorithms.

@jkoritzinsky
Copy link
Member Author

jkoritzinsky commented Sep 21, 2024

for usage by cDAC

Is it actually going to be a net win to use unmanaged metadata reader in cDAC?

For cDAC in particular, the idea was to use DNMD for the IMetaDataImport exposure from CLRDataModule.

usage as the native ECMA-335 metadata library for the repo as a whole

It would make more sense to me to focus on this part: prove that this metadata reader is at least as good as the existing runtime reader and replace the current the runtime reader.

I'd like to eventually use DNMD throughout the repo, but I plan to do more perf work in actual CoreCLR and Mono scenarios (after merging this preferably as doing actual testing in the runtime will require some corresponding runtime changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure Hackathon Issues picked for Hackathon NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants