Skip to content

Commit 4044fde

Browse files
[WASI] Miscellaneous fixes (#119426)
1 parent 8395429 commit 4044fde

File tree

7 files changed

+8
-15
lines changed

7 files changed

+8
-15
lines changed

src/libraries/Common/tests/Tests/System/StringTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7719,8 +7719,8 @@ public static void InternTestCanReturnNull()
77197719
Assert.False(s.IsNormalized(NormalizationForm.FormC), "String should be not normalized when checking with FormC");
77207720
Assert.False(s.IsNormalized(NormalizationForm.FormD), "String should be not normalized when checking with FormD");
77217721

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

77257725
if (supportsKCKD)
77267726
{

src/libraries/System.Runtime/tests/System.Runtime.Tests/System.Runtime.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser</TargetFrameworks>
3+
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi</TargetFrameworks>
44
<DefineConstants Condition="'$(TargetOS)' == 'browser'">$(DefineConstants);TARGET_BROWSER</DefineConstants>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
<!-- TODO-LLVM: investigate the need for IL3051, maybe it can just be removed when more of upstream is merged -->

src/libraries/System.Runtime/tests/System.Runtime.Tests/System/ArgIteratorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace System.Tests
99
{
1010
public static class ArgIteratorTests
1111
{
12-
[ActiveIssue("https://github.com/dotnet/runtime/issues/39343", TestPlatforms.Browser)]
12+
[ActiveIssue("https://github.com/dotnet/runtime/issues/39343", TestPlatforms.Browser | TestPlatforms.Wasi)]
1313
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsArgIteratorSupported))]
1414
public static void ArgIterator_GetRemainingCount_GetNextArg()
1515
{

src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static TimeZoneInfoTests()
5757
// Name abbreviations, if available, are used instead
5858
public static IEnumerable<object[]> Platform_TimeZoneNamesTestData()
5959
{
60-
if (PlatformDetection.IsBrowser || (PlatformDetection.IsNotHybridGlobalizationOnApplePlatform && (PlatformDetection.IsMacCatalyst || PlatformDetection.IsiOS || PlatformDetection.IstvOS)))
60+
if (PlatformDetection.IsBrowser || PlatformDetection.IsWasi)
6161
return new TheoryData<TimeZoneInfo, string, string, string, string, string>
6262
{
6363
{ TimeZoneInfo.FindSystemTimeZoneById(s_strPacific), "(UTC-08:00) America/Los_Angeles", null, "PST", "PDT", null },
@@ -2051,9 +2051,9 @@ public static void TimeZoneDisplayNames_Unix(TimeZoneInfo timeZone)
20512051
{
20522052
bool isUtc = s_UtcAliases.Contains(timeZone.Id, StringComparer.OrdinalIgnoreCase);
20532053

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

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

2428-
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
2428+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser), nameof(PlatformDetection.IsNotWasi))]
24292429
[MemberData(nameof(AlternativeName_TestData))]
24302430
public static void UsingAlternativeTimeZoneIdsTest(string windowsId, string ianaId)
24312431
{

src/mono/wasi/build/WasiApp.targets

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,7 @@
359359
<_WasiLinkStepArgs Condition="'$(OS)' == 'Windows_NT'" Include="&quot;$([System.String]::new(%(_WasiFilePathForFixup.Identity)).Replace('\', '/'))&quot;" />
360360
<_WasiLinkStepArgs Condition="'$(OS)' != 'Windows_NT'" Include="@(_WasiFilePathForFixup -> '&quot;%(Identity)&quot;')" />
361361

362-
<_WasiLinkStepArgs Include="-Wl,--export=malloc,--export=free,--export=__heap_base,--export=__data_end" />
363362
<!-- keep in sync with src\mono\wasi\wasi.proj -->
364-
<!-- keep in sync with src\native\libs\CMakeLists.txt -->
365363
<_WasiLinkStepArgs Include="-Wl,-z,stack-size=8388608,-lwasi-emulated-process-clocks,-lwasi-emulated-signal,-lwasi-emulated-mman,-lwasi-emulated-pthread"/>
366364
<!--
367365
this together with some DLLImports makes dependency on wasi:[email protected]

src/mono/wasi/wasi.proj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
<_WasiCompileFlags Include="-D_WASI_EMULATED_MMAN"/>
150150
<_WasiCompileFlags Include="-D_WASI_EMULATED_PTHREAD"/>
151151
<!-- keep in sync with src\mono\wasi\build\WasiApp.targets -->
152-
<!-- keep in sync with src\native\libs\CMakeLists.txt -->
153152
<_WasiLinkFlags Include="-Wl,-z,stack-size=8388608,--initial-memory=52428800,-lwasi-emulated-process-clocks,-lwasi-emulated-signal,-lwasi-emulated-mman,-lwasi-emulated-pthread"/>
154153
</ItemGroup>
155154

src/native/libs/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,13 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
5353

5454
if (CLR_CMAKE_TARGET_WASI)
5555
set(HOST_WASI 1)
56-
add_compile_options(-Wno-unused-variable)
5756
add_compile_options(-Wno-unused-parameter)
5857
add_compile_options(-Wno-gnu-statement-expression)
5958
add_compile_options(-DHOST_WASI)
6059
add_compile_options(-D_WASI_EMULATED_PROCESS_CLOCKS)
6160
add_compile_options(-D_WASI_EMULATED_SIGNAL)
6261
add_compile_options(-D_WASI_EMULATED_MMAN)
6362
add_compile_options(-D_WASI_EMULATED_PTHREAD)
64-
# keep in sync with src\mono\wasi\build\WasiApp.targets
65-
# keep in sync with src\mono\wasi\wasi.proj
66-
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)
6763
endif ()
6864

6965
if (CLR_CMAKE_TARGET_ANDROID)

0 commit comments

Comments
 (0)