Skip to content

Commit

Permalink
[wasm] Add workaround for msbuild issue
Browse files Browse the repository at this point in the history
.. which causes it to crash. The issue is described in
dotnet/sdk#26965 besides other issues.

This can be removed once the sdk has a fix for this.
  • Loading branch information
radical committed Sep 16, 2022
1 parent b707fd6 commit e3e315d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@
<SetScriptCommands Condition="'$(JSEngine)' != ''" Include="export JS_ENGINE=--engine=$(JSEngine)" />
<SetScriptCommands Condition="'$(JSEngineArgs)' != ''" Include="export JS_ENGINE_ARGS=$(JSEngineArgs)" />
<SetScriptCommands Condition="'$(_WasmMainJSFileName)' != ''" Include="export MAIN_JS=--js-file=$(_WasmMainJSFileName)" />
<SetScriptCommands Condition="'$(BuildAOTTestsOnHelix)' == 'true'" Include="export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1" />
</ItemGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<SetScriptCommands Condition="'$(Scenario)' != '' and '$(ContinuousIntegrationBuild)' != 'true'" Include="set &quot;SCENARIO=$(Scenario)&quot;" />
<SetScriptCommands Condition="'$(JSEngine)' != ''" Include="set &quot;JS_ENGINE=--engine^=$(JSEngine)&quot;" />
<SetScriptCommands Condition="'$(JSEngineArgs)' != ''" Include="set &quot;JS_ENGINE_ARGS=$(JSEngineArgs)&quot;" />
<SetScriptCommands Condition="'$(_WasmMainJSFileName)' != ''" Include="set &quot;MAIN_JS=--js-file^=$(_WasmMainJSFileName)&quot;" />
<SetScriptCommands Condition="'$(BuildAOTTestsOnHelix)' == 'true'" Include="set DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1" />
</ItemGroup>

<PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/mono/wasm/Wasm.Build.Tests/DotNetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public DotNetCommand(BuildEnvironment buildEnv, ITestOutputHelper _testOutput, b
_useDefaultArgs = useDefaultArgs;
if (useDefaultArgs)
WithEnvironmentVariables(buildEnv.EnvVars);
// workaround msbuild issue
WithEnvironmentVariables("DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER", "1");
}

protected override string GetFullArgs(params string[] args)
Expand Down
2 changes: 2 additions & 0 deletions src/mono/wasm/Wasm.Build.Tests/RunCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ public RunCommand(BuildEnvironment buildEnv, ITestOutputHelper _testOutput, stri
WithEnvironmentVariable("DOTNET_INSTALL_DIR", Path.GetDirectoryName(buildEnv.DotNet)!);
WithEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0");
WithEnvironmentVariable("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "1");
// workaround msbuild issue
WithEnvironmentVariable("DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER", "1");
}
}
3 changes: 3 additions & 0 deletions src/tests/Common/CLRTest.Execute.Bash.targets
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ else
__Command+=" dotnet"
fi
# workaround msbuild issue
export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1
$__Command msbuild $CORE_ROOT/wasm-test-runner/WasmTestRunner.proj /p:NetCoreAppCurrent=$(NetCoreAppCurrent) /p:TestAssemblyFileName=$(MsBuildProjectName).dll /p:TestBinDir=`pwd` $(CLRTestMSBuildArgs) || exit $?
]]>
Expand Down

0 comments on commit e3e315d

Please sign in to comment.