Skip to content
Merged
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
26 changes: 26 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,32 @@ extends:
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_coreclr_runtimetests.containsChange'], true),
eq(variables['isRollingBuild'], true))

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
buildConfig: checked
platforms:
- browser_wasm
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
testGroup: innerloop
readyToRun: true
displayNameArgs: R2R_CG2
liveLibrariesBuildConfig: Release
unifiedArtifactsName: CoreCLR_ReleaseLibraries_BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_hostedOs)_$(_BuildConfig)
unifiedBuildNameSuffix: CoreCLR_ReleaseLibraries
useHelixMonitor: ${{ variables.enableHelixJobMonitor }}
extraBuildArgs: -os browser -p:HostConfiguration=Release
condition: >-
or(
eq(variables['wasmDarcDependenciesChanged'], true),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamperlin How are we testing Wasm R2R currently? I would have expected a test leg like this to already exist somewhere, but I haven’t been able to find.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is/was some testing in outerloop, for example, it lead to this issue

#131925

eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true),
Comment thread
lewing marked this conversation as resolved.
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], 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))

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
Expand Down
2 changes: 2 additions & 0 deletions src/tests/Common/CLRTest.CrossGen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ fi

# CrossGen2 Script
if [ ! -z ${RunCrossGen2+x} ]%3B then
export TEST_READY_TO_RUN_MODE=1
compilationDoneFlagFile="IL-CG2/done"
if [ -d IL-CG2 ]%3B then
while [ ! -f $compilationDoneFlagFile ]%3B
Expand Down Expand Up @@ -277,6 +278,7 @@ if /i "$(AlwaysUseCrossGen2)" == "true" (

REM CrossGen2 Script
if defined RunCrossGen2 (
set TEST_READY_TO_RUN_MODE=1
set ExtraCrossGen2Args=!ExtraCrossGen2Args! $(CrossGen2TestExtraArguments)
set CrossGen2TestCheckPdb=$(CrossGen2TestCheckPdb)
set __CreatePdb=$(__CreatePdb)
Expand Down
1 change: 1 addition & 0 deletions src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public static bool IsMonoInterpreter
public static bool IsBrowser => OperatingSystem.IsBrowser();
public static bool IsWasi => OperatingSystem.IsWasi();
public static bool IsWasm => IsBrowser || IsWasi;
public static bool IsReadyToRunCompiled => Environment.GetEnvironmentVariable("TEST_READY_TO_RUN_MODE") == "1";
public static bool IsNotMultithreadingSupported => !IsMultithreadingSupported;
public static bool IsMultithreadingSupported => RuntimeFeature.IsMultithreadingSupported;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
<!-- The bug is wasm R2R (crossgen) codegen. On non-browser legs this runs as
ordinary JIT/interp and passes trivially (expected). On the browser leg,
AlwaysUseCrossGen2 forces crossgen (exports RunCrossGen2=1) so the test is
actually compiled to wasm R2R and run under node; otherwise a plain
browser leg runs it as normal JIT and silently false-passes without ever
exercising the fix. CrossGen2OutputFormat=wasm is set automatically for
TargetOS=browser (src/tests/Directory.Build.props). -->
<AlwaysUseCrossGen2 Condition="'$(TargetOS)' == 'browser'">true</AlwaysUseCrossGen2>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
<!-- Force crossgen on the browser leg so this actually runs as wasm R2R. -->
<AlwaysUseCrossGen2 Condition="'$(TargetOS)' == 'browser'">true</AlwaysUseCrossGen2>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
<!-- The bug is wasm R2R (crossgen) codegen, and it only reproduces with optimization
enabled. Force crossgen on the browser leg so this actually runs as wasm R2R;
otherwise a plain browser leg runs it as normal JIT and silently false-passes. -->
<AlwaysUseCrossGen2 Condition="'$(TargetOS)' == 'browser'">true</AlwaysUseCrossGen2>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
<!-- The bug only reproduces when the caller is optimized R2R code, so force crossgen on
the browser leg. AlwaysUseCrossGen2 only takes effect through the project's own run
script, which requires process isolation. -->
<AlwaysUseCrossGen2 Condition="'$(TargetOS)' == 'browser'">true</AlwaysUseCrossGen2>
<RequiresProcessIsolation>true</RequiresProcessIsolation>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
using InlineIL;
using System;
using System.Runtime.CompilerServices;
using TestLibrary;
using Xunit;

class Runtime_70259
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/70279", TestRuntimes.Mono)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/133169", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm), nameof(PlatformDetection.IsReadyToRunCompiled))]
private static int Main()
{
// This creates an open delegate that goes through shuffle thunk and
Expand Down Expand Up @@ -45,4 +49,3 @@ public virtual int Method()
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Metadata version: v4.0.30319
.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) }
.assembly extern xunit.core {}

.assembly extern TestLibrary { .ver 0:0:0:0 }
.assembly extern Microsoft.DotNet.XUnitExtensions { .publickeytoken = (31 BF 38 56 AD 36 4E 35 ) }
.assembly Runtime_70259
{
Expand Down Expand Up @@ -72,6 +72,11 @@
string('https://github.com/dotnet/runtime/issues/70279')
int32(0x2) // Mono
}
.custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = {
string('https://github.com/dotnet/runtime/issues/133169')
type([TestLibrary]TestLibrary.PlatformDetection)
string[2] ('IsWasm' 'IsReadyToRunCompiled')
}
.entrypoint
// Code size 31 (0x1f)
.maxstack 8
Expand Down
2 changes: 1 addition & 1 deletion src/tests/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@

<Target Name="CrossgenFramework"
DependsOnTargets="GenerateLayout"
Condition="'$(__CopyNativeTestBinaries)' != '1' and '$(__TestBuildMode)' == 'crossgen2' and !$(MonoAot) and !$(MonoFullAot)" >
Condition="'$(__CopyNativeTestBinaries)' != '1' and '$(__TestBuildMode)' == 'crossgen2' and '$(TargetArchitecture)' != 'wasm' and !$(MonoAot) and !$(MonoFullAot)" >

<PropertyGroup>
<CrossgenOutputDir>$(__TestIntermediatesDir)\crossgen.out</CrossgenOutputDir>
Expand Down
Loading