forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wasm] Fix inclusion of
marshal-ilgen
component (dotnet#87629)
* [wasm] Fix inclusion of `marshal-ilgen` Issue: `marshal-ilgen` component never included Reason: The item inclusion was being done *outside* any targets, which would get evaluated *before* any targets are run. But the item that it depends on to decide whether to include `marshal-ilgen` is in target `_ScanAssembliesDecideLightweightMarshaler`. This broke microbenchmarks with: ``` Error: [MONO] * Assertion at /__w/1/s/src/mono/mono/component/marshal-ilgen-stub.c:28, condition `!m_type_is_byref(t)' not met at ft (/home/helixbot/work/96640802/w/B9C40A15/e/performance/artifacts/bin/for-running/MicroBenchmarks/fa21f9df-08d0-43a4-b28d-0078821ea492/bin/net8.0/browser-wasm/AppBundle/dotnet.runtime.js:3:12422) at mt (/home/helixbot/work/96640802/w/B9C40A15/e/performance/artifacts/bin/for-running/MicroBenchmarks/fa21f9df-08d0-43a4-b28d-0078821ea492/bin/net8.0/browser-wasm/AppBundle/dotnet.runtime.js:3:12676) at wasm_trace_logger (wasm://wasm/00a5f7d6:wasm-function[7879]:0x1e41d0) at eglib_log_adapter (wasm://wasm/00a5f7d6:wasm-function[581]:0x37fbb) at monoeg_g_logv_nofree (wasm://wasm/00a5f7d6:wasm-function[504]:0x35f57) at monoeg_assertion_message (wasm://wasm/00a5f7d6:wasm-function[508]:0x36078) at mono_assertion_message (wasm://wasm/00a5f7d6:wasm-function[510]:0x360bb) at stub_emit_marshal_ilgen (wasm://wasm/00a5f7d6:wasm-function[1300]:0x66db1) at mono_emit_marshal (wasm://wasm/00a5f7d6:wasm-function[1820]:0x8990b) at emit_native_wrapper_ilgen (wasm://wasm/00a5f7d6:wasm-function[2651]:0xb86de) ``` * [wasm] WBT: Use sdk 8.0.100-preview.6.23314.19 .. to workaround dotnet#87647 . * [wasm] Add test for marshal-ilgen - wbt * add missing file
- Loading branch information
Showing
4 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Runtime.InteropServices.JavaScript; | ||
|
||
Console.WriteLine("Hello, Console!"); | ||
|
||
return 0; | ||
|
||
public partial class MyClass | ||
{ | ||
[JSExport] | ||
internal static string Greeting() | ||
{ | ||
int[] x = new int[0]; | ||
call_needing_marhsal_ilgen(x); | ||
|
||
var text = $"Hello, World! Greetings from node version: {GetNodeVersion()}"; | ||
return text; | ||
} | ||
|
||
[JSImport("node.process.version", "main.mjs")] | ||
internal static partial string GetNodeVersion(); | ||
|
||
[DllImport("incompatible_type")] | ||
static extern void call_needing_marhsal_ilgen(int[] numbers); | ||
} | ||
|