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 PInvoke Table generation does not handle backticks #99241

Closed
barbieri-quisitive opened this issue Mar 4, 2024 · 4 comments
Closed
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono needs-author-action An issue or pull request that requires more info or actions from the author.
Milestone

Comments

@barbieri-quisitive
Copy link

Description

Microsoft.CognitiveServices.Speech puts the following line into the pinvoke-table.h:

void wasm_native_to_interp_Microsoft_CognitiveServices_Speech_csharp_InteropEvent`1_FromNativeCallback (int arg0,int arg1,int arg2) {

The backtick (`) after InteropEvent is not recognized by the C compiler.

I found the following recent resolved bug in which a character needed to be escaped, it sounds like more escaping just needs to be done: #93999

Reproduction Steps

Build a WASM project that includes Microsoft.CognitiveServices.Speech 1.35.0 as a dependency.

Expected behavior

Successful build

Actual behavior

C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.0\Sdk\WasmApp.Native.targets(366,5): error : In file included from C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0\runtimes\browser-wasm\native\src\pinvoke.c:15:
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.0\Sdk\WasmApp.Native.targets(366,5): error : obj\Debug\net8.0\browser-wasm\wasm\for-build\pinvoke-table.h:3038:6: error: variable has incomplete type 'void'
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.0\Sdk\WasmApp.Native.targets(366,5): error : void wasm_native_to_interp_Microsoft_CognitiveServices_Speech_csharp_InteropEvent`1_FromNativeCallback (int arg0,int arg1,int arg2) {

Regression?

No response

Known Workarounds

No response

Configuration

.NET 8.0
Windows 11 x64
Avalonia WASM

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 4, 2024
@lewing lewing added this to the 9.0.0 milestone Mar 4, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Mar 4, 2024
@lewing lewing added the arch-wasm WebAssembly architecture label Mar 4, 2024
@ghost
Copy link

ghost commented Mar 4, 2024

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

Issue Details

Description

Microsoft.CognitiveServices.Speech puts the following line into the pinvoke-table.h:

void wasm_native_to_interp_Microsoft_CognitiveServices_Speech_csharp_InteropEvent`1_FromNativeCallback (int arg0,int arg1,int arg2) {

The backtick (`) after InteropEvent is not recognized by the C compiler.

I found the following recent resolved bug in which a character needed to be escaped, it sounds like more escaping just needs to be done: #93999

Reproduction Steps

Build a WASM project that includes Microsoft.CognitiveServices.Speech 1.35.0 as a dependency.

Expected behavior

Successful build

Actual behavior

C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.0\Sdk\WasmApp.Native.targets(366,5): error : In file included from C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0\runtimes\browser-wasm\native\src\pinvoke.c:15:
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.0\Sdk\WasmApp.Native.targets(366,5): error : obj\Debug\net8.0\browser-wasm\wasm\for-build\pinvoke-table.h:3038:6: error: variable has incomplete type 'void'
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.0\Sdk\WasmApp.Native.targets(366,5): error : void wasm_native_to_interp_Microsoft_CognitiveServices_Speech_csharp_InteropEvent`1_FromNativeCallback (int arg0,int arg1,int arg2) {

Regression?

No response

Known Workarounds

No response

Configuration

.NET 8.0
Windows 11 x64
Avalonia WASM

Other information

No response

Author: barbieri-quisitive
Assignees: mkhamoyan
Labels:

arch-wasm, area-Build-mono

Milestone: 9.0.0

@mkhamoyan
Copy link
Member

Tried to reproduce this locally but it doesn't fail. Looks like the issue has been solved in .Net 9.
In pinvoke_table.h I don't see backtick after InteropEvent but 60

result

@maraf maraf added the needs-author-action An issue or pull request that requires more info or actions from the author. label Apr 12, 2024
Copy link
Contributor

This issue has been marked needs-author-action and may be missing some important information.

@lewing
Copy link
Member

lewing commented Apr 13, 2024

Calling this closed, please reopen if you can reproduce the problem with recent nightly builds or preview4 when it is released

@lewing lewing closed this as completed Apr 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono needs-author-action An issue or pull request that requires more info or actions from the author.
Projects
None yet
Development

No branches or pull requests

4 participants