Skip to content

Commit bcc7944

Browse files
authored
[wasm] Misc follow up improvements for workloads testing (#55647)
* [wasm] Move UseMonoRuntime=true to WasmApp.props * Move workloads installation for testing bits to .. `src/libraries/workloads-testing.targets`. * [wasm] EmccCompile: don't log `stderr` messages as warnings emcc emits some (debug?) messages on stderr too, which are not always errors. Emitting them as warning can be break the build too, when running with warningsAsErrors . * [wasm] Fix helix work item prefix * improve readability of messages from parallel EmccCompile * Improve emscripten version mismatch message, and convert to a warning * Fix typo, so WBT runs can be differentiated correctly
1 parent e9cd803 commit bcc7944

File tree

10 files changed

+146
-123
lines changed

10 files changed

+146
-123
lines changed

src/libraries/Directory.Build.targets

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -335,90 +335,5 @@
335335
Text="Analyzers must only target netstandard2.0 since they run in the compiler which targets netstandard2.0. The following files were found to target '%(_AnalyzerPackFile.TargetFramework)': @(_AnalyzerPackFile)" />
336336
</Target>
337337

338-
<!-- ************** Workload based testing ************** -->
339-
340-
<Target Name="ProvisionSdkForWorkloadTesting" Condition="!Exists($(SdkForWorkloadTestingStampPath)) and '$(InstallWorkloadForTesting)' == 'true'">
341-
<Error Text="%24(SdkPathForWorkloadTesting) is not set" Condition="'$(SdkPathForWorkloadTesting)' == ''" />
342-
<Error Text="%24(SdkVersionForWorkloadTesting) is not set" Condition="'$(SdkVersionForWorkloadTesting)' == ''" />
343-
344-
<Message Text="** Installing sdk $(SdkVersionForWorkloadTesting) for workload based tests" Importance="High" />
345-
346-
<RemoveDir Directories="$(SdkPathForWorkloadTesting)" />
347-
<MakeDir Directories="$(SdkPathForWorkloadTesting)" />
348-
349-
<PropertyGroup>
350-
<_DotNetInstallScriptPath Condition="!$([MSBuild]::IsOSPlatform('windows'))">$(DOTNET_INSTALL_DIR)/dotnet-install.sh</_DotNetInstallScriptPath>
351-
<_DotNetInstallScriptPath Condition=" $([MSBuild]::IsOSPlatform('windows'))">$(RepoRoot).dotnet\dotnet-install.ps1</_DotNetInstallScriptPath>
352-
</PropertyGroup>
353-
354-
<Exec Condition="!$([MSBuild]::IsOSPlatform('windows'))"
355-
Command="chmod +x $(_DotNetInstallScriptPath); $(_DotNetInstallScriptPath) -i $(SdkPathForWorkloadTesting) -v $(SdkVersionForWorkloadTesting)" />
356-
357-
<Exec Condition="$([MSBuild]::IsOSPlatform('windows'))"
358-
Command='powershell -ExecutionPolicy ByPass -NoProfile -command "&amp; $(_DotNetInstallScriptPath) -InstallDir $(SdkPathForWorkloadTesting) -Version $(SdkVersionForWorkloadTesting)"' />
359-
360-
<WriteLinesToFile File="$(SdkForWorkloadTestingStampPath)" Lines="" Overwrite="true" />
361-
</Target>
362-
363-
<Target Name="GetWorkloadInputs">
364-
<ItemGroup>
365-
<AvailableNuGetsInArtifacts Include="$(LibrariesShippingPackagesDir)\*.nupkg" />
366-
</ItemGroup>
367-
368-
<Error Text="Cannot find any nupkg files in $(LibrariesShippingPackagesDir), needed for workloads" Condition="@(AvailableNuGetsInArtifacts->Count()) == 0" />
369-
</Target>
370-
371-
<UsingTask Condition="'$(InstallWorkloadForTesting)' == 'true'"
372-
TaskName="Microsoft.Workload.Build.Tasks.InstallWorkloadFromArtifacts"
373-
AssemblyFile="$(WorkloadBuildTasksAssemblyPath)" />
374-
375-
<UsingTask Condition="'$(InstallWorkloadForTesting)' == 'true'"
376-
TaskName="GenerateFileFromTemplate"
377-
AssemblyFile="$(WorkloadBuildTasksAssemblyPath)" />
378-
379-
<Target Name="InstallWorkloadUsingArtifacts"
380-
AfterTargets="ArchiveTests"
381-
DependsOnTargets="ProvisionSdkForWorkloadTesting;GetWorkloadInputs"
382-
Inputs="@(AvailableNuGetsInArtifacts)"
383-
Outputs="$(WorkloadStampFile)"
384-
Condition="'$(InstallWorkloadForTesting)' == 'true'">
385-
386-
<ItemGroup>
387-
<_PropsForAOTCrossBuild Include="TestingWorkloads=true" />
388-
<_PropsForAOTCrossBuild Include="Configuration=$(Configuration)" />
389-
<_PropsForAOTCrossBuild Include="TargetOS=Browser" />
390-
<_PropsForAOTCrossBuild Include="TargetArchitecture=wasm" />
391-
<_PropsForAOTCrossBuild Include="ContinuousIntegrationBuild=$(ContinuousIntegrationBuild)" />
392-
393-
<_PropsForAOTCrossBuild Include="RuntimeIdentifier=$(NETCoreSdkRuntimeIdentifier)" />
394-
<_PropsForAOTCrossBuild Include="TargetCrossRid=$(RuntimeIdentifier)" />
395-
</ItemGroup>
396-
397-
<Exec Command="dotnet build -bl -restore -t:Pack @(_PropsForAOTCrossBuild -> '-p:%(Identity)', ' ') Microsoft.NETCore.App.MonoCrossAOT.sfxproj"
398-
WorkingDirectory="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App" />
399-
400-
<ItemGroup>
401-
<_NuGetSourceForWorkloads Include="dotnet6" Value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
402-
<_BuiltNuGets Include="$(LibrariesShippingPackagesDir)\*.nupkg" />
403-
</ItemGroup>
404-
405-
<PropertyGroup>
406-
<!-- Eg. Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.browser-wasm.6.0.0-dev.nupkg -->
407-
<_AOTCrossNuGetPath>$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.AOT.$(NETCoreSdkRuntimeIdentifier).Cross.$(RuntimeIdentifier).$(PackageVersion).nupkg</_AOTCrossNuGetPath>
408-
</PropertyGroup>
409-
410-
<Error Text="Could not find cross compiler nupkg at $(_AOTCrossNuGetPath). Found packages: @(_BuiltNuGets)"
411-
Condition="!Exists($(_AOTCrossNuGetPath))" />
412-
413-
<Message Text="Packages found in $(LibrariesShippingPackagesDir): @(_BuiltNuGets)" Importance="Low" />
414-
415-
<InstallWorkloadFromArtifacts
416-
WorkloadId="@(WorkloadIdForTesting)"
417-
VersionBand="$(SdkBandVersion)"
418-
LocalNuGetsPath="$(LibrariesShippingPackagesDir)"
419-
ExtraNuGetSources="@(_NuGetSourceForWorkloads)"
420-
SdkDir="$(SdkPathForWorkloadTesting)" />
421-
422-
<WriteLinesToFile File="$(WorkloadStampFile)" Lines="" Overwrite="true" />
423-
</Target>
338+
<Import Project="$(MSBuildThisFileDirectory)workloads-testing.targets" />
424339
</Project>

src/libraries/sendtohelixhelp.proj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@
317317
<WasmBuildTargetsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'build'))</WasmBuildTargetsDir>
318318
<TestEchoMiddleware>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'NetCoreServer', '$(NetCoreAppCurrent)-$(Configuration)'))</TestEchoMiddleware>
319319
<RemoteLoopMiddleware>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'RemoteLoopServer', '$(NetCoreAppCurrent)-$(Configuration)'))</RemoteLoopMiddleware>
320-
<WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' == 'true'">Workloads/</WorkItemPrefix>
321-
<WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' != 'true'">EMSDK/</WorkItemPrefix>
320+
<WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' == 'true'">Workloads-</WorkItemPrefix>
321+
<WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' != 'true'">EMSDK-</WorkItemPrefix>
322322
</PropertyGroup>
323323

324324
<PropertyGroup Condition="'$(RuntimeFlavor)' == 'Mono'">
@@ -377,7 +377,7 @@
377377
<_WorkItem Include="$(TestArchiveRoot)runonly/**/WebAssembly.Browser.*.Test.zip" Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' == 'WasmTestOnBrowser'" />
378378
<_WorkItem Include="$(TestArchiveRoot)browseronly/**/*.zip" Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' == 'WasmTestOnBrowser'" />
379379

380-
<HelixWorkItem Include="@(_WorkItem -> '%(WorkItemPrefix)%(FileName)')">
380+
<HelixWorkItem Include="@(_WorkItem -> '$(WorkItemPrefix)%(FileName)')">
381381
<PayloadArchive>%(Identity)</PayloadArchive>
382382
<Command>$(HelixCommand)</Command>
383383
<Timeout>$(_workItemTimeout)</Timeout>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<Project>
2+
<Target Name="ProvisionSdkForWorkloadTesting" Condition="!Exists($(SdkForWorkloadTestingStampPath)) and '$(InstallWorkloadForTesting)' == 'true'">
3+
<Error Text="%24(SdkPathForWorkloadTesting) is not set" Condition="'$(SdkPathForWorkloadTesting)' == ''" />
4+
<Error Text="%24(SdkVersionForWorkloadTesting) is not set" Condition="'$(SdkVersionForWorkloadTesting)' == ''" />
5+
6+
<Message Text="** Installing sdk $(SdkVersionForWorkloadTesting) for workload based tests" Importance="High" />
7+
8+
<RemoveDir Directories="$(SdkPathForWorkloadTesting)" />
9+
<MakeDir Directories="$(SdkPathForWorkloadTesting)" />
10+
11+
<PropertyGroup>
12+
<_DotNetInstallScriptPath Condition="!$([MSBuild]::IsOSPlatform('windows'))">$(DOTNET_INSTALL_DIR)/dotnet-install.sh</_DotNetInstallScriptPath>
13+
<_DotNetInstallScriptPath Condition=" $([MSBuild]::IsOSPlatform('windows'))">$(RepoRoot).dotnet\dotnet-install.ps1</_DotNetInstallScriptPath>
14+
</PropertyGroup>
15+
16+
<Exec Condition="!$([MSBuild]::IsOSPlatform('windows'))"
17+
Command="chmod +x $(_DotNetInstallScriptPath); $(_DotNetInstallScriptPath) -i $(SdkPathForWorkloadTesting) -v $(SdkVersionForWorkloadTesting)" />
18+
19+
<Exec Condition="$([MSBuild]::IsOSPlatform('windows'))"
20+
Command='powershell -ExecutionPolicy ByPass -NoProfile -command "&amp; $(_DotNetInstallScriptPath) -InstallDir $(SdkPathForWorkloadTesting) -Version $(SdkVersionForWorkloadTesting)"' />
21+
22+
<WriteLinesToFile File="$(SdkForWorkloadTestingStampPath)" Lines="" Overwrite="true" />
23+
</Target>
24+
25+
<Target Name="GetWorkloadInputs">
26+
<ItemGroup>
27+
<AvailableNuGetsInArtifacts Include="$(LibrariesShippingPackagesDir)\*.nupkg" />
28+
</ItemGroup>
29+
30+
<Error Text="Cannot find any nupkg files in $(LibrariesShippingPackagesDir), needed for workloads" Condition="@(AvailableNuGetsInArtifacts->Count()) == 0" />
31+
</Target>
32+
33+
<UsingTask Condition="'$(InstallWorkloadForTesting)' == 'true'"
34+
TaskName="Microsoft.Workload.Build.Tasks.InstallWorkloadFromArtifacts"
35+
AssemblyFile="$(WorkloadBuildTasksAssemblyPath)" />
36+
37+
<UsingTask Condition="'$(InstallWorkloadForTesting)' == 'true'"
38+
TaskName="GenerateFileFromTemplate"
39+
AssemblyFile="$(WorkloadBuildTasksAssemblyPath)" />
40+
41+
<Target Name="InstallWorkloadUsingArtifacts"
42+
AfterTargets="ArchiveTests"
43+
DependsOnTargets="ProvisionSdkForWorkloadTesting;GetWorkloadInputs"
44+
Inputs="@(AvailableNuGetsInArtifacts)"
45+
Outputs="$(WorkloadStampFile)"
46+
Condition="'$(InstallWorkloadForTesting)' == 'true'">
47+
48+
<ItemGroup>
49+
<_PropsForAOTCrossBuild Include="TestingWorkloads=true" />
50+
<_PropsForAOTCrossBuild Include="Configuration=$(Configuration)" />
51+
<_PropsForAOTCrossBuild Include="TargetOS=Browser" />
52+
<_PropsForAOTCrossBuild Include="TargetArchitecture=wasm" />
53+
<_PropsForAOTCrossBuild Include="ContinuousIntegrationBuild=$(ContinuousIntegrationBuild)" />
54+
55+
<_PropsForAOTCrossBuild Include="RuntimeIdentifier=$(NETCoreSdkRuntimeIdentifier)" />
56+
<_PropsForAOTCrossBuild Include="TargetCrossRid=$(RuntimeIdentifier)" />
57+
</ItemGroup>
58+
59+
<Exec Command="dotnet build -bl -restore -t:Pack @(_PropsForAOTCrossBuild -> '-p:%(Identity)', ' ') Microsoft.NETCore.App.MonoCrossAOT.sfxproj"
60+
WorkingDirectory="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App" />
61+
62+
<ItemGroup>
63+
<_NuGetSourceForWorkloads Include="dotnet6" Value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
64+
<_BuiltNuGets Include="$(LibrariesShippingPackagesDir)\*.nupkg" />
65+
</ItemGroup>
66+
67+
<PropertyGroup>
68+
<!-- Eg. Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.browser-wasm.6.0.0-dev.nupkg -->
69+
<_AOTCrossNuGetPath>$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.AOT.$(NETCoreSdkRuntimeIdentifier).Cross.$(RuntimeIdentifier).$(PackageVersion).nupkg</_AOTCrossNuGetPath>
70+
</PropertyGroup>
71+
72+
<Error Text="Could not find cross compiler nupkg at $(_AOTCrossNuGetPath). Found packages: @(_BuiltNuGets)"
73+
Condition="!Exists($(_AOTCrossNuGetPath))" />
74+
75+
<Message Text="Packages found in $(LibrariesShippingPackagesDir): @(_BuiltNuGets)" Importance="Low" />
76+
77+
<InstallWorkloadFromArtifacts
78+
WorkloadId="@(WorkloadIdForTesting)"
79+
VersionBand="$(SdkBandVersion)"
80+
LocalNuGetsPath="$(LibrariesShippingPackagesDir)"
81+
ExtraNuGetSources="@(_NuGetSourceForWorkloads)"
82+
SdkDir="$(SdkPathForWorkloadTesting)" />
83+
84+
<WriteLinesToFile File="$(WorkloadStampFile)" Lines="" Overwrite="true" />
85+
</Target>
86+
</Project>
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<Project>
2-
<PropertyGroup>
3-
<UseMonoRuntime Condition="'$(RuntimeIdentifier)' == 'Browser-wasm'">true</UseMonoRuntime>
4-
</PropertyGroup>
5-
62
<Import Project="$(MSBuildThisFileDirectory)\RuntimeConfigParserTask.props" />
73
<Import Project="$(MSBuildThisFileDirectory)\RuntimeComponentManifest.props" />
84
</Project>

src/mono/wasm/build/WasmApp.LocalBuild.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
<Import Project="$(MSBuildThisFileDirectory)WasmApp.props" />
2323

2424
<PropertyGroup>
25-
<!-- needed by the sdk, for net6.0, to include the correct runtime packs -->
26-
<UseMonoRuntime>true</UseMonoRuntime>
27-
2825
<_NetCoreAppToolCurrent>net6.0</_NetCoreAppToolCurrent>
2926
</PropertyGroup>
3027

src/mono/wasm/build/WasmApp.LocalBuild.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<PropertyGroup>
2727
<PublishTrimmed>true</PublishTrimmed>
2828
<TrimMode>link</TrimMode>
29-
<UseMonoRuntime>true</UseMonoRuntime>
3029
</PropertyGroup>
3130

3231
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">

src/mono/wasm/build/WasmApp.Native.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ EMSCRIPTEN_KEEPALIVE void mono_wasm_load_profiler_aot (const char *desc) { mono_
339339
<ActualEmccVersionRaw>%(_ReversedVersionLines.Identity)</ActualEmccVersionRaw>
340340
</PropertyGroup>
341341

342-
<Error Condition="'$(RuntimeEmccVersionRaw)' != '$(ActualEmccVersionRaw)'" Text="Emscripten version mismatch, expected '$(RuntimeEmccVersionRaw)', got '$(ActualEmccVersionRaw)'"/>
342+
<Warning Condition="'$(RuntimeEmccVersionRaw)' != '$(ActualEmccVersionRaw)'"
343+
Text="Emscripten version mismatch. The runtime pack in $(MicrosoftNetCoreAppRuntimePackDir) expects '$(RuntimeEmccVersionRaw)', but emcc being used has version '$(ActualEmccVersionRaw)'. This might cause build failures." />
343344
</Target>
344345

345346
<!--

src/mono/wasm/build/WasmApp.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<TargetArchitecture>wasm</TargetArchitecture>
44
<TargetOS>Browser</TargetOS>
55
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
6+
<UseMonoRuntime>true</UseMonoRuntime>
67

78
<WasmBuildAppAfterThisTarget Condition="'$(WasmBuildAppAfterThisTarget)' == ''">Publish</WasmBuildAppAfterThisTarget>
89
<WasmBuildAppDependsOn>

0 commit comments

Comments
 (0)