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

[aot][browser] Stop throwing in CultureInfo getter #95910

Merged
merged 5 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
32 changes: 16 additions & 16 deletions eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,22 +221,22 @@ jobs:
- WasmTestOnBrowser
- WasmTestOnNodeJS

# Hybrid Globalization AOT tests - https://github.com/dotnet/runtime/issues/94212
# - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
# parameters:
# platforms:
# - browser_wasm
# - browser_wasm_win
# nameSuffix: _HybridGlobalization_AOT
# extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) /p:HybridGlobalization=true
# runAOT: true
# isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
# isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
# alwaysRun: true
# scenarios:
# - normal
# - WasmTestOnBrowser
# - WasmTestOnNodeJS
# Hybrid Globalization AOT tests
- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
parameters:
platforms:
- browser_wasm
- browser_wasm_win
nameSuffix: _HybridGlobalization_AOT
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) /p:HybridGlobalization=true
runAOT: true
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
alwaysRun: true
scenarios:
- normal
- WasmTestOnBrowser
- WasmTestOnNodeJS

- ${{ if and(ne(parameters.isRollingBuild, true), ne(parameters.excludeNonLibTests, true), ne(parameters.debuggerTestsOnly, true)) }}:
# Builds only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ public partial class CultureInfo : IFormatProvider, ICloneable
private static volatile CultureInfo? s_userDefaultUICulture;

// The Invariant culture;
// https://github.com/dotnet/runtime/issues/94225
#if TARGET_BROWSER
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved
private static CultureInfo? s_InvariantCultureInfo;
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved
#else
private static readonly CultureInfo s_InvariantCultureInfo = new CultureInfo(CultureData.Invariant, isReadOnly: true);
#endif

// These are defaults that we use if a thread has not opted into having an explicit culture
private static volatile CultureInfo? s_DefaultThreadCurrentUICulture;
Expand Down Expand Up @@ -462,7 +467,12 @@ public static CultureInfo InvariantCulture
{
get
{
// https://github.com/dotnet/runtime/issues/94225
#if TARGET_BROWSER
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved
s_InvariantCultureInfo ??= new CultureInfo(CultureData.Invariant, isReadOnly: true);
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved
#else
Debug.Assert(s_InvariantCultureInfo != null);
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved
#endif
return s_InvariantCultureInfo;
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@

<!-- Normally run with HighAOT, but disabling there, and for AOT - https://github.com/dotnet/runtime/issues/86164 -->
<!-- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.Tests\System.Text.Json.Tests.csproj" /> -->

<!-- https://github.com/dotnet/runtime/issues/94225 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Globalization.Calendars.Tests\Hybrid\System.Globalization.Calendars.Hybrid.WASM.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Globalization.Tests\Hybrid\System.Globalization.Hybrid.WASM.Tests.csproj" />
</ItemGroup>

<!-- invariant project cannot be tested in hybrid mode; projects using functions that throw PNSE too often to block separate tests (HashCode, CompareOptions) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public HybridGlobalizationTests(ITestOutputHelper output, SharedBuildPerTestClas
.WithRunHosts(host)
.UnwrapItemsAsArrays();

[ActiveIssue("https://github.com/dotnet/runtime/issues/94212")]
[Theory]
[MemberData(nameof(HybridGlobalizationTestData), parameters: new object[] { /*aot*/ false, RunHost.All })]
[MemberData(nameof(HybridGlobalizationTestData), parameters: new object[] { /*aot*/ true, RunHost.All })]
Expand Down
Loading