Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion eng/testing/FindWasmHostExecutable.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if exist "%__WasmBinaryPathWithoutExtension%.js" (

if "%__WasmBinaryExtension%" == ".wasm" (
:: Assume wasmtime is in PATH.
set WASM_HOST_EXECUTABLE=wasmtime run -S http
set WASM_HOST_EXECUTABLE=wasmtime run -S http --dir=.
) else (
if "%NODEJS_EXECUTABLE%" == "" (
:: When running tests locally, assume NodeJS is in PATH.
Expand Down
2 changes: 1 addition & 1 deletion eng/testing/FindWasmHostExecutable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ elif [ -e "${dirname}/main.mjs" ]; then
WASM_HOST_EXECUTABLE=$node
WASM_BINARY_TO_EXECUTE="${dirname}/main.mjs"
elif [ -e "${dirname}/${exename}.wasm" ]; then
WASM_HOST_EXECUTABLE="wasmtime run -S http"
WASM_HOST_EXECUTABLE="wasmtime run -S http --dir=."
WASM_BINARY_TO_EXECUTE="${dirname}/${exename}.wasm"
fi
1 change: 1 addition & 0 deletions eng/testing/tests.singlefile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

<PropertyGroup Condition="'$(PublishSingleFile)' == 'true' or '$(TestNativeAot)' == 'true'">
<DefineConstants>$(DefineConstants);SINGLE_FILE_TEST_RUNNER</DefineConstants>
<DefineConstants Condition="'$(TargetsWasi)' == 'true'">$(DefineConstants);TARGET_WASI</DefineConstants> <!-- Used by WasmTestRunner.cs -->
</PropertyGroup>

<PropertyGroup Condition="'$(TestReadyToRun)' == 'true'">
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/Common/tests/Tests/System/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7719,8 +7719,8 @@ public static void InternTestCanReturnNull()
Assert.False(s.IsNormalized(NormalizationForm.FormC), "String should be not normalized when checking with FormC");
Assert.False(s.IsNormalized(NormalizationForm.FormD), "String should be not normalized when checking with FormD");

// Browser's, iOS's, MacCatalyst's, and tvOS's ICU do not support FormKC and FormKD
bool supportsKCKD = !PlatformDetection.IsBrowser && !PlatformDetection.IsiOS && !PlatformDetection.IsMacCatalyst && !PlatformDetection.IstvOS;
// Some platforms' ICUs do not support FormKC and FormKD
bool supportsKCKD = !PlatformDetection.IsBrowser && !PlatformDetection.IsWasi && !PlatformDetection.IsiOS && !PlatformDetection.IsMacCatalyst && !PlatformDetection.IstvOS;

if (supportsKCKD)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi</TargetFrameworks>
<DefineConstants Condition="'$(TargetOS)' == 'browser'">$(DefineConstants);TARGET_BROWSER</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- TODO-LLVM: investigate the need for IL3051, maybe it can just be removed when more of upstream is merged -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace System.Tests
{
public static class ArgIteratorTests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/39343", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39343", TestPlatforms.Browser | TestPlatforms.Wasi)]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsArgIteratorSupported))]
public static void ArgIterator_GetRemainingCount_GetNextArg()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace System.Threading.Tests
{
[ActiveIssue("https://github.com/dotnet/runtimelab/issues/2505", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsWasm))]
[ActiveIssue("https://github.com/dotnet/runtimelab/issues/2505", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsBrowser))]
public class PeriodicTimerTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static TimeZoneInfoTests()
// Name abbreviations, if available, are used instead
public static IEnumerable<object[]> Platform_TimeZoneNamesTestData()
{
if (PlatformDetection.IsBrowser || (PlatformDetection.IsNotHybridGlobalizationOnApplePlatform && (PlatformDetection.IsMacCatalyst || PlatformDetection.IsiOS || PlatformDetection.IstvOS)))
if (PlatformDetection.IsBrowser || PlatformDetection.IsWasi)
return new TheoryData<TimeZoneInfo, string, string, string, string, string>
{
{ TimeZoneInfo.FindSystemTimeZoneById(s_strPacific), "(UTC-08:00) America/Los_Angeles", null, "PST", "PDT", null },
Expand Down Expand Up @@ -2051,9 +2051,9 @@ public static void TimeZoneDisplayNames_Unix(TimeZoneInfo timeZone)
{
bool isUtc = s_UtcAliases.Contains(timeZone.Id, StringComparer.OrdinalIgnoreCase);

if (PlatformDetection.IsBrowser)
if (PlatformDetection.IsBrowser || PlatformDetection.IsWasi)
{
// Browser platform doesn't have full ICU names, but uses the IANA IDs and abbreviations instead.
// WASM platforms don't have full ICU names, but use the IANA IDs and abbreviations instead.

// The display name will be the offset plus the ID.
// The offset is checked separately in TimeZoneInfo_DisplayNameStartsWithOffset
Expand Down Expand Up @@ -2425,7 +2425,7 @@ public static IEnumerable<object[]> AlternativeName_TestData()
}
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser), nameof(PlatformDetection.IsNotWasi))]
[MemberData(nameof(AlternativeName_TestData))]
public static void UsingAlternativeTimeZoneIdsTest(string windowsId, string ianaId)
{
Expand Down
3 changes: 1 addition & 2 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,7 @@
<SmokeTestProject Remove="@(SmokeTestProject)" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Collections.Specialized\tests\System.Collections.Specialized.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Diagnostics.StackTrace\tests\System.Diagnostics.StackTrace.Tests.csproj" />
<!-- S.R.Tests aren't yet passing upstream on WASI. -->
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj" Condition="'$(TargetsBrowser)' == 'true'" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'browser' and '$(WasmEnableThreads)' == 'true'">
Expand Down
2 changes: 0 additions & 2 deletions src/mono/wasi/build/WasiApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@
<_WasiLinkStepArgs Condition="'$(OS)' == 'Windows_NT'" Include="&quot;$([System.String]::new(%(_WasiFilePathForFixup.Identity)).Replace('\', '/'))&quot;" />
<_WasiLinkStepArgs Condition="'$(OS)' != 'Windows_NT'" Include="@(_WasiFilePathForFixup -> '&quot;%(Identity)&quot;')" />

<_WasiLinkStepArgs Include="-Wl,--export=malloc,--export=free,--export=__heap_base,--export=__data_end" />
<!-- keep in sync with src\mono\wasi\wasi.proj -->
<!-- keep in sync with src\native\libs\CMakeLists.txt -->
<_WasiLinkStepArgs Include="-Wl,-z,stack-size=8388608,-lwasi-emulated-process-clocks,-lwasi-emulated-signal,-lwasi-emulated-mman,-lwasi-emulated-pthread"/>
<!--
this together with some DLLImports makes dependency on wasi:[email protected]
Expand Down
1 change: 0 additions & 1 deletion src/mono/wasi/wasi.proj
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
<_WasiCompileFlags Include="-D_WASI_EMULATED_MMAN"/>
<_WasiCompileFlags Include="-D_WASI_EMULATED_PTHREAD"/>
<!-- keep in sync with src\mono\wasi\build\WasiApp.targets -->
<!-- keep in sync with src\native\libs\CMakeLists.txt -->
<_WasiLinkFlags Include="-Wl,-z,stack-size=8388608,--initial-memory=52428800,-lwasi-emulated-process-clocks,-lwasi-emulated-signal,-lwasi-emulated-mman,-lwasi-emulated-pthread"/>
</ItemGroup>

Expand Down
4 changes: 0 additions & 4 deletions src/native/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,13 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)

if (CLR_CMAKE_TARGET_WASI)
set(HOST_WASI 1)
add_compile_options(-Wno-unused-variable)
add_compile_options(-Wno-unused-parameter)
add_compile_options(-Wno-gnu-statement-expression)
add_compile_options(-DHOST_WASI)
add_compile_options(-D_WASI_EMULATED_PROCESS_CLOCKS)
add_compile_options(-D_WASI_EMULATED_SIGNAL)
add_compile_options(-D_WASI_EMULATED_MMAN)
add_compile_options(-D_WASI_EMULATED_PTHREAD)
# keep in sync with src\mono\wasi\build\WasiApp.targets
# keep in sync with src\mono\wasi\wasi.proj
add_link_options(-Wl,-z,stack-size=1048576,--initial-memory=5242880,--max-memory=52428800,-lwasi-emulated-process-clocks,-lwasi-emulated-signal,-lwasi-emulated-mman,-lwasi-emulated-pthread)
endif ()

if (CLR_CMAKE_TARGET_ANDROID)
Expand Down
Loading