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

[mono][wasm] wasm interop tracking #95084

Closed
7 tasks done
lewing opened this issue Nov 21, 2023 · 7 comments
Closed
7 tasks done

[mono][wasm] wasm interop tracking #95084

lewing opened this issue Nov 21, 2023 · 7 comments
Labels
arch-wasm WebAssembly architecture area-Interop-mono tracking This issue is tracking the completion of other related issues.
Milestone

Comments

@lewing
Copy link
Member

lewing commented Nov 21, 2023

Tracking issue for WasmInterop:

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 21, 2023
@lewing lewing added the arch-wasm WebAssembly architecture label Nov 21, 2023
@ghost
Copy link

ghost commented Nov 21, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Tracking issue for WasmInterop:

Author: lewing
Assignees: -
Labels:

arch-wasm, area-Interop-coreclr, untriaged

Milestone: -

@lewing lewing added this to the 9.0.0 milestone Nov 21, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 21, 2023
@lewing lewing added the tracking This issue is tracking the completion of other related issues. label Nov 21, 2023
@silesmo
Copy link

silesmo commented Jan 11, 2024

#96419

@maxkatz6
Copy link
Contributor

Right now DllImport on WASM throws a compiler error, if there is an unsupported pinvoke or marshaling. Such as com interop, or some windows specific marshaling.

Since on other platforms DllImport seems to be lazily evaluates, unsupported DllImport would crash in runtime when executed. Which is fine, since such code would commonly be hidden under platform conditions, and never actually be executed. But with WASM it’s not possible.

Was there an idea to, possible, replace such pinvokes with stubs that would throw an exception in runtime? Mimicking behavior of non-wasm platforms.

@lewing
Copy link
Member Author

lewing commented Jan 26, 2024

Right now DllImport on WASM throws a compiler error, if there is an unsupported pinvoke or marshaling. Such as com interop, or some windows specific marshaling.

Since on other platforms DllImport seems to be lazily evaluates, unsupported DllImport would crash in runtime when executed. Which is fine, since such code would commonly be hidden under platform conditions, and never actually be executed. But with WASM it’s not possible.

Was there an idea to, possible, replace such pinvokes with stubs that would throw an exception in runtime? Mimicking behavior of non-wasm platforms.

I'm not sure what .NET version or runtime you are referring to but the WASM runtimes definitely support most DLLImports (as static imports) when the build is correctly configured.

@pavelsavara
Copy link
Member

maybe this is already fixed @lewing @mkhamoyan ?

@mkhamoyan
Copy link
Member

I am not sure about Fix DllImport marshaling.
If that is related to this #94895 I guess we can close this ticket, and follow up in #94895.

@maxkatz6
Copy link
Contributor

maxkatz6 commented Jul 5, 2024

@lewing hi. I found that I didn't answer to your question about unsupported DllImports.
Just created an issue with more details and repro: #104463

@lewing lewing closed this as completed Jul 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Interop-mono tracking This issue is tracking the completion of other related issues.
Projects
None yet
Development

No branches or pull requests

6 participants