Skip to content

Instantly share code, notes, and snippets.

@jsturtevant
Last active December 10, 2024 19:12
Show Gist options
  • Save jsturtevant/ce387b60cd0188ac4d0ddd3f2cac38d5 to your computer and use it in GitHub Desktop.
Save jsturtevant/ce387b60cd0188ac4d0ddd3f2cac38d5 to your computer and use it in GitHub Desktop.
Commands for testing wasi in dotnet runtime cheatsheet

build runtime/libraries run a sample project

./build.sh -bl -os wasi -subset mono+libs -c Debug         
./dotnet.sh build /p:TargetOS=wasi /p:Configuration=Debug /t:RunSample src/mono/sample/wasi/wasi-tls/Wasip2.Tls.Console.Sample.csproj

build unit tests for specific library:

./build.sh -bl -subset mono+libs+libs.tests -c Debug #can leave mono off after first run         
./dotnet.sh build /t:Test src/libraries/System.Net.Security/tests/UnitTests/ /p:TargetOS=wasi /p:TargetArchitecture=wasm /p:Configuration=Debug     

build subset:

./build.sh -projects /home/jstur/projects/runtime/src/libraries/*/System.Net.Security.sln -bl -os wasi -subset libs+libs.tests -c Debug  

build/run tests for clr:

./build.sh -bl -subset clr+libs+libs.tests -c Debug           
./dotnet.sh build /t:Test src/libraries/System.Net.Security/tests/UnitTests/ /p:Configuration=Debug 

trouble shooting

home/jstur/projects/runtime/.dotnet/sdk/9.0.100/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(221,5): 
error NU5118: Warning As Error: File '/home/jstur/projects/runtime/artifacts/bin/native/net10.0-wasi-Debug-wasm/libz.a' 
is not added because the package already contains file 'runtimes/wasi-wasm/native/libz.a

try dotnet --clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment