[wasm] Work around NuGet-Migrations issue (#83832)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 24 Mar 2023 17:27:43 +0000 (18:27 +0100)
committerGitHub <noreply@github.com>
Fri, 24 Mar 2023 17:27:43 +0000 (13:27 -0400)
Like https://github.com/dotnet/runtime/pull/83833 but also includes wasi jobs.

See https://github.com/dotnet/runtime/issues/80619

eng/testing/tests.browser.targets
src/mono/wasm/Wasm.Build.Tests/data/RunScriptTemplate.sh

index 2062e8b..0942afc 100644 (file)
     <_XHarnessArgs Condition="'$(_XHarnessTestsTimeout)' != ''   " >$(_XHarnessArgs) &quot;--timeout=$(_XHarnessTestsTimeout)&quot;</_XHarnessArgs>
     <_XHarnessArgs Condition="'$(WasmXHarnessArgsCli)' != ''"      >$(_XHarnessArgs) $(WasmXHarnessArgsCli)</_XHarnessArgs>
 
-    <!-- Works around https://github.com/dotnet/runtime/issues/80619 -->
-    <_NugetWorkAroundCommand>dotnet new console</_NugetWorkAroundCommand>
-
     <!-- There two flavors of WasmXHarnessArgs and WasmXHarnessMonoArgs, one is MSBuild property and the other is environment variable -->
-    <RunScriptCommand Condition="'$(OS)' != 'Windows_NT'">$(_NugetWorkAroundCommand) $(_ShellCommandSeparator) $HARNESS_RUNNER $(_XHarnessArgs) %24XHARNESS_ARGS %24WasmXHarnessArgs -- $(WasmXHarnessMonoArgs) %24WasmXHarnessMonoArgs $(_AppArgs) %24WasmTestAppArgs</RunScriptCommand>
-    <RunScriptCommand Condition="'$(OS)' == 'Windows_NT'">$(_NugetWorkAroundCommand) $(_ShellCommandSeparator) %HARNESS_RUNNER% $(_XHarnessArgs) %XHARNESS_ARGS% %WasmXHarnessArgs%  -- $(WasmXHarnessMonoArgs) %WasmXHarnessMonoArgs% $(_AppArgs) %WasmTestAppArgs%</RunScriptCommand>
+    <RunScriptCommand Condition="'$(OS)' != 'Windows_NT'">$HARNESS_RUNNER $(_XHarnessArgs) %24XHARNESS_ARGS %24WasmXHarnessArgs -- $(WasmXHarnessMonoArgs) %24WasmXHarnessMonoArgs $(_AppArgs) %24WasmTestAppArgs</RunScriptCommand>
+    <RunScriptCommand Condition="'$(OS)' == 'Windows_NT'">%HARNESS_RUNNER% $(_XHarnessArgs) %XHARNESS_ARGS% %WasmXHarnessArgs%  -- $(WasmXHarnessMonoArgs) %WasmXHarnessMonoArgs% $(_AppArgs) %WasmTestAppArgs%</RunScriptCommand>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(BuildAOTTestsOnHelix)' == 'true'">
index 6920f6d..5ba72df 100644 (file)
@@ -1,5 +1,8 @@
 #!/usr/bin/env bash
 
+# create dummy console app to workaround https://github.com/dotnet/runtime/issues/80619
+(CONSOLE_TEMP_DIR="$(mktemp -d)"; "$DOTNET_ROOT/dotnet" new console -o "$CONSOLE_TEMP_DIR"; rm -rf "$CONSOLE_TEMP_DIR") || true
+
 set
 echo "------------------------ start -------------------"