-
Notifications
You must be signed in to change notification settings - Fork 90
Fix hostfxr_get_available_sdks_result_fn array size type. #340
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
Conversation
This changes the array size type to 'int' so it matches the 'int32_t' native type. This was typed as an enum. The enum type is accepted by CoreCLR. Mono throws a MarshalDirectiveException because it requires the array size to be an integral type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes a marshaling compatibility issue between CoreCLR and Mono by changing the array size parameter type from an enum to int in the hostfxr_get_available_sdks_result_fn delegate. This change ensures Mono can properly marshal the unmanaged function pointer, as Mono requires array size parameters to be integral types while CoreCLR accepts enum types.
- Changes array size parameter type from
hostfxr_resolve_sdk2_result_key_tenum toint - Maintains compatibility with the native
int32_ttype - Resolves MarshalDirectiveException thrown by Mono runtime
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
LGTM |
|
Can this be merged at the earliest ? S390X mono is seeing lot of failures due to this ... |
This changes the array size type to 'int' so it matches the 'int32_t' native type.
This was typed as an enum.
The enum type is accepted by CoreCLR.
Mono throws a MarshalDirectiveException because it requires the array size to be an integral type.
Fixes dotnet/msbuild#12570.
@rainersigwald ptal
cc @jkotas @medhatiwari @giritrivedi