Skip to content

Commit

Permalink
[wasm] Run AOT, and Wasm.Build.Tests on windows (#59479)
Browse files Browse the repository at this point in the history
Adds two new jobs to runtime-staging for Windows - AOT, and Wasm.Build.Tests.

AOT - runs with the same conditions as the one in runtime
Wasm.Build.Tests - run for rolling builds, or when a narrow set of paths related to wasm build change
And do this for corresponding job in runtime for linux

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
  • Loading branch information
radical and akoeplinger committed Nov 20, 2021
1 parent e975403 commit ce93c29
Show file tree
Hide file tree
Showing 18 changed files with 229 additions and 21 deletions.
14 changes: 13 additions & 1 deletion eng/pipelines/common/evaluate-default-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
- src/libraries/System.Private.CoreLib/*
- src/libraries/Native/Unix/System.Globalization.Native/*
- src/libraries/Native/Unix/Common/*
- src/tests/BuildWasmApps/*
- src/native/*
exclude:
- eng/Version.Details.xml
Expand Down Expand Up @@ -102,6 +101,19 @@ jobs:
- subset: coreclr_jit
include:
- src/coreclr/jit/*
- subset: wasmbuildtests
include:
- src/tasks/*
- src/tests/BuildWasmApps/*
- src/mono/wasm/build/*
- src/mono/wasm/runtime/*
- src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Manifest/*
- src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/*
- src/mono/nuget/Microsoft.NET.Runtime.wasm.Sample.Mono/*
- src/mono/nuget/Microsoft.NETCore.BrowserDebugHost.Transport/*
- src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/*
- src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/*
- src/mono/mono/*

- ${{ if ne(parameters.extraSubsets, '') }}:
- ${{ parameters.extraSubsets }}
2 changes: 1 addition & 1 deletion eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
df -h
displayName: Disk Usage before Build
- ${{ if eq(parameters.nameSuffix, 'Browser_wasm_Windows') }}:
- ${{ if contains(parameters.nameSuffix, 'Windows_wasm') }}:
# Update machine certs
- task: PowerShell@2
displayName: Update machine certs
Expand Down
79 changes: 77 additions & 2 deletions eng/pipelines/runtime-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ jobs:
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: Browser_wasm_Windows
nameSuffix: Windows_wasm
buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows
timeoutInMinutes: 180
condition: >-
Expand All @@ -297,7 +297,82 @@ jobs:
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
- 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:
- Browser_wasm_win
variables:
# map dependencies variables to local variables
- name: wasmbuildtestsContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: Windows_wasm_WBT
buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:TestWasmBuildTests=true /p:TestAssemblies=false
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:BrowserHost=windows
scenarios:
- buildwasmapps
condition: >-
or(
eq(variables['wasmbuildtestsContainsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
- 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:
- Browser_wasm_win
variables:
# map dependencies variables to local variables
- name: librariesContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- name: monoContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: Windows_wasm_AOT
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg)
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:BrowserHost=windows /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg)
scenarios:
- normal
condition: >-
or(
eq(variables['librariesContainsChange'], true),
eq(variables['monoContainsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
#
# Build for Browser/wasm, with EnableAggressiveTrimming=true
Expand Down Expand Up @@ -427,4 +502,4 @@ jobs:
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
86 changes: 85 additions & 1 deletion eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ jobs:
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: Browser_wasm_Windows
nameSuffix: Windows_wasm
buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows
timeoutInMinutes: 180
condition: >-
Expand All @@ -490,6 +490,90 @@ jobs:
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
#
# Build Browser_wasm, on windows, and run tests with AOT
#
- 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:
- Browser_wasm_win
variables:
# map dependencies variables to local variables
- name: librariesContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- name: monoContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: Windows_wasm_AOT
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg)
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:BrowserHost=windows /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg)
scenarios:
- normal
condition: >-
or(
eq(variables['librariesContainsChange'], true),
eq(variables['monoContainsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
#
# Build Browser_wasm, on windows, and run Wasm.Build.Tests
#
- 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:
- Browser_wasm_win
variables:
# map dependencies variables to local variables
- name: wasmbuildtestsContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: Windows_wasm_WBT
buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:TestWasmBuildTests=true /p:TestAssemblies=false
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:BrowserHost=windows
scenarios:
- buildwasmapps
condition: >-
or(
eq(variables['wasmbuildtestsContainsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
#
# CoreCLR Build for running Apple Silicon libraries-innerloop
#
Expand Down
16 changes: 5 additions & 11 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,24 +328,19 @@ jobs:
buildConfig: Release
runtimeFlavor: mono
platforms:
# BuildWasmApps should only happen on the rolling build. No need to duplicate the build on PR's
- ${{ if eq(variables['isFullMatrix'], true) }}:
- Browser_wasm
- Browser_wasm
variables:
# map dependencies variables to local variables
- name: monoContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
- name: installerContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'] ]
- name: wasmbuildtestsContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono_WasmBuildTests
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmBuildTests=true /p:TestAssemblies=false
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
Expand All @@ -356,8 +351,7 @@ jobs:
- buildwasmapps
condition: >-
or(
eq(variables['monoContainsChange'], true),
eq(variables['installerContainsChange'], true),
eq(variables['wasmbuildtestsContainsChange'], true),
eq(variables['isFullMatrix'], true))
#
Expand Down
13 changes: 10 additions & 3 deletions eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
<WasmGenerateAppBundle Condition="'$(WasmGenerateAppBundle)' == ''">true</WasmGenerateAppBundle>
<BundleTestAppTargets>$(BundleTestAppTargets);BundleTestWasmApp</BundleTestAppTargets>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport>
<WasmNativeStrip Condition="'$(WasmNativeStrip)' == ''">false</WasmNativeStrip>
<!-- Some tests expect to load satellite assemblies by path, eg. System.Runtime.Loader.Tests,
so, just setting it true by default -->
<IncludeSatelliteAssembliesInVFS Condition="'$(IncludeSatelliteAssembliesInVFS)' == ''">true</IncludeSatelliteAssembliesInVFS>

<_ShellCommandSeparator Condition="'$(OS)' == 'Windows_NT'">&amp;</_ShellCommandSeparator>
<_ShellCommandSeparator Condition="'$(OS)' != 'Windows_NT'">&amp;&amp;</_ShellCommandSeparator>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -38,16 +42,19 @@
</PropertyGroup>

<PropertyGroup Condition="'$(BuildAOTTestsOnHelix)' == 'true'">
<_AOTBuildCommand>_buildAOTFunc publish/ProxyProjectForAOTOnHelix.proj $XHARNESS_OUT/AOTBuild.binlog</_AOTBuildCommand>
<_AOTBuildCommand Condition="'$(BrowserHost)' != 'windows'">_buildAOTFunc publish/ProxyProjectForAOTOnHelix.proj $XHARNESS_OUT/AOTBuild.binlog</_AOTBuildCommand>
<_AOTBuildCommand Condition="'$(BrowserHost)' == 'windows'">dotnet msbuild publish/ProxyProjectForAOTOnHelix.proj /bl:%XHARNESS_OUT%/AOTBuild.binlog</_AOTBuildCommand>

<_AOTBuildCommand Condition="'$(BrowserHost)' == 'windows'">$(_AOTBuildCommand) &quot;/p:WasmCachePath=%USERPROFILE%\.emscripten-cache&quot;</_AOTBuildCommand>

<!-- running aot-helix tests locally, so we can test with the same project file as CI -->
<_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration)</_AOTBuildCommand>

<_AOTBuildCommand>$(_AOTBuildCommand) /p:RunAOTCompilation=$(RunAOTCompilation)</_AOTBuildCommand>
<_AOTBuildCommand>$(_AOTBuildCommand) &amp;&amp; cd wasm_build/AppBundle</_AOTBuildCommand>
<_AOTBuildCommand>$(_AOTBuildCommand) $(_ShellCommandSeparator) cd wasm_build/AppBundle</_AOTBuildCommand>

<RunScriptCommand Condition="'$(RunScriptCommand)' == ''">$(_AOTBuildCommand)</RunScriptCommand>
<RunScriptCommand Condition="'$(RunScriptCommand)' != ''">$(_AOTBuildCommand) &amp;&amp; $(RunScriptCommand)</RunScriptCommand>
<RunScriptCommand Condition="'$(RunScriptCommand)' != ''">$(_AOTBuildCommand) $(_ShellCommandSeparator) $(RunScriptCommand)</RunScriptCommand>
</PropertyGroup>

<!-- Don't include InTree.props here, because the test projects themselves can set the target* properties -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static partial class PlatformDetection
public static bool IsNotWindowsHomeEdition => !IsWindowsHomeEdition;
public static bool IsNotInAppContainer => !IsInAppContainer;
public static bool IsSoundPlaySupported => IsWindows && IsNotWindowsNanoServer;
public static bool IsBrowserOnWindows => IsBrowser && Path.DirectorySeparatorChar == '\\';

// >= Windows 10 Anniversary Update
public static bool IsWindows10Version1607OrGreater => IsWindowsVersionOrLater(10, 0, 14393);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class IdnMappingIdnaConformanceTests
/// There are some others that failed which have been commented out and marked in the dataset as "GETASCII DOES FAILS ON WINDOWS 8.1"
/// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58708", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))]
public void GetAscii_Success()
{
Assert.All(Factory.GetDataset().Where(e => e.ASCIIResult.Success), entry =>
Expand Down Expand Up @@ -51,6 +52,7 @@ public void GetAscii_Success()
/// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file
/// </summary>
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58708", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))]
public void GetUnicode_Success()
{
Assert.All(Factory.GetDataset().Where(e => e.UnicodeResult.Success && e.UnicodeResult.ValidDomainName), entry =>
Expand Down Expand Up @@ -83,6 +85,7 @@ public void GetUnicode_Success()
/// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file
/// </remarks>
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // https://github.com/dotnet/runtime/issues/22409
[ActiveIssue("https://github.com/dotnet/runtime/issues/58708", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))]
public void GetAscii_Invalid()
{
Assert.All(Factory.GetDataset().Where(entry => !entry.ASCIIResult.Success), entry =>
Expand Down Expand Up @@ -112,6 +115,7 @@ public void GetAscii_Invalid()
/// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file
/// </remarks>
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/58708", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))]
public void GetUnicode_Invalid()
{
Assert.All(Factory.GetDataset().Where(entry => !entry.UnicodeResult.Success), entry =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/58707", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))]
public class FileInfo_CopyTo_str : File_Copy_str_str
{
protected override void Copy(string source, string dest)
Expand Down
7 changes: 6 additions & 1 deletion src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,16 @@
BuildInParallel="false" />
</ItemGroup>

<PropertyGroup>
<Samples_BuildInParallel Condition="'$(OS)' == 'Windows_NT'">false</Samples_BuildInParallel>
<Samples_BuildInParallel Condition="'$(OS)' != 'Windows_NT'">true</Samples_BuildInParallel>
</PropertyGroup>

<!-- Don't build samples, and functional tests on EAT, AOT, and WBT lanes -->
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(TargetOS)' == 'Browser' and '$(BuildAOTTestsOnHelix)' != 'true' and '$(TestWasmBuildTests)' != 'true'">
<ProjectReference Include="$(MonoProjectRoot)sample\wasm\**\*.Sample.csproj"
Exclude="@(ProjectExclusions)"
BuildInParallel="true" />
BuildInParallel="$(Samples_BuildInParallel)" />
<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\WebAssembly\**\*.Test.csproj"
Exclude="@(ProjectExclusions)"
BuildInParallel="false" />
Expand Down
3 changes: 3 additions & 0 deletions src/mono/wasm/build/WasmApp.Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@
<_DotnetJSSrcFile Include="$(_WasmRuntimePackSrcDir)\*.js" Exclude="$(_WasmRuntimePackSrcDir)\*.iffe.js"/>
<_WasmExtraJSFile Include="$(_WasmRuntimePackSrcDir)\*.iffe.js" Kind="extern-pre-js" />
<_WasmNativeFileForLinking Include="@(NativeFileReference)" />

<EmscriptenEnvVars Include="EMSDK_PYTHON=$(EmscriptenPythonToolsPath)python.exe" Condition="'$(OS)' == 'Windows_NT'" />
<EmscriptenEnvVars Include="EM_CACHE=$(WasmCachePath)" Condition="'$(WasmCachePath)' != ''" />
</ItemGroup>

<Error Text="Could not find NativeFileReference %(NativeFileReference.Identity)" Condition="'%(NativeFileReference.Identity)' != '' and !Exists(%(NativeFileReference.Identity))" />
Expand Down
1 change: 1 addition & 0 deletions src/mono/wasm/build/WasmApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
<_WasmShouldAOT Condition="'$(_WasmShouldAOT)' == ''">false</_WasmShouldAOT>
</PropertyGroup>

<MakeDir Directories="$(WasmCachePath)" Condition="'$(WasmCachePath)' != '' and !Exists($(WasmCachePath))" />
<MakeDir Directories="$(_WasmIntermediateOutputPath)" />
</Target>

Expand Down
Loading

0 comments on commit ce93c29

Please sign in to comment.