Repository navigation
Fix NativeAOT WASM test native library linkage - #136786
MichalStrehovsky merged 5 commits into
Conversation
Exclude NativeAOT from corerun imports and link native test archives with direct P/Invokes. Enable the PInvoke native library on WASI, correct native return signatures, and skip unsupported delegate callback thunk tests on WASM. Co-authored-by: Copilot <[email protected]> Copilot-Session: 588bbf5d-e3b3-4e23-869e-bbec249dfb32
Remove the NativeAOT WASM merged-wrapper archive copying change while retaining standalone native library linkage. Co-authored-by: Copilot <[email protected]> Copilot-Session: 588bbf5d-e3b3-4e23-869e-bbec249dfb32
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
There was a problem hiding this comment.
🟡 Changes recommended
The native-library wiring omits a required archive and loses symbol isolation between colliding exports, causing unresolved helpers and potentially incorrect interop bindings.
3 open issues
What changed in this PR
This PR updates the runtime test infrastructure to link native test libraries into NativeAOT WebAssembly executables and enables the P/Invoke smoke test’s native library on WASI.
Changes:
- Excludes NativeAOT from corerun-specific imports and adds static archives with direct P/Invoke bindings.
- Enables the native P/Invoke library on WASI and uses target-platform Windows linkage.
- Corrects two native return signatures and adds WASM guards around delegate callback tests.
| File | Description |
|---|---|
src/tests/nativeaot/SmokeTests/PInvoke/PInvoke.cs |
Corrects return types and skips delegate callback scenarios on WASM. |
src/tests/nativeaot/SmokeTests/PInvoke/CMakeLists.txt |
Allows WASI builds and selects Windows libraries by target platform. |
src/tests/Directory.Build.targets |
Separates NativeAOT from corerun setup and adds native archive linkage. |
Review effort: Balanced
Reuse native test archive selection between WasmCorerun and NativeAOT, including the common platform helper archive. Preserve supported delegate function-pointer coverage on WASM. Co-authored-by: Copilot <[email protected]> Copilot-Session: 275b1487-9388-4eff-842a-414088e1ba33
Co-authored-by: Jan Kotas <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
The shared MSBuild/CMake linkage changes require NativeAOT WASI PInvoke smoke execution and CoreCLR WASM native-asset regression validation beyond the source-level review performed.
No open issues 🎉
3 resolved since last review
Review effort: Balanced
|
@jtschuster could you have a look please? This is pulling out some functionality from CLRTest.WasmCorerun.targets (that among other things builds a test-specific corerun that includes native test assets). Then uses the pulled out functionality to link native test assets into the native AOT executable same as corerun does. Also fixes some p/invoke signature mismatches and extracts tests that depend on |


Exclude NativeAOT from corerun imports and link native test archives with direct P/Invokes. Enable the PInvoke native library on WASI, correct native return signatures, and skip unsupported delegate callback thunk tests on WASM.
Co-authored-by: Copilot [email protected]