未验证 提交 7d986fa0 编写于 作者: A Ankit Jain 提交者: GitHub

[wasm] Misc tests related fixes (#73884)

* [wasm] Stop running crypto tests with subtlecrypto

* [wasm] Add --web-server-use-cop for samples when running on helix for a threaded build

* [wasm] Makefile, honor V=1 and emit binlog

* [wasm] PInvokeTableGenerator: emit the type name also, for the warning

* [wasm] Improve build for non-default runtime packs

.. by using `MSBuild` task to build them instead of invoking
`dotnet.sh`.
- And fix incremental builds

* [wasm] Run smoke tests only for AOT

- Building, and running all the tests for EAT case will help catch
linker errors that can slip through.

* [wasm] Fix linker errors for tests

Fixes https://github.com/dotnet/runtime/issues/73901
上级 88ba0454
...@@ -373,7 +373,6 @@ jobs: ...@@ -373,7 +373,6 @@ jobs:
- Browser_wasm - Browser_wasm
nameSuffix: _EAT nameSuffix: _EAT
runAOT: false runAOT: false
runSmokeOnlyArg: $(_runSmokeTestsOnlyArg)
alwaysRun: ${{ variables.isRollingBuild }} alwaysRun: ${{ variables.isRollingBuild }}
# AOT Library tests # AOT Library tests
......
...@@ -5,10 +5,6 @@ ...@@ -5,10 +5,6 @@
<WasmGenerateAppBundle Condition="'$(WasmGenerateAppBundle)' == ''">true</WasmGenerateAppBundle> <WasmGenerateAppBundle Condition="'$(WasmGenerateAppBundle)' == ''">true</WasmGenerateAppBundle>
<BundleTestAppTargets>$(BundleTestAppTargets);BundleTestWasmApp</BundleTestAppTargets> <BundleTestAppTargets>$(BundleTestAppTargets);BundleTestWasmApp</BundleTestAppTargets>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport> <DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport>
<!-- suppress warnings as these are tests, and not expected to be trim-safe -->
<SuppressTrimAnalysisWarnings Condition="'$(EnableAggressiveTrimming)' == 'true'">true</SuppressTrimAnalysisWarnings>
<!-- This warning code isn't yet included in SuppressTrimAnalysisWarnings -->
<NoWarn Condition="'$(EnableAggressiveTrimming)' == 'true'">$(NoWarn);IL2118</NoWarn>
<!-- set this when provisioning emsdk on CI --> <!-- set this when provisioning emsdk on CI -->
<EMSDK_PATH Condition="'$(EMSDK_PATH)' == '' and '$(ContinuousIntegrationBuild)' == 'true' and '$(MonoProjectRoot)' != ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'emsdk'))</EMSDK_PATH> <EMSDK_PATH Condition="'$(EMSDK_PATH)' == '' and '$(ContinuousIntegrationBuild)' == 'true' and '$(MonoProjectRoot)' != ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'emsdk'))</EMSDK_PATH>
...@@ -33,6 +29,15 @@ ...@@ -33,6 +29,15 @@
<_UseWasmSymbolicator Condition="'$(TestTrimming)' != 'true'">true</_UseWasmSymbolicator> <_UseWasmSymbolicator Condition="'$(TestTrimming)' != 'true'">true</_UseWasmSymbolicator>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(EnableAggressiveTrimming)' == 'true'">
<!-- suppress warnings as these are tests, and not expected to be trim-safe -->
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
<!-- This warning code isn't yet included in SuppressTrimAnalysisWarnings -->
<NoWarn>$(NoWarn);IL2118</NoWarn>
<!-- IL2121: Unnecessary UnconditionalSuppressMessage attribute -->
<NoWarn>$(NoWarn);IL2121</NoWarn>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<BuildAOTTestsOn Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(Scenario)' == 'BuildWasmApps'">helix</BuildAOTTestsOn> <BuildAOTTestsOn Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(Scenario)' == 'BuildWasmApps'">helix</BuildAOTTestsOn>
<BuildAOTTestsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">helix</BuildAOTTestsOn> <BuildAOTTestsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">helix</BuildAOTTestsOn>
......
...@@ -116,14 +116,9 @@ ...@@ -116,14 +116,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<_DefaultPropsForNuGetBuild Include="Configuration=$(Configuration)" />
<_DefaultPropsForNuGetBuild Include="TargetOS=Browser" />
<_DefaultPropsForNuGetBuild Include="TargetArchitecture=wasm" />
<_DefaultPropsForNuGetBuild Include="ContinuousIntegrationBuild=$(ContinuousIntegrationBuild)" />
<_NuGetsToBuild Include="$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Ref.$(_PackageVersion).nupkg" <_NuGetsToBuild Include="$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Ref.$(_PackageVersion).nupkg"
Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App\Microsoft.NETCore.App.Ref.sfxproj" Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App\Microsoft.NETCore.App.Ref.sfxproj"
BuildArgs="@(_DefaultPropsForNuGetBuild -> '-p:%(Identity)', ' ')" Properties="@(_DefaultPropsForNuGetBuild, ';')"
Descriptor="Ref pack"/> Descriptor="Ref pack"/>
<!-- AOT Cross compiler --> <!-- AOT Cross compiler -->
...@@ -131,10 +126,11 @@ ...@@ -131,10 +126,11 @@
<_PropsForAOTCrossBuild Include="TestingWorkloads=true" /> <_PropsForAOTCrossBuild Include="TestingWorkloads=true" />
<_PropsForAOTCrossBuild Include="RuntimeIdentifier=$(NETCoreSdkRuntimeIdentifier)" /> <_PropsForAOTCrossBuild Include="RuntimeIdentifier=$(NETCoreSdkRuntimeIdentifier)" />
<_PropsForAOTCrossBuild Include="TargetCrossRid=$(RuntimeIdentifier)" /> <_PropsForAOTCrossBuild Include="TargetCrossRid=$(RuntimeIdentifier)" />
<_PropsForAOTCrossBuild Include="DisableSourceLink=true" />
<_NuGetsToBuild Include="$(_AOTCrossNuGetPath)" <_NuGetsToBuild Include="$(_AOTCrossNuGetPath)"
Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App\Microsoft.NETCore.App.MonoCrossAOT.sfxproj" Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App\Microsoft.NETCore.App.MonoCrossAOT.sfxproj"
BuildArgs="@(_PropsForAOTCrossBuild -> '-p:%(Identity)', ' ')" Properties="@(_PropsForAOTCrossBuild,';')"
Descriptor="AOT Cross compiler"/> Descriptor="AOT Cross compiler"/>
</ItemGroup> </ItemGroup>
</Target> </Target>
...@@ -143,7 +139,13 @@ ...@@ -143,7 +139,13 @@
<Message Importance="High" Text=" <Message Importance="High" Text="
** Building %(_NuGetsToBuild.Descriptor) ** ** Building %(_NuGetsToBuild.Descriptor) **
" /> " />
<Exec Command="dotnet build -bl -restore -v:q --nologo -t:Pack %(_NuGetsToBuild.BuildArgs) %(_NuGetsToBuild.Project)" />
<MSBuild Projects="%(_NuGetsToBuild.Project)"
Properties="%(_NuGetsToBuild.Properties)"
Targets="Restore" />
<MSBuild Projects="%(_NuGetsToBuild.Project)"
Properties="%(_NuGetsToBuild.Properties)"
Targets="Pack" />
</Target> </Target>
<!-- For local builds, only one of the 3 required runtime packs might be available. In that case, <!-- For local builds, only one of the 3 required runtime packs might be available. In that case,
...@@ -158,7 +160,7 @@ ...@@ -158,7 +160,7 @@
<_DefaultBuildVariant Condition="'$(WasmEnablePerfTracing)' == 'true' or '$(MonoWasmBuildVariant)' == 'perftrace'">.perftrace.</_DefaultBuildVariant> <_DefaultBuildVariant Condition="'$(WasmEnablePerfTracing)' == 'true' or '$(MonoWasmBuildVariant)' == 'perftrace'">.perftrace.</_DefaultBuildVariant>
<_DefaultBuildVariant Condition="'$(_DefaultBuildVariant)' == ''">.</_DefaultBuildVariant> <_DefaultBuildVariant Condition="'$(_DefaultBuildVariant)' == ''">.</_DefaultBuildVariant>
<_DefaultRuntimePackNuGetPath>$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.Mono$(_DefaultBuildVariant)browser-wasm$(_PackageVersion).nupkg</_DefaultRuntimePackNuGetPath> <_DefaultRuntimePackNuGetPath>$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.Mono$(_DefaultBuildVariant)browser-wasm.$(_PackageVersion).nupkg</_DefaultRuntimePackNuGetPath>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
...@@ -175,13 +177,13 @@ ...@@ -175,13 +177,13 @@
<_NuGetsToBuild Include="$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.Mono.%(_BuildVariants.Identity).browser-wasm.$(_PackageVersion).nupkg" <_NuGetsToBuild Include="$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.Mono.%(_BuildVariants.Identity).browser-wasm.$(_PackageVersion).nupkg"
Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj" Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj"
Dependencies="$(_DefaultRuntimePackNuGetPath)" Dependencies="$(_DefaultRuntimePackNuGetPath)"
BuildArgs="@(_DefaultPropsForNuGetBuild -> '-p:%(Identity)', ' ') /p:MonoWasmBuildVariant=%(_BuildVariants.Identity)" Properties="@(_DefaultPropsForNuGetBuild, ';');MonoWasmBuildVariant=%(_BuildVariants.Identity)"
Descriptor="runtime pack for %(_BuildVariants.Identity)" /> Descriptor="runtime pack for %(_BuildVariants.Identity)" />
<!-- add for non-threaded runtime also --> <!-- add for non-threaded runtime also -->
<_NuGetsToBuild Include="$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.Mono.browser-wasm.$(_PackageVersion).nupkg" <_NuGetsToBuild Include="$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.Mono.browser-wasm.$(_PackageVersion).nupkg"
Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj" Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj"
BuildArgs="@(_DefaultPropsForNuGetBuild -> '-p:%(Identity)', ' ')" Properties="@(_DefaultPropsForNuGetBuild, ';')"
Dependencies="$(_DefaultRuntimePackNuGetPath)" Dependencies="$(_DefaultRuntimePackNuGetPath)"
Descriptor="single threaded runtime pack" Descriptor="single threaded runtime pack"
Condition="'$(_DefaultBuildVariant)' != '.'" /> Condition="'$(_DefaultBuildVariant)' != '.'" />
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier> <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Browser'"> <PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<HelixTargetsFile>wasm.helix.targets</HelixTargetsFile>
<WasmXHarnessMonoArgs Condition="'$(ContinuousIntegrationBuild)' != 'true' and '$(UseSubtleCryptoForTests)' == 'true'">$(WasmXHarnessMonoArgs) --setenv=TEST_EXPECT_SUBTLE_CRYPTO=true</WasmXHarnessMonoArgs> <WasmXHarnessMonoArgs Condition="'$(ContinuousIntegrationBuild)' != 'true' and '$(UseSubtleCryptoForTests)' == 'true'">$(WasmXHarnessMonoArgs) --setenv=TEST_EXPECT_SUBTLE_CRYPTO=true</WasmXHarnessMonoArgs>
<WasmXHarnessArgs Condition="'$(ContinuousIntegrationBuild)' != 'true' and '$(UseSubtleCryptoForTests)' == 'true'">$(WasmXHarnessArgs) --web-server-use-cop</WasmXHarnessArgs> <WasmXHarnessArgs Condition="'$(ContinuousIntegrationBuild)' != 'true' and '$(UseSubtleCryptoForTests)' == 'true'">$(WasmXHarnessArgs) --web-server-use-cop</WasmXHarnessArgs>
</PropertyGroup> </PropertyGroup>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<PropertyGroup> <PropertyGroup>
<OutputPath>bin</OutputPath> <OutputPath>bin</OutputPath>
<WasmAppDir>$(MSBuildProjectDirectory)\bin\$(Configuration)\AppBundle\</WasmAppDir> <WasmAppDir>$(MSBuildProjectDirectory)\bin\$(Configuration)\AppBundle\</WasmAppDir>
<WasmXHarnessArgs Condition="'$(WasmEnableThreads)' == 'true' or '$(WasmEnablePerfTracing)' == 'true'">$(WasmXHarnessArgs) --web-server-use-cop</WasmXHarnessArgs>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'"> <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<WasmNativeStrip>false</WasmNativeStrip> <WasmNativeStrip>false</WasmNativeStrip>
......
...@@ -5,6 +5,7 @@ escape_quote = $(subst ",\",$(1)) ...@@ -5,6 +5,7 @@ escape_quote = $(subst ",\",$(1))
ifneq ($(V),) ifneq ($(V),)
MSBUILD_ARGS+=/p:MonoVerboseBuild=true MSBUILD_ARGS+=/p:MonoVerboseBuild=true
MSBUILD_ARGS+=-bl
endif endif
DOTNET=$(TOP)/dotnet.sh DOTNET=$(TOP)/dotnet.sh
......
...@@ -152,7 +152,7 @@ private void ProcessType(Type type) ...@@ -152,7 +152,7 @@ private void ProcessType(Type type)
} }
catch (Exception ex) when (ex is not LogAsErrorException) catch (Exception ex) when (ex is not LogAsErrorException)
{ {
Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0, $"Could not get icall, or callbacks for method '{method.Name}' because '{ex.Message}'"); Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0, $"Could not get icall, or callbacks for method '{type.FullName}::{method.Name}' because '{ex.Message}'");
continue; continue;
} }
......
...@@ -71,7 +71,8 @@ private void CollectPInvokes(List<PInvoke> pinvokes, List<PInvokeCallback> callb ...@@ -71,7 +71,8 @@ private void CollectPInvokes(List<PInvoke> pinvokes, List<PInvokeCallback> callb
} }
catch (Exception ex) when (ex is not LogAsErrorException) catch (Exception ex) when (ex is not LogAsErrorException)
{ {
Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0, $"Could not get pinvoke, or callbacks for method '{method.Name}' because '{ex.Message}'"); Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0,
$"Could not get pinvoke, or callbacks for method '{type.FullName}::{method.Name}' because '{ex.Message}'");
} }
} }
...@@ -301,7 +302,8 @@ private static bool TryIsMethodGetParametersUnsupported(MethodInfo method, [NotN ...@@ -301,7 +302,8 @@ private static bool TryIsMethodGetParametersUnsupported(MethodInfo method, [NotN
if (TryIsMethodGetParametersUnsupported(pinvoke.Method, out string? reason)) if (TryIsMethodGetParametersUnsupported(pinvoke.Method, out string? reason))
{ {
Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0, $"Skipping pinvoke '{pinvoke.Method}' because '{reason}'."); Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0,
$"Skipping pinvoke '{pinvoke.Method.DeclaringType!.FullName}::{pinvoke.Method}' because '{reason}'.");
pinvoke.Skip = true; pinvoke.Skip = true;
return null; return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册