Skip to content

Resolve WASI SDK for NativeAOT runtime test builds - #135952

Merged
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:nativeaot-wasi-test-sdk
Oct 20, 2026
Merged

MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:nativeaot-wasi-test-sdk

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Summary

Resolve the shared WASI SDK for NativeAOT runtime-test projects.

Import AcquireWasiSdk.targets for NativeAOT WASI tests and populate WASI_SDK_PATH before the NativeAOT OS-specific linker setup. Perform this in each test project because grouped test builds run in separate MSBuild processes and do not inherit properties computed by an outer target.

Also exclude WASM from the test infrastructure's Unix rpath linker argument.

Validation

On the combined local NativeAOT WASI bringup tree, including other unmerged enablement:

  • .\src\tests\build.cmd nativeaot checked test nativeaot\SmokeTests\AttributeTrimming\AttributeTrimming.csproj wasm wasi passed, including after deleting the test artifacts.
  • AttributeTrimming executed under Wasmtime with exit code 100.
  • .\src\tests\build.cmd nativeaot checked tree nativeaot wasm wasi reached test compilation/linking; the latest run failed only on the existing UnitTests lowering assertion, with C math ABI warnings also remaining.

This branch contains only this cherry-picked commit from main; it was not built independently. Automated execution integration and Unix-host validation are not included.

Note

This PR description was generated by GitHub Copilot.

Acquire the shared WASI SDK and set WASI_SDK_PATH before native linker
setup in each NativeAOT WASI project. Grouped test builds launch separate
MSBuild processes, so target-computed outer properties do not propagate.

Exclude WASM from Unix rpath arguments, which its linker does not support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6f3a617-acae-4f4f-95d3-20b2a0bac43c
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Reported validation depends on unmerged enablement, leaving standalone branch and Unix-host builds unverified.

No open issues 🎉

What changed in this PR

Resolves the shared WASI SDK within each NativeAOT runtime-test project, supporting grouped builds that use separate MSBuild processes.

Changes:

  • Imports SDK acquisition and sets WASI_SDK_PATH before OS-specific linker setup.
  • Excludes WASM targets from Unix rpath linker arguments.
File Description
src/​tests/​Directory.Build.targets Adds per-project WASI SDK resolution and excludes WASM from Unix rpath arguments.

Review effort: Balanced

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@dotnet/ilc-contrib could someone have a look? This is only doing a couple things:

  • trigger AcquireWasiSdk.targets so that it sets up WASI build.
  • Copy the value of RuntimeBuildWasiSdkPath (that the .targets set up and is a repo build convention) to WASI_SDK_PATH (that seems to be the product convention and Add dedicated NativeAOT WASM build integration for WASI #135955 set up native AOT targets to also use it)
  • do not try setting rpath on WASI

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

Thanks!

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/ba-g failure was #135963

@MichalStrehovsky
MichalStrehovsky merged commit 4105cc0 into dotnet:main Oct 20, 2026
93 of 97 checks passed
@MichalStrehovsky
MichalStrehovsky deleted the nativeaot-wasi-test-sdk branch October 20, 2026 01:50
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-NativeAOT-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants