From 7d986fa00cfc93e656e5bc548f244df82c401b59 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Sat, 13 Aug 2022 21:30:30 -0400 Subject: [PATCH] [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 --- eng/pipelines/runtime.yml | 1 - .../testing/helix-extension-example.targets | 0 eng/testing/tests.wasm.targets | 13 ++++++---- eng/testing/workloads-testing.targets | 24 ++++++++++--------- .../System.Security.Cryptography.Tests.csproj | 2 -- src/mono/sample/wasm/Directory.Build.props | 1 + src/mono/wasm/Makefile | 1 + .../WasmAppBuilder/IcallTableGenerator.cs | 2 +- .../WasmAppBuilder/PInvokeTableGenerator.cs | 6 +++-- 9 files changed, 29 insertions(+), 21 deletions(-) rename src/libraries/System.Security.Cryptography/tests/wasm.helix.targets => eng/testing/helix-extension-example.targets (100%) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index dddba18e3d1..882eddc4c2f 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -373,7 +373,6 @@ jobs: - Browser_wasm nameSuffix: _EAT runAOT: false - runSmokeOnlyArg: $(_runSmokeTestsOnlyArg) alwaysRun: ${{ variables.isRollingBuild }} # AOT Library tests diff --git a/src/libraries/System.Security.Cryptography/tests/wasm.helix.targets b/eng/testing/helix-extension-example.targets similarity index 100% rename from src/libraries/System.Security.Cryptography/tests/wasm.helix.targets rename to eng/testing/helix-extension-example.targets diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 398c0b158de..02af8e04189 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -5,10 +5,6 @@ true $(BundleTestAppTargets);BundleTestWasmApp true - - true - - $(NoWarn);IL2118 $([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'emsdk')) @@ -33,6 +29,15 @@ <_UseWasmSymbolicator Condition="'$(TestTrimming)' != 'true'">true + + + true + + $(NoWarn);IL2118 + + $(NoWarn);IL2121 + + helix helix diff --git a/eng/testing/workloads-testing.targets b/eng/testing/workloads-testing.targets index 9fc7e7a1391..5da047758f8 100644 --- a/eng/testing/workloads-testing.targets +++ b/eng/testing/workloads-testing.targets @@ -116,14 +116,9 @@ - <_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" Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App\Microsoft.NETCore.App.Ref.sfxproj" - BuildArgs="@(_DefaultPropsForNuGetBuild -> '-p:%(Identity)', ' ')" + Properties="@(_DefaultPropsForNuGetBuild, ';')" Descriptor="Ref pack"/> @@ -131,10 +126,11 @@ <_PropsForAOTCrossBuild Include="TestingWorkloads=true" /> <_PropsForAOTCrossBuild Include="RuntimeIdentifier=$(NETCoreSdkRuntimeIdentifier)" /> <_PropsForAOTCrossBuild Include="TargetCrossRid=$(RuntimeIdentifier)" /> + <_PropsForAOTCrossBuild Include="DisableSourceLink=true" /> <_NuGetsToBuild Include="$(_AOTCrossNuGetPath)" Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App\Microsoft.NETCore.App.MonoCrossAOT.sfxproj" - BuildArgs="@(_PropsForAOTCrossBuild -> '-p:%(Identity)', ' ')" + Properties="@(_PropsForAOTCrossBuild,';')" Descriptor="AOT Cross compiler"/> @@ -143,7 +139,13 @@ - + + + <_NuGetsToBuild Include="$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.Mono.browser-wasm.$(_PackageVersion).nupkg" Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj" - BuildArgs="@(_DefaultPropsForNuGetBuild -> '-p:%(Identity)', ' ')" + Properties="@(_DefaultPropsForNuGetBuild, ';')" Dependencies="$(_DefaultRuntimePackNuGetPath)" Descriptor="single threaded runtime pack" Condition="'$(_DefaultBuildVariant)' != '.'" /> diff --git a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj index 77429250360..9b95e193b87 100644 --- a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj +++ b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj @@ -14,8 +14,6 @@ $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) - wasm.helix.targets - $(WasmXHarnessMonoArgs) --setenv=TEST_EXPECT_SUBTLE_CRYPTO=true $(WasmXHarnessArgs) --web-server-use-cop diff --git a/src/mono/sample/wasm/Directory.Build.props b/src/mono/sample/wasm/Directory.Build.props index 6db0cf52ee3..924583ae82d 100644 --- a/src/mono/sample/wasm/Directory.Build.props +++ b/src/mono/sample/wasm/Directory.Build.props @@ -15,6 +15,7 @@ bin $(MSBuildProjectDirectory)\bin\$(Configuration)\AppBundle\ + $(WasmXHarnessArgs) --web-server-use-cop false diff --git a/src/mono/wasm/Makefile b/src/mono/wasm/Makefile index 6ee499422d5..151a7d97d62 100644 --- a/src/mono/wasm/Makefile +++ b/src/mono/wasm/Makefile @@ -5,6 +5,7 @@ escape_quote = $(subst ",\",$(1)) ifneq ($(V),) MSBUILD_ARGS+=/p:MonoVerboseBuild=true +MSBUILD_ARGS+=-bl endif DOTNET=$(TOP)/dotnet.sh diff --git a/src/tasks/WasmAppBuilder/IcallTableGenerator.cs b/src/tasks/WasmAppBuilder/IcallTableGenerator.cs index 01d7d0eb447..db530bd57bf 100644 --- a/src/tasks/WasmAppBuilder/IcallTableGenerator.cs +++ b/src/tasks/WasmAppBuilder/IcallTableGenerator.cs @@ -152,7 +152,7 @@ private void ProcessType(Type type) } 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; } diff --git a/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs b/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs index 46073228f67..ebc16138059 100644 --- a/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs +++ b/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs @@ -71,7 +71,8 @@ private void CollectPInvokes(List pinvokes, List callb } 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 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; return null; -- GitLab