Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
248387a
Enable FEATURE_WEBCIL for WASI and include webcildecoder.h in pregene…
lewing May 22, 2026
bc8d205
[wasi] Add CoreCLR-WASI build wiring (subset of #128465 seed)
lewing Jun 6, 2026
b4df288
[wasi] Pre-seed try_run() cache for cross-compile cmake checks
lewing Jun 6, 2026
0271943
[wasi] CoreCLR PAL stubs and gap shims for WASI build
lewing Jun 6, 2026
7c723b2
[wasi] Wire eventpipe diag-server PAL (TCP) for CoreCLR-WASI
lewing Jun 6, 2026
7460012
[wasi] Phase 5 + Phase 6: corerun.wasm host + native wasm exceptions
lewing Jun 6, 2026
428005c
[wasi] init_std_handle: don't dup stdio fds (WASI has no dup/F_DUPFD_…
lewing Jun 6, 2026
04b601c
[wasi] Phase 7: PAL stack bounds, mmap-wasi arena, host memory bump
lewing Jun 6, 2026
e2e9dbe
[wasi] CoreLib load: exepath via CORE_ROOT, file mapping via open()
lewing Jun 6, 2026
838b161
Defer WASI finalization to WasiEventLoop instead of running it inline
lewing May 22, 2026
e0ce2c0
[wasi] Skip EnableFinalization in Thread::DetachThread on WASI
lewing Jun 6, 2026
f78f1ac
[wasi] Include Unix Interop.Libraries.cs for TargetsWasi in CoreLib
lewing Jun 7, 2026
b2e8ed6
[wasi] Regenerate callhelpers-{pinvoke,reverse,interp-to-managed}.cpp
lewing Jun 7, 2026
a20708d
[wasi] Disable FeaturePerfTracing in managed CoreLib for WASI
lewing Jun 7, 2026
926c89e
[wasi] Fix duplicate AcquireWasiSdk.targets import in libs build
lewing Jun 7, 2026
4ce473f
[wasi] Add minimal CoreCLR-WASI CI build job
lewing Jun 7, 2026
ea51ff9
[wasm] Clean up duplicate AcquireWasiSdk import + orphaned thunks
lewing Jun 7, 2026
b66afb9
[wasi] Narrow try_load_library dlopen disable to TARGET_WASI
lewing Jun 7, 2026
43d4c08
[wasi] Remove F_DUPFD_CLOEXEC=1030 / O_CLOEXEC=0 compile fallbacks
lewing Jun 7, 2026
43a08b8
[wasi] Make finalizer scheduling a pure native flag (no managed reentry)
lewing Jun 7, 2026
2970c5a
[wasi] Remove mmap-wasi.c shim — obsolete after PR #127328
lewing Jun 7, 2026
24e0940
[wasi] Implement RaiseException via throw PAL_SEHException
lewing Jun 7, 2026
47e3ef0
Enable R2R crossgen of CoreLib for wasi
lewing Jun 7, 2026
ecc3197
[wasi] Add minimal CoreCLR-WASI smoke-test harness
lewing Jun 18, 2026
e6a78fa
[wasi] Wire CoreCLR runtime tests to run under wasmtime
lewing Jun 18, 2026
b9b0d7a
[wasi] Add file-based-app test runner + fix preopens for runtime tests
lewing Jun 18, 2026
b7b9913
[wasi] Expand JIT/Regression coverage; categorize known failures
lewing Jun 18, 2026
be38bae
[wasi] Expand baseservices coverage; categorize known failures
lewing Jun 18, 2026
1f16565
[wasi] Recategorize V1/SEH/VJ tests: threading, not EH bug
lewing Jun 18, 2026
ea011ce
[wasi] Expand JIT/Methodical coverage; categorize known failures
lewing Jun 18, 2026
4de0469
[wasi] Drain finalizer queue synchronously on WASM/WASI
lewing Jun 18, 2026
6fab21c
[wasi] Promote 2 newly-passing tests out of known-failures
lewing Jun 18, 2026
2b93fd0
[wasi] Expand JIT/CodeGenBringUp + Generics + Directed + opt coverage
lewing Jun 18, 2026
05b6191
[wasi] Expand Loader + GC coverage; categorize known failures
lewing Jun 18, 2026
6cfe297
[wasi] Expand Exceptions + reflection + Regressions; flag 2nd real bug
lewing Jun 18, 2026
5943bd1
[wasi] Document root-cause analysis of two real bugs
lewing Jun 18, 2026
cec5271
[wasi] Reclassify GitHub_89834: async-Main Task.Run PNSE, not an EH bug
lewing Jun 23, 2026
c68e95a
[wasi] Drop SystemJS_ prefix from WASI-only finalizer scheduling symbols
lewing Jun 23, 2026
3010dfc
[wasi] Add CoreCLR runtime-tests pipeline + wire into runtime.yml
lewing Jun 23, 2026
8c0e737
[wasi] Restore browser-side callhelpers thunks dropped by WASI regen
lewing Jun 24, 2026
0dec22d
[wasi] Trim over-commented WASI bring-up sections to match repo conve…
lewing Jun 25, 2026
1338b31
[wasi] Address review feedback from #129904
lewing Jun 26, 2026
61c5a50
[wasi] Convert known-failures.txt to per-project CLRTestTargetUnsuppo…
lewing Jun 26, 2026
d543995
[wasi] Address code-review findings on wasi-bringup
lewing Jun 26, 2026
6dfa50f
Shrink WASI test exclusion diff: revert 72 RequiresProcessIsolation c…
lewing Jun 26, 2026
cceb5aa
Address PR #130051 review feedback
lewing Jun 30, 2026
855ba00
[wasi] Fix runtime pipeline YAML: drop duplicate runtimeFlavor
lewing Jun 30, 2026
d9c6a14
[wasi] Use merged-runner mode for CoreCLR-WASI runtime tests
lewing Jun 30, 2026
3b34f5b
[wasi] Add AsyncHelpers.Wasi.cs so 'async Task Main' pumps the WASI e…
lewing Jul 1, 2026
0fe2535
[wasi] Fix P/Invoke resolver key for [WasmImportLinkage] imports
lewing Jul 1, 2026
dae04e9
[wasi] Route Wasi-CoreCLR runtime tests through the desktop dispatch …
lewing Jul 1, 2026
c7b85cf
[wasi] Smoke: exercise Task.Delay in AsyncMain; add GitHub_27169 to k…
lewing Jul 1, 2026
d9f0b4b
[wasi] Drop shutdown-time finalizer pump (jkotas review)
lewing Jul 1, 2026
ba617c5
[wasi] Revert 24 per-project CLRTestTargetUnsupported markers, docume…
lewing Jul 1, 2026
f3a50ec
[wasi] Trim verbose block comments across the diff
lewing Jul 1, 2026
f67530a
[wasi] Wrap test .sh watcher with coreutils timeout instead of $CORE_…
lewing Jul 1, 2026
4c2f57c
[wasi] Stage wasmtime into Helix correlation payload
lewing Jul 1, 2026
20fcb1e
[wasi] Drop EX_TRY/EX_CATCH around FinalizerThreadWait drain (jkotas …
lewing Jul 1, 2026
89df955
[wasi] Address Copilot review batch
lewing Jul 1, 2026
daa894e
[wasi] Gate AcquireWasiSdk.targets import to TargetsWasi builds
lewing Jul 1, 2026
a743b57
[wasi] Address Copilot review: guard std-fd close in PAL, MakeDir bef…
lewing Jul 1, 2026
dfbb581
Merge branch 'main' into wasi-bringup
lewing Jul 2, 2026
2be6290
[wasi] Address Copilot review: make WasiFinalizer_RunWorker a conform…
lewing Jul 2, 2026
c0b7231
[wasi] Remove stale MethodImpl self-override note (#126124 verified)
lewing Jul 2, 2026
2407f89
[wasi] Drop no-op TARGET_BROWSER/TARGET_WASI split in ThrowExceptionF…
lewing Jul 2, 2026
3a5d9ad
[wasi] Address rereview: doc + Rel() path-separator fixes
lewing Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<_CoreCLRSupportedOS Condition="'$(TargetsAndroid)' == 'true' and '$(TargetArchitecture)' != 'x86'">true</_CoreCLRSupportedOS>
<_CoreCLRSupportedOS Condition="'$(TargetsBrowser)' == 'true'">true</_CoreCLRSupportedOS>
<_CoreCLRSupportedOS Condition="'$(TargetsWasi)' == 'true'">true</_CoreCLRSupportedOS>
<_CoreCLRSupportedOS Condition="'$(TargetsAppleMobile)' == 'true'">true</_CoreCLRSupportedOS>

<_CoreCLRSupportedArch Condition="'$(TargetArchitecture)' != 'ppc64le' and '$(TargetArchitecture)' != 's390x'">true</_CoreCLRSupportedArch>
Expand Down Expand Up @@ -61,6 +62,7 @@
<DefaultPrimaryRuntimeFlavor>CoreCLR</DefaultPrimaryRuntimeFlavor>
<DefaultPrimaryRuntimeFlavor Condition="'$(CoreCLRSupported)' != 'true'">Mono</DefaultPrimaryRuntimeFlavor>
<DefaultPrimaryRuntimeFlavor Condition="'$(TargetsBrowser)' == 'true' and !$(Subset.ToLowerInvariant().Contains('clr'))">Mono</DefaultPrimaryRuntimeFlavor>
<DefaultPrimaryRuntimeFlavor Condition="'$(TargetsWasi)' == 'true' and !$(Subset.ToLowerInvariant().Contains('clr'))">Mono</DefaultPrimaryRuntimeFlavor>
<PrimaryRuntimeFlavor Condition="'$(PrimaryRuntimeFlavor)' == ''">$(DefaultPrimaryRuntimeFlavor)</PrimaryRuntimeFlavor>
</PropertyGroup>

Expand Down Expand Up @@ -98,6 +100,7 @@
<RuntimeFlavor Condition="'$(TargetsAndroid)' == 'true' and ($(_subset.Contains('+clr+')) or $(_subset.Contains('+clr.')))">CoreCLR</RuntimeFlavor>
<RuntimeFlavor Condition="'$(TargetsAppleMobile)' == 'true' and ($(_subset.Contains('+clr+')) or $(_subset.Contains('+clr.')))">CoreCLR</RuntimeFlavor>
<RuntimeFlavor Condition="'$(TargetsBrowser)' == 'true' and ($(_subset.Contains('+clr+')) or $(_subset.Contains('+clr.')))">CoreCLR</RuntimeFlavor>
<RuntimeFlavor Condition="'$(TargetsWasi)' == 'true' and ($(_subset.Contains('+clr+')) or $(_subset.Contains('+clr.')))">CoreCLR</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and '$(TargetsMobile)' == 'true'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')) and !$(_subset.Contains('+clr.corelib+')))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">$(PrimaryRuntimeFlavor)</RuntimeFlavor>
Expand All @@ -109,6 +112,7 @@
<DefaultCoreClrSubsets Condition="'$(TargetsAndroid)' == 'true'">clr.native+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets Condition="'$(TargetsAppleMobile)' == 'true'">clr.native+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets Condition="'$(TargetsBrowser)' == 'true'">provision.emsdk+clr.native+clr.corelib+clr.nativecorelib+clr.tools+clr.packages+clr.crossarchtools+libs.native+host.native</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets Condition="'$(TargetsWasi)' == 'true'">clr.native+clr.corelib+clr.nativecorelib+clr.tools+clr.packages+clr.crossarchtools+libs.native</DefaultCoreClrSubsets>
<!-- Even on platforms that do not support the CoreCLR runtime, we still want to build ilasm/ildasm. -->
<DefaultCoreClrSubsets Condition="'$(RuntimeFlavor)' != 'CoreCLR'">clr.iltools+clr.packages</DefaultCoreClrSubsets>

Expand Down
16 changes: 15 additions & 1 deletion eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@
$(LibrariesNativeArtifactsPath)libbrotlicommon.a;
$(LibrariesNativeArtifactsPath)libbrotlidec.a;
$(LibrariesNativeArtifactsPath)libbrotlienc.a" />

<!-- Same situation on WASI with CoreCLR: System.IO.Compression.Native/CMakeLists.txt
installs libSystem.IO.Compression.Native.a and libz.a directly into the
CoreCLR sharedFramework directory for CLR_CMAKE_TARGET_WASI, where they are
picked up by RuntimeFiles. Exclude the libs.native copies to avoid duplicates. -->
<ExcludeNativeLibrariesRuntimeFiles Condition="'$(TargetsWasi)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'"
Include="$(LibrariesNativeArtifactsPath)libSystem.IO.Compression.Native.a;
$(LibrariesNativeArtifactsPath)libz.a" />
<LibrariesRuntimeFiles Include="
$(LibrariesNativeArtifactsPath)*.dat;
$(LibrariesNativeArtifactsPath)*.dll;
Expand Down Expand Up @@ -295,7 +303,7 @@
IsNative="true" />
</ItemGroup>

<ItemGroup Label="Wasi" Condition="'$(TargetOS)' == 'wasi'">
<ItemGroup Label="Wasi" Condition="'$(TargetOS)' == 'wasi' and '$(RuntimeFlavor)' == 'Mono'">
<LibrariesRuntimeFiles
Include="
$(LibrariesNativeArtifactsPath)dotnet.wasm;
Expand All @@ -317,6 +325,12 @@
IsNative="true" />
</ItemGroup>

<!-- WASI CoreCLR ships only the static runtime libraries (already
provided by RuntimeFiles from $(CoreCLRSharedFrameworkDir)) and
the libs.native static libs (already provided by the unconditional
glob above). corerun.wasm is not part of the runtime pack. -->


<Error Condition="'@(LibrariesRuntimeFiles)' == ''" Text="The 'libs' subset must be built before building this project." />
</Target>

Expand Down
12 changes: 12 additions & 0 deletions eng/native.wasm.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project>
<Import Project="$(RepositoryEngineeringDir)AcquireEmscriptenSdk.targets" />
<Import Project="$(RepositoryEngineeringDir)AcquireWasiSdk.targets"
Condition="'$(TargetsWasi)' == 'true' and Exists('$(RepositoryEngineeringDir)AcquireWasiSdk.targets')" />

<!-- These packages provide ICU and timezone data paths for the native build (CMake).
Skip them during app-level relink (IsBrowserWasmProject) since the runtime pack
Expand Down Expand Up @@ -39,6 +41,16 @@
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_PERFTRACING_DISABLE_PERFTRACING_LISTEN_PORTS=1&quot;" />
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT=1&quot;" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsWasi)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'">
<NativeCMakeArg Include="-cmakeargs &quot;-DGEN_PINVOKE=1&quot;" />
<!-- Initial WASI bring-up disables EventPipe / diagnostic-server PAL
via FEATURE_PERFTRACING=0 in src/coreclr/CMakeLists.txt; the
PERFTRACING_DISABLE_* flags are unused while PERFTRACING is off
but kept for symmetry with browser-CoreCLR and for when we
re-enable PERFTRACING in a follow-up. -->
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_PERFTRACING_DISABLE_PERFTRACING_LISTEN_PORTS=1&quot;" />
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT=1&quot;" />
</ItemGroup>
<ItemGroup Condition="'$(FeatureMultithreading)' != 'true'">
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_PERFTRACING_DISABLE_THREADS=1&quot;" />
</ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,9 @@ if(CLR_CMAKE_TARGET_UNIX)
if(CLR_CMAKE_TARGET_BROWSER)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_BROWSER>)
endif()
if(CLR_CMAKE_TARGET_WASI)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_WASI>)
endif()
elseif(CLR_CMAKE_TARGET_WASI)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_WASI>)
else(CLR_CMAKE_TARGET_UNIX)
Expand Down
33 changes: 32 additions & 1 deletion eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ endif(CLR_CMAKE_HOST_OS STREQUAL emscripten)

if(CLR_CMAKE_TARGET_OS STREQUAL wasi)
set(CLR_CMAKE_HOST_WASI 1)
set(CLR_CMAKE_HOST_UNIX 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL wasi)

#--------------------------------------------
Expand Down Expand Up @@ -436,6 +437,7 @@ if(CLR_CMAKE_TARGET_OS STREQUAL emscripten OR CLR_CMAKE_TARGET_OS STREQUAL brows
endif(CLR_CMAKE_TARGET_OS STREQUAL emscripten OR CLR_CMAKE_TARGET_OS STREQUAL browser)

if(CLR_CMAKE_TARGET_OS STREQUAL wasi)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_WASI 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL wasi)

Expand Down Expand Up @@ -522,7 +524,36 @@ else()
add_compile_options(-msimd128)
endif()
if(CLR_CMAKE_TARGET_WASI)
add_compile_options(-fexceptions)
# Native wasm exceptions: sjlj cannot handle the interpreter's
# ResumeAfterCatch (throw-from-catch). -wasm-use-legacy-eh=false
# selects the new try_table/throw_ref proposal that wasmtime 45+
# supports natively; legacy would require --legacy-exceptions.
add_compile_options(-fwasm-exceptions)
add_compile_options(-mllvm -wasm-use-legacy-eh=false)

# Suppress CMake's default -lstdc++; wasi-sdk has libc++ only and
# we link the eh-flavored variant explicitly below.
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "" CACHE STRING "" FORCE)
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)

add_link_options(-fwasm-exceptions)
add_link_options(-mllvm -wasm-use-legacy-eh=false)
add_link_options(-Wno-unused-command-line-argument)
add_link_options(-Wl,--error-limit=0)

add_link_options(-lc)
add_link_options(-lc++)
add_link_options(-lc++abi)
add_link_options(-lunwind)
add_link_options(-ldl)

# WASI emulated libc helpers the CoreCLR PAL pulls in.
add_link_options(-lwasi-emulated-process-clocks)
add_link_options(-lwasi-emulated-signal)
add_link_options(-lwasi-emulated-mman)
add_link_options(-lwasi-emulated-getpid)
endif()
endif()
endif()
Expand Down
11 changes: 9 additions & 2 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,8 @@ function(install_clr)

foreach(destination ${destinations})
# CMake bug with executable WASM outputs - https://gitlab.kitware.com/cmake/cmake/-/issues/20745
if (CLR_CMAKE_TARGET_ARCH_WASM AND "${targetType}" STREQUAL "EXECUTABLE")
# Use install FILES since these are WASM assets that aren't executable.
if (CLR_CMAKE_TARGET_BROWSER AND "${targetType}" STREQUAL "EXECUTABLE")
# Emscripten produces a .js + .wasm pair; install both as data files.
install(FILES
"$<TARGET_FILE_DIR:${targetName}>/${targetName}.js"
"$<TARGET_FILE_DIR:${targetName}>/${targetName}.wasm"
Expand All @@ -580,6 +580,13 @@ function(install_clr)
endif()
"
COMPONENT ${INSTALL_CLR_COMPONENT} ${INSTALL_CLR_OPTIONAL})
elseif (CLR_CMAKE_TARGET_WASI AND "${targetType}" STREQUAL "EXECUTABLE")
# wasi-sdk produces a single .wasm binary (the executable itself, no
# extension). Install it as a data file — making it PROGRAMS would
# require execute permission on a wasm file which the host runtime
# (wasmtime) doesn't need.
install(FILES $<TARGET_FILE:${targetName}>
DESTINATION ${destination} COMPONENT ${INSTALL_CLR_COMPONENT} ${INSTALL_CLR_OPTIONAL})
else()
# We don't need to install the export libraries for our DLLs
# since they won't be directly linked against.
Expand Down
38 changes: 38 additions & 0 deletions eng/pipelines/common/templates/wasi-wasm-coreclr-build-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
parameters:
condition: false
extraBuildArgs: ''
isExtraPlatformsBuild: false
nameSuffix: ''
platforms: []
publishArtifactsForWorkload: false

jobs:

#
# Build CoreCLR + libraries for WASI (wasm32-wasi).
#
# Produces a runtime pack + corerun.wasm artifact under
# wasi.wasm.Release. The companion pipeline that actually runs the
# src/tests CoreCLR runtime tests on Helix under wasmtime lives in
# wasi-wasm-coreclr-runtime-tests.yml (the 'wasi_wasm' Helix queue is
# already mapped to the ubuntu-26.04-helix-webassembly-amd64 image,
# which ships wasmtime — see eng/pipelines/libraries/helix-queues-setup.yml).
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: Release
runtimeFlavor: CoreCLR
platforms: ${{ parameters.platforms }}
jobParameters:
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
testGroup: innerloop
nameSuffix: CoreCLR${{ parameters.nameSuffix }}_BuildOnly
buildArgs: -s clr+libs+packs -c $(_BuildConfig) ${{ parameters.extraBuildArgs }} /p:TestAssemblies=false
timeoutInMinutes: 120
condition: ${{ parameters.condition }}
postBuildSteps:
- template: /eng/pipelines/common/wasm-post-build-steps.yml
parameters:
publishArtifactsForWorkload: ${{ parameters.publishArtifactsForWorkload }}
publishWBT: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
parameters:
alwaysRun: false
isExtraPlatformsBuild: false
isWasmOnlyBuild: false
platforms: []
extraBuildArgs: ''

jobs:

#
# Build CoreCLR + libraries for WASI and run a subset of src/tests on
# Helix under wasmtime. Mirrors wasm-runtime-tests.yml (Mono variant),
# with runtimeFlavor=coreclr and a curated -tree: subset (see
# src/coreclr/wasi/tests/README.md).
#
# Merged-runner mode; xharness dispatches via helixpublishwitharcade.proj.
# Reuses the wasi_wasm helix queue (ubuntu-26.04-helix-webassembly-amd64).
#

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: coreclr
platforms: ${{ parameters.platforms }}
variables:
- name: alwaysRunVar
value: ${{ parameters.alwaysRun }}
- name: timeoutPerTestInMinutes
value: 10
- name: timeoutPerTestCollectionInMinutes
value: 200
- name: shouldRunOnDefaultPipelines
value: $[
or(
eq(variables['wasmDarcDependenciesChanged'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_coreclr_runtimetests.containsChange'], true))
]
jobParameters:
testGroup: innerloop
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
nameSuffix: CoreCLR_WASI_RuntimeTests
buildArgs: -s clr+libs+packs -c $(_BuildConfig) ${{ parameters.extraBuildArgs }} /p:TestAssemblies=false
timeoutInMinutes: 180
condition: >-
or(
eq(variables['alwaysRunVar'], true),
eq(variables['isDefaultPipeline'], variables['shouldRunOnDefaultPipelines']))
postBuildSteps:
- template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
parameters:
creator: dotnet-bot
testRunNamePrefixSuffix: CoreCLR_WASI_$(_BuildConfig)
# Curated test-tree subset -- expand as gates stabilize.
testBuildArgs: >-
-priority1
-tree:JIT/CodeGenBringUpTests
-tree:JIT/Generics
-tree:JIT/Directed
-tree:JIT/opt
-tree:JIT/jit64
-tree:Loader
-tree:Exceptions
-tree:reflection
extraVariablesTemplates:
- template: /eng/pipelines/common/templates/runtimes/test-variables.yml
23 changes: 23 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,29 @@ extends:
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true),
eq(variables['isRollingBuild'], true))

# Release build of wasi wasm for CoreCLR (build-only — the
# runtime tests run in a separate job dispatched to Helix from
# wasi-wasm-coreclr-runtime-tests.yml below).
- template: /eng/pipelines/common/templates/wasi-wasm-coreclr-build-only.yml
parameters:
platforms:
- wasi_wasm
publishArtifactsForWorkload: true
condition: >-
or(
eq(variables['wasmDarcDependenciesChanged'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_coreclr_runtimetests.containsChange'], true),
eq(variables['isRollingBuild'], true))

# CoreCLR src/tests subset run on wasmtime via Helix
# (wasi_wasm queue -> ubuntu-26.04-helix-webassembly-amd64 image).
- template: /eng/pipelines/common/templates/wasi-wasm-coreclr-runtime-tests.yml
parameters:
platforms:
- wasi_wasm
alwaysRun: ${{ variables.isRollingBuild }}

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
Expand Down
29 changes: 26 additions & 3 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,28 @@ if(CORECLR_SET_RPATH)
set(MACOSX_RPATH ON)
endif(CORECLR_SET_RPATH)

if(CLR_CMAKE_HOST_MACCATALYST OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS OR CLR_CMAKE_HOST_BROWSER OR CLR_CMAKE_HOST_ANDROID)
if(CLR_CMAKE_HOST_MACCATALYST OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS OR CLR_CMAKE_HOST_BROWSER OR CLR_CMAKE_HOST_WASI OR CLR_CMAKE_HOST_ANDROID)
set(FEATURE_STANDALONE_GC 0)
endif()

if(CLR_CMAKE_TARGET_WASI)
add_compile_definitions(_WASI_EMULATED_SIGNAL)
add_compile_definitions(_WASI_EMULATED_PROCESS_CLOCKS)
add_compile_definitions(_WASI_EMULATED_MMAN)
add_compile_definitions(_WASI_EMULATED_GETPID)
# EventPipe / diag-server PAL require sockets we have not validated
# for the WASI bring-up; revisit once corerun.wasm runs.
set(FEATURE_EVENT_TRACE 0)
set(FEATURE_PERFTRACING 0)
include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/pal/src/include/pal/wasi)
# Cross-compile try_run() answers — wasm32 binaries cannot execute on
# the build host, so pre-seed the cache.
set(REALPATH_SUPPORTS_NONEXISTENT_FILES_EXITCODE 1 CACHE STRING "" FORCE)
set(HAVE_WORKING_GETTIMEOFDAY_EXITCODE 0 CACHE STRING "" FORCE)
set(HAVE_WORKING_CLOCK_GETTIME_EXITCODE 0 CACHE STRING "" FORCE)
set(HAVE_PROCFS_STATM_EXITCODE 1 CACHE STRING "" FORCE)
endif()

OPTION(CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF)

#----------------------------------------------------
Expand Down Expand Up @@ -84,6 +102,11 @@ if(NOT CLR_CROSS_COMPONENTS_BUILD)
set(STATIC_LIB_DESTINATION ${CMAKE_BINARY_DIR}/libs-native)
set(CORERUN_LIBS_ONLY 1)
endif()
if(CLR_CMAKE_TARGET_WASI)
# Side-build libs to avoid collision with the published libs.native artifact.
set(STATIC_LIB_DESTINATION ${CMAKE_BINARY_DIR}/libs-native)
set(CORERUN_LIBS_ONLY 1)
endif()
add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native)
endif()

Expand Down Expand Up @@ -119,7 +142,7 @@ endif()
#----------------------------------------------------
# Build the test watchdog alongside the CLR
#----------------------------------------------------
if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS AND NOT CLR_CMAKE_TARGET_BROWSER)
if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS AND NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI)
add_subdirectory("${CLR_SRC_NATIVE_DIR}/watchdog" test-watchdog)
endif()

Expand Down Expand Up @@ -149,7 +172,7 @@ endif()
include_directories("pal/prebuilt/inc")
include_directories(${CLR_ARTIFACTS_OBJ_DIR})

if (NOT CLR_CMAKE_TARGET_BROWSER OR CLR_CROSS_COMPONENTS_BUILD)
if ((NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI) OR CLR_CROSS_COMPONENTS_BUILD)
add_subdirectory(tools/aot/jitinterface)
endif ()

Expand Down
Loading
Loading