Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasi][draft] build WASI #77823

Closed
wants to merge 142 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
6156bbb
wip
pavelsavara Nov 7, 2022
4246b37
wip
pavelsavara Nov 7, 2022
7990008
wip
pavelsavara Nov 7, 2022
b0068e0
wip
pavelsavara Nov 7, 2022
3e66f94
wip
pavelsavara Nov 7, 2022
31758b4
wip
pavelsavara Nov 7, 2022
013852f
wip
pavelsavara Nov 8, 2022
3783bcf
wip
pavelsavara Nov 8, 2022
b304cb5
wip
pavelsavara Nov 8, 2022
aa93b6f
wip
pavelsavara Nov 8, 2022
e6933d9
wip
pavelsavara Nov 8, 2022
6cc9bd1
wip
pavelsavara Nov 8, 2022
d151e07
Merge branch 'main' into wasi_build
pavelsavara Nov 8, 2022
709f54e
wip
pavelsavara Nov 8, 2022
0f35f0e
wip
pavelsavara Nov 8, 2022
1f0cb14
wip
pavelsavara Nov 8, 2022
2b596af
wip
pavelsavara Nov 8, 2022
cf1bf9d
wip
pavelsavara Nov 8, 2022
f22c691
wip
pavelsavara Nov 8, 2022
198f795
Merge branch 'wasi3' into wasi_build
pavelsavara Nov 8, 2022
ace97ff
wip
pavelsavara Nov 8, 2022
4acbcae
Merge branch 'main' into wasi_build
pavelsavara Nov 8, 2022
ea5db87
wip
pavelsavara Nov 8, 2022
318ef0f
wip
pavelsavara Nov 8, 2022
e785d9e
wip
pavelsavara Nov 9, 2022
357c978
wip
pavelsavara Nov 9, 2022
4b4a8b0
wip
pavelsavara Nov 9, 2022
5ccf1a4
dummy libs
pavelsavara Nov 10, 2022
f615318
wip
pavelsavara Nov 10, 2022
dd57088
wip
pavelsavara Nov 10, 2022
98f1822
wip
pavelsavara Nov 10, 2022
69643bf
wip
pavelsavara Nov 11, 2022
c6d9994
wip
pavelsavara Nov 11, 2022
ca0fd7c
Merge branch 'main' into wasi_build
pavelsavara Nov 11, 2022
ac0d4e4
wip
pavelsavara Nov 11, 2022
9fb6f47
wip
pavelsavara Nov 11, 2022
ac080a1
sample
pavelsavara Nov 11, 2022
6c84aa5
wip
pavelsavara Nov 11, 2022
c568914
wip
pavelsavara Nov 11, 2022
5909707
wip
pavelsavara Nov 11, 2022
71bbaed
wip
pavelsavara Nov 11, 2022
d396455
Merge remote-tracking branch 'pavelsavara/wasi_build' into wasi_build…
mkhamoyan Nov 14, 2022
fc47c61
Added WasmtimeURL for macos and updated WasiSdkUrl
mkhamoyan Nov 14, 2022
260e801
wip
pavelsavara Nov 14, 2022
9cd708b
Merge branch 'main' into wasi_build
pavelsavara Nov 14, 2022
5a85971
Merge remote-tracking branch 'pavelsavara/wasi_build' into wasi_build…
mkhamoyan Nov 14, 2022
6f846ef
Merge pull request #4 from mkhamoyan/wasi_build_macos
pavelsavara Nov 14, 2022
888e899
wip
pavelsavara Nov 14, 2022
9e23285
wip
pavelsavara Nov 14, 2022
c43a183
iwp
pavelsavara Nov 14, 2022
92e05ed
Merge branch 'wasi_build' of https://github.com/pavelsavara/runtime i…
pavelsavara Nov 14, 2022
1a4e208
wip
pavelsavara Nov 14, 2022
307c7a7
wip
pavelsavara Nov 14, 2022
d9f2dd2
hello world
pavelsavara Nov 14, 2022
76efd0f
fix
pavelsavara Nov 15, 2022
7bbd5ee
new RID: wasi-wasm
pavelsavara Nov 15, 2022
9f673b5
fix
pavelsavara Nov 15, 2022
be7d9d1
feedback
pavelsavara Nov 15, 2022
db527c5
uper case WASI feedback
pavelsavara Nov 15, 2022
a79a071
uper case WASI
pavelsavara Nov 15, 2022
7354ffb
Merge branch 'main' into wasi_build
pavelsavara Nov 15, 2022
deae640
Merge branch 'wasm_rid' into wasi_build
pavelsavara Nov 15, 2022
1f7d3e9
Update eng/native/configurecompiler.cmake
pavelsavara Nov 15, 2022
d2315b3
Update src/tests/Common/XUnitWrapperGenerator/TestPlatforms.cs
pavelsavara Nov 15, 2022
cbf8a6c
feedback
pavelsavara Nov 15, 2022
f137e11
fix
pavelsavara Nov 15, 2022
b48bde4
feedback
pavelsavara Nov 15, 2022
99daf3f
script feedback
pavelsavara Nov 15, 2022
029e7fe
Update eng/build.ps1
pavelsavara Nov 15, 2022
98f827e
Update src/coreclr/scripts/coreclr_arguments.py
pavelsavara Nov 15, 2022
e2bbaf0
feedback
pavelsavara Nov 15, 2022
e57f0ad
feedback
pavelsavara Nov 15, 2022
d94b4c3
fix
pavelsavara Nov 15, 2022
e32f56d
wip
pavelsavara Nov 15, 2022
f8def32
feedback
pavelsavara Nov 15, 2022
18b2dfc
pal_threading.c: Use abort() at end of the function, to silence the c…
radical Nov 15, 2022
c54a0fc
fix
pavelsavara Nov 15, 2022
db80a04
Merge branch 'wasm_rid' into wasi_build
pavelsavara Nov 15, 2022
9458a73
Merge remote-tracking branch 'origin/main' into wasi_build
radical Nov 16, 2022
cfa0437
wip
radical Nov 16, 2022
b5e0ea9
wip
radical Nov 16, 2022
d2bc2d5
wip
radical Nov 16, 2022
730ca8b
Merge branch 'main' into wasm_rid
pavelsavara Nov 16, 2022
f79c311
lower case wasi
pavelsavara Nov 16, 2022
e5c416d
case
pavelsavara Nov 16, 2022
acdc4cf
Merge branch 'wasm_rid' into wasi_build
pavelsavara Nov 16, 2022
e7d887b
Merge branch 'pavel-wasi_build' into wasi_build
pavelsavara Nov 16, 2022
b64750c
fix
pavelsavara Nov 16, 2022
bdb1418
Merge branch 'main' into wasm_rid
pavelsavara Nov 16, 2022
c8bf7b7
Merge branch 'wasm_rid' into wasi_build
pavelsavara Nov 16, 2022
bc7f691
wip
pavelsavara Nov 16, 2022
3e560f3
Update eng/build.sh
pavelsavara Nov 16, 2022
9db9d12
Update Directory.Build.props
pavelsavara Nov 16, 2022
f968e7d
Update eng/native/build-commons.sh
pavelsavara Nov 16, 2022
7fb65a9
Update src/libraries/System.Private.CoreLib/src/System.Private.CoreLi…
pavelsavara Nov 16, 2022
b8591f2
Update eng/native/gen-buildsys.cmd
pavelsavara Nov 16, 2022
69fdb03
Update eng/native/gen-buildsys.cmd
pavelsavara Nov 16, 2022
87b2d35
Update src/coreclr/scripts/coreclr_arguments.py
pavelsavara Nov 16, 2022
bbed97d
Update src/native/libs/build-native.sh
pavelsavara Nov 16, 2022
0828301
fix
pavelsavara Nov 16, 2022
cca0220
Merge branch 'wasm_rid' into wasi_build
pavelsavara Nov 16, 2022
7a058df
case
pavelsavara Nov 16, 2022
5eb412d
fix
pavelsavara Nov 16, 2022
7b16a30
Merge branch 'wasm_rid' into wasi_build
pavelsavara Nov 16, 2022
5aca392
wip
pavelsavara Nov 16, 2022
ab59ee3
wip
pavelsavara Nov 16, 2022
954df8a
Merge branch 'main' into wasi_build
pavelsavara Nov 16, 2022
e48915b
wip
pavelsavara Nov 16, 2022
cbd4f96
wip
pavelsavara Nov 16, 2022
ff3575e
wip
pavelsavara Nov 16, 2022
e71c206
wip
pavelsavara Nov 16, 2022
8a361b2
wip
pavelsavara Nov 16, 2022
da6a0fc
UnsupportedOSPlatformAttribute
pavelsavara Nov 16, 2022
28a064b
wip
pavelsavara Nov 16, 2022
9955c07
wip
pavelsavara Nov 16, 2022
33a62d1
wip
pavelsavara Nov 16, 2022
f9ef2f9
pal_mount.c
pavelsavara Nov 18, 2022
3b36bf8
pal_process.c
pavelsavara Nov 18, 2022
f8e0a77
pal_threading.c
pavelsavara Nov 18, 2022
1265ae1
pal_uid.c
pavelsavara Nov 18, 2022
acc7b1a
pal_signal.c
pavelsavara Nov 18, 2022
0078da9
pal_io.c
pavelsavara Nov 18, 2022
bdd5399
pal_dynamicload.c
pavelsavara Nov 18, 2022
8ba9b1e
pal_console.c
pavelsavara Nov 18, 2022
26418e3
pal_networking.c
pavelsavara Nov 18, 2022
52fc57a
fix
pavelsavara Nov 21, 2022
173ce09
Merge branch 'main' into wasi_build
pavelsavara Nov 22, 2022
3ac17c7
provision windows
pavelsavara Nov 22, 2022
2ae615f
wip
pavelsavara Nov 22, 2022
2fd6d22
wip on windows
pavelsavara Nov 22, 2022
5d6c6c7
from @radical
pavelsavara Nov 23, 2022
dc1a732
Merge branch 'main' into wasi_build
pavelsavara Nov 23, 2022
f3c3e06
browser container image
pavelsavara Nov 23, 2022
e5a2cb4
windows build
pavelsavara Nov 23, 2022
753ca35
windows run
pavelsavara Nov 23, 2022
5498e41
fix case sensitive wasi os
pavelsavara Nov 23, 2022
b6b57d6
Merge branch 'main' into wasi_build
pavelsavara Nov 23, 2022
c7fefaa
fix wasmtime provisioning on unix
pavelsavara Nov 24, 2022
58fe6e2
Merge branch 'main' into wasi_build
radical Nov 29, 2022
a97a4b7
Update pal_dynamicload.c
radical Nov 29, 2022
0923b99
fix windows paths
pavelsavara Nov 29, 2022
4925408
Merge branch 'main' into wasi_build
pavelsavara Nov 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 's390x'">s390x</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'ppc64le'">ppc64le</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and ('$(TargetOS)' == 'Browser' or '$(RuntimeIdentifier)' == 'browser-wasm')">wasm</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and ('$(TargetOS)' == 'wasi' or '$(RuntimeIdentifier)' == 'wasi-wasm')">wasm</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetsMobile)' == 'true'">x64</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
<Platform Condition="'$(Platform)' == '' and '$(InferPlatformFromTargetArchitecture)' == 'true'">$(TargetArchitecture)</Platform>
Expand Down Expand Up @@ -118,6 +119,8 @@
<TestExclusionListTasksAssemblyPath>$([MSBuild]::NormalizePath('$(TestExclusionListTasksDir)', 'TestExclusionListTasks.dll'))</TestExclusionListTasksAssemblyPath>
<CoreCLRToolPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'coreclr', '$(TargetOS).$(TargetArchitecture).$(Configuration)'))</CoreCLRToolPath>
<ILAsmToolPath Condition="'$(DotNetBuildFromSource)' == 'true' or '$(BuildArchitecture)' == 's390x' or '$(BuildArchitecture)' == 'ppc64le'">$(CoreCLRToolPath)</ILAsmToolPath>

<WasmtimeDir>$([MSBuild]::NormalizeDirectory($(ArtifactsBinDir), 'wasmtime'))</WasmtimeDir>
</PropertyGroup>

<PropertyGroup Label="CalculateConfiguration">
Expand Down
4 changes: 4 additions & 0 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ if ($PSBoundParameters.ContainsKey('os') -and $PSBoundParameters['os'] -eq "Brow
# make sure it is capitalized
$PSBoundParameters['os'] = "Browser"
}
if ($PSBoundParameters.ContainsKey('os') -and $PSBoundParameters['os'] -eq "wasi") {
# make sure it is not capitalized
$PSBoundParameters['os'] = "wasi"
}

foreach ($argument in $PSBoundParameters.Keys)
{
Expand Down
6 changes: 3 additions & 3 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ elseif (CLR_CMAKE_HOST_UNIX)
endif ()
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)

if(CLR_CMAKE_HOST_BROWSER)
if(CLR_CMAKE_HOST_BROWSER OR CLR_CMAKE_HOST_WASI)
# The emscripten build has additional warnings so -Werror breaks
add_compile_options(-Wno-unused-parameter)
add_compile_options(-Wno-alloca)
Expand Down Expand Up @@ -391,7 +391,7 @@ if (CLR_CMAKE_HOST_UNIX)
add_definitions(-DLSE_INSTRUCTIONS_ENABLED_BY_DEFAULT)
add_compile_options(-mcpu=apple-m1)
endif(CLR_CMAKE_HOST_UNIX_ARM64)
elseif(NOT CLR_CMAKE_HOST_BROWSER)
elseif(NOT CLR_CMAKE_HOST_BROWSER AND NOT CLR_CMAKE_HOST_WASI)
check_c_compiler_flag(-fstack-protector-strong COMPILER_SUPPORTS_F_STACK_PROTECTOR_STRONG)
if (COMPILER_SUPPORTS_F_STACK_PROTECTOR_STRONG)
add_compile_options(-fstack-protector-strong)
Expand Down Expand Up @@ -793,7 +793,7 @@ if (CLR_CMAKE_HOST_WIN32)
message(FATAL_ERROR "MC not found")
endif()

elseif (NOT CLR_CMAKE_HOST_BROWSER)
elseif (NOT CLR_CMAKE_HOST_BROWSER AND NOT CLR_CMAKE_HOST_WASI)
# This is a workaround for upstream issue: https://gitlab.kitware.com/cmake/cmake/-/issues/22995.
#
# In Clang.cmake, the decision to use single or double hyphen for target and gcc-toolchain
Expand Down
12 changes: 6 additions & 6 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ if(CLR_CMAKE_HOST_OS STREQUAL Emscripten)
set(CLR_CMAKE_HOST_BROWSER 1)
endif(CLR_CMAKE_HOST_OS STREQUAL Emscripten)

if(CLR_CMAKE_TARGET_OS STREQUAL Wasi)
if(CLR_CMAKE_TARGET_OS STREQUAL WASI)
set(CLR_CMAKE_HOST_WASI 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL Wasi)
endif(CLR_CMAKE_TARGET_OS STREQUAL WASI)

#--------------------------------------------
# This repo builds two set of binaries
Expand Down Expand Up @@ -417,9 +417,9 @@ if(CLR_CMAKE_TARGET_OS STREQUAL Emscripten)
set(CLR_CMAKE_TARGET_BROWSER 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL Emscripten)

if(CLR_CMAKE_TARGET_OS STREQUAL Wasi)
if(CLR_CMAKE_TARGET_OS STREQUAL WASI)
set(CLR_CMAKE_TARGET_WASI 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL Wasi)
endif(CLR_CMAKE_TARGET_OS STREQUAL WASI)

if(CLR_CMAKE_TARGET_UNIX)
if(CLR_CMAKE_TARGET_ARCH STREQUAL x64)
Expand Down Expand Up @@ -454,7 +454,7 @@ else()
endif(CLR_CMAKE_TARGET_UNIX)

# check if host & target os/arch combination are valid
if (NOT (CLR_CMAKE_TARGET_OS STREQUAL CLR_CMAKE_HOST_OS))
if (NOT (CLR_CMAKE_TARGET_OS STREQUAL CLR_CMAKE_HOST_OS) AND NOT CLR_CMAKE_TARGET_WASI)
if(NOT (CLR_CMAKE_HOST_OS STREQUAL windows))
message(FATAL_ERROR "Invalid host and target os/arch combination. Host OS: ${CLR_CMAKE_HOST_OS}")
endif()
Expand All @@ -466,7 +466,7 @@ if (NOT (CLR_CMAKE_TARGET_OS STREQUAL CLR_CMAKE_HOST_OS))
endif()
endif()

if(NOT CLR_CMAKE_TARGET_BROWSER)
if(NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI)
# The default linker on Solaris also does not support PIE.
if(NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_SUNOS AND NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_HOST_TVOS AND NOT CLR_CMAKE_HOST_IOS AND NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
Expand Down
2 changes: 1 addition & 1 deletion eng/native/configuretools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (CMAKE_C_COMPILER MATCHES "-?[0-9]+(\.[0-9]+)?$")
set(CLR_CMAKE_COMPILER_FILE_NAME_VERSION "${CMAKE_MATCH_0}")
endif()

if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER)
if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(APPLE)
set(TOOLSET_PREFIX "")
Expand Down
17 changes: 13 additions & 4 deletions eng/native/gen-buildsys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,30 @@ if /i "%__Arch%" == "wasm" (
)
if /i "%__Os%" == "Browser" (
if "%EMSDK_PATH%" == "" (
if not exist "%__repoRoot%src\mono\wasm\emsdk" (
if not exist "%__repoRoot%\src\mono\wasm\emsdk" (
echo Error: Should set EMSDK_PATH environment variable pointing to emsdk root.
exit /B 1
)

set EMSDK_PATH=%__repoRoot%src\mono\wasm\emsdk
set EMSDK_PATH=%__repoRoot%\src\mono\wasm\emsdk
set EMSDK_PATH=!EMSDK_PATH:\=/!
)

set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_TOOLCHAIN_FILE=!EMSDK_PATH!/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
set __UseEmcmake=1
)
if /i "%__Os%" == "wasi" (
echo Error: WASI build not implemented on Windows yet
exit /B 1
if "%WASI_SDK_PATH%" == "" (
if not exist "%__repoRoot%\src\mono\wasi\wasi-sdk" (
echo Error: Should set WASI_SDK_PATH environment variable pointing to emsdk root.
exit /B 1
)

set WASI_SDK_PATH=%__repoRoot%src\mono\wasi\wasi-sdk
set WASI_SDK_PATH=!WASI_SDK_PATH:\=/!
)
set __CmakeGenerator=Ninja
set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=WASI -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!WASI_SDK_PATH!/share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=!WASI_SDK_PATH!/share/wasi-sysroot"
)
) else (
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_SYSTEM_VERSION=10.0"
Expand Down
21 changes: 21 additions & 0 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,27 @@ jobs:
crossBuild: true
${{ insert }}: ${{ parameters.jobParameters }}

# WASI WebAssembly

- ${{ if containsValue(parameters.platforms, 'wasi_wasm') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
osGroup: wasi
archType: wasm
targetRid: wasi-wasm
platform: wasi_wasm
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: Browser_wasm
jobParameters:
hostedOs: Linux
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ insert }}: ${{ parameters.jobParameters }}

# Browser WebAssembly

- ${{ if containsValue(parameters.platforms, 'Browser_wasm') }}:
Expand Down
49 changes: 49 additions & 0 deletions eng/pipelines/common/templates/wasi-build-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
parameters:
alwaysRun: false
extraBuildArgs: ''
isExtraPlatformsBuild: false
nameSuffix: ''
platforms: []

jobs:

#
# Build for WASI/wasm and test it
#
- 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: mono
platforms: ${{ parameters.platforms }}
variables:
# map dependencies variables to local variables
- name: alwaysRunVar
value: ${{ parameters.alwaysRun }}
- name: shouldRunOnDefaultPipelines
value: $[
or(
eq(variables['wasmDarcDependenciesChanged'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
and(
eq(dependencies.evaluate_paths.outputs['SetPathVars_wasm.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_non_runtimetests.containsChange'], true)),
eq(dependencies.evaluate_paths.outputs['SetPathVars_wasm_libraries.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true))
]
jobParameters:
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
testGroup: innerloop
nameSuffix: ${{ parameters.nameSuffix }}_BuildOnly
buildArgs: -s mono+libs+host -c $(_BuildConfig) /p:ArchiveTests=true ${{ parameters.extraBuildArgs }}
timeoutInMinutes: 240
# if !alwaysRun, then:
# if this is runtime-wasm (isWasmOnlyBuild):
# - then run only if it would not have run on default pipelines (based
# on path changes)
# - else run based on path changes
condition: >-
or(
eq(variables['alwaysRunVar'], true),
eq(variables['isDefaultPipeline'], variables['shouldRunOnDefaultPipelines']))
15 changes: 0 additions & 15 deletions eng/pipelines/common/templates/wasm-library-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,3 @@ jobs:
or(
eq(variables['alwaysRunVar'], true),
eq(variables['isDefaultPipeline'], variables['shouldRunOnDefaultPipelines']))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/common/templates/additional-steps-then-helix.yml
extraStepsParameters:
additionalSteps:
- ${{ if eq(parameters.buildAndRunWasi, true) }}:
- script: >-
make -C src/mono/wasi provision-deps all &&
make -C src/mono/wasi/sample/console run
name: build_wasi
displayName: Build WASI, and run a sample

creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) ${{ parameters.extraHelixArgs }}
scenarios: ${{ parameters.scenarios }}
2 changes: 1 addition & 1 deletion eng/targetingpacks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
LatestRuntimeFrameworkVersion="$(ProductVersion)"
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**"
RuntimePackRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-bionic-arm64;linux-loongarch64;linux-musl-x64;linux-bionic-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-bionic-arm64;linux-loongarch64;linux-musl-x64;linux-bionic-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;wasi-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackLabels="Mono"
Condition="'@(KnownRuntimePack)' == '' or !@(KnownRuntimePack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))"/>
<KnownAppHostPack Include="$(LocalFrameworkOverrideName)"
Expand Down
3 changes: 3 additions & 0 deletions eng/testing/wasi-provisioning.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)ProvisioningVersions.props" />
</Project>
6 changes: 6 additions & 0 deletions eng/versioning.targets
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
<PropertyGroup Condition="'$(TargetPlatformIdentifier)' == '' and !$(TargetFrameworks.Contains('$(TargetFramework)-Browser'))">
<CrossPlatformAndHasNoBrowserTarget>true</CrossPlatformAndHasNoBrowserTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetPlatformIdentifier)' == '' and !$(TargetFrameworks.Contains('$(TargetFramework)-wasi'))">
<CrossPlatformAndHasNoWasiTarget>true</CrossPlatformAndHasNoWasiTarget>
</PropertyGroup>

<!-- Enables warnings for Android, iOS, tvOS and macCatalyst for all builds -->
<ItemGroup>
Expand All @@ -78,6 +81,9 @@
<ItemGroup Condition="('$(TargetPlatformIdentifier)' == 'Browser' or '$(CrossPlatformAndHasNoBrowserTarget)' == 'true') and '$(IsTestProject)' != 'true'">
<SupportedPlatform Include="browser"/>
</ItemGroup>
<ItemGroup Condition="('$(TargetPlatformIdentifier)' == 'wasi' or '$(CrossPlatformAndHasNoWasiTarget)' == 'true') and '$(IsTestProject)' != 'true'">
<SupportedPlatform Include="wasi"/>
</ItemGroup>

<!-- Add target platforms into MSBuild SupportedPlatform list -->
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static bool IsEntered(object obj)
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool ObjWait(int millisecondsTimeout, object obj);

[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
public static bool Wait(object obj, int millisecondsTimeout)
{
if (obj == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static bool IsEntered(object obj)

#region Public Wait/Pulse methods

[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
public static bool Wait(object obj, int millisecondsTimeout)
{
Condition condition = GetCondition(obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace System.Threading
// Windows-specific implementation of ThreadPool
//
#if !FEATURE_WASM_THREADS
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser"), System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")]
#endif
public sealed class RegisteredWaitHandle : MarshalByRefObject
{
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/pal/src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
#cmakedefine01 HAS_SYSV_SEMAPHORES
#cmakedefine01 HAS_PTHREAD_MUTEXES
#cmakedefine HAVE_TTRACE
#cmakedefine01 HAVE_CHMOD
#cmakedefine01 HAVE_FCHMOD
#cmakedefine01 HAVE_PIPE
#cmakedefine01 HAVE_PIPE2
#cmakedefine01 HAVE_SCHED_GETAFFINITY
#cmakedefine01 HAVE_SCHED_SETAFFINITY
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/pal/src/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ check_function_exists(semget HAS_SYSV_SEMAPHORES)
check_function_exists(pthread_mutex_init HAS_PTHREAD_MUTEXES)
check_function_exists(ttrace HAVE_TTRACE)
check_function_exists(pipe2 HAVE_PIPE2)
check_function_exists(pipe HAVE_PIPE)
check_function_exists(chmod HAVE_CHMOD)
check_function_exists(fchmod HAVE_FCHMOD)

check_cxx_source_compiles("
#include <pthread_np.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed partial class DSAOpenSsl : DSA, IRuntimeAlgorithm
private Lazy<SafeDsaHandle>? _key;

[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("windows")]
Expand All @@ -35,7 +35,7 @@ public DSAOpenSsl()
}

[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("windows")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed partial class ECDiffieHellmanOpenSsl : ECDiffieHellman
private ECOpenSsl? _key;

[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("windows")]
Expand All @@ -24,7 +24,7 @@ public ECDiffieHellmanOpenSsl(ECCurve curve)
}

[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("windows")]
Expand All @@ -34,7 +34,7 @@ public ECDiffieHellmanOpenSsl()
}

[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("windows")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed partial class ECDsaOpenSsl : ECDsa, IRuntimeAlgorithm
/// <param name="curve">The <see cref="ECCurve"/> representing the curve.</param>
/// <exception cref="ArgumentNullException">if <paramref name="curve" /> is null.</exception>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("windows")]
Expand All @@ -38,7 +38,7 @@ public ECDsaOpenSsl(ECCurve curve)
/// Create an ECDsaOpenSsl algorithm with a random 521 bit key pair.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("windows")]
Expand All @@ -52,7 +52,7 @@ public ECDsaOpenSsl()
/// </summary>
/// <param name="keySize">Size of the key to generate, in bits.</param>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("browser")]
[UnsupportedOSPlatform("browser"), UnsupportedOSPlatform("wasi")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("windows")]
Expand Down
Loading