Skip to content

Commit 87f8d0a

Browse files
[release/7.0] [wasm] Add workaround for msbuild issue in tests (#76090)
* [wasm] Add workaround for msbuild issue .. 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. * fix build * Add workaround for perf pipeline * Add issue url Co-authored-by: Ankit Jain <[email protected]>
1 parent 6f028dc commit 87f8d0a

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

eng/pipelines/coreclr/templates/run-performance-job.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
sudo apt-get update &&
9090
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates &&
9191
$(HelixPreCommandsWasmOnLinux) &&
92+
export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 &&
9293
export PERFLAB_UPLOAD_TOKEN="$(HelixPerfUploadTokenValue)"
9394
|| export PERF_PREREQS_INSTALL_FAILED=1;
9495
test "x$PERF_PREREQS_INSTALL_FAILED" = "x1" && echo "** Error: Failed to install prerequites **"

eng/testing/performance/microbenchmarks.proj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
<Python>python3</Python>
3535
<CoreRun>$(BaseDirectory)/Core_Root/corerun</CoreRun>
3636
<BaselineCoreRun>$(BaseDirectory)/Baseline_Core_Root/corerun</BaselineCoreRun>
37-
<HelixPreCommands>$(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh</HelixPreCommands>
37+
<!-- Set DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 as a workaround for https://github.com/dotnet/runtime/issues/74328 -->
38+
<HelixPreCommands>$(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh;export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1</HelixPreCommands>
3839
<ArtifactsDirectory>$HELIX_WORKITEM_ROOT/artifacts/BenchmarkDotNet.Artifacts</ArtifactsDirectory>
3940
<BaselineArtifactsDirectory>$HELIX_WORKITEM_ROOT/artifacts/BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>
4041
<ResultsComparer>$(PerformanceDirectory)/src/tools/ResultsComparer/ResultsComparer.csproj</ResultsComparer>

eng/testing/tests.wasm.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,16 @@
6060
<SetScriptCommands Condition="'$(JSEngine)' != ''" Include="export JS_ENGINE=--engine=$(JSEngine)" />
6161
<SetScriptCommands Condition="'$(JSEngineArgs)' != ''" Include="export JS_ENGINE_ARGS=$(JSEngineArgs)" />
6262
<SetScriptCommands Condition="'$(_WasmMainJSFileName)' != ''" Include="export MAIN_JS=--js-file=$(_WasmMainJSFileName)" />
63+
<!-- Workaround for https://github.com/dotnet/runtime/issues/74328 -->
64+
<SetScriptCommands Condition="'$(BuildAOTTestsOnHelix)' == 'true'" Include="export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1" />
6365
</ItemGroup>
6466
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
6567
<SetScriptCommands Condition="'$(Scenario)' != '' and '$(ContinuousIntegrationBuild)' != 'true'" Include="set &quot;SCENARIO=$(Scenario)&quot;" />
6668
<SetScriptCommands Condition="'$(JSEngine)' != ''" Include="set &quot;JS_ENGINE=--engine^=$(JSEngine)&quot;" />
6769
<SetScriptCommands Condition="'$(JSEngineArgs)' != ''" Include="set &quot;JS_ENGINE_ARGS=$(JSEngineArgs)&quot;" />
6870
<SetScriptCommands Condition="'$(_WasmMainJSFileName)' != ''" Include="set &quot;MAIN_JS=--js-file^=$(_WasmMainJSFileName)&quot;" />
71+
<!-- Workaround for https://github.com/dotnet/runtime/issues/74328 -->
72+
<SetScriptCommands Condition="'$(BuildAOTTestsOnHelix)' == 'true'" Include="set DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1" />
6973
</ItemGroup>
7074

7175
<PropertyGroup>

src/tests/BuildWasmApps/Wasm.Build.Tests/DotNetCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public DotNetCommand(BuildEnvironment buildEnv, ITestOutputHelper _testOutput, b
1616
_useDefaultArgs = useDefaultArgs;
1717
if (useDefaultArgs)
1818
WithEnvironmentVariables(buildEnv.EnvVars);
19+
// workaround msbuild issue - https://github.com/dotnet/runtime/issues/74328
20+
WithEnvironmentVariable("DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER", "1");
1921
}
2022

2123
protected override string GetFullArgs(params string[] args)

src/tests/BuildWasmApps/Wasm.Build.Tests/RunCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ public RunCommand(BuildEnvironment buildEnv, ITestOutputHelper _testOutput, stri
1414
WithEnvironmentVariable("DOTNET_INSTALL_DIR", Path.GetDirectoryName(buildEnv.DotNet)!);
1515
WithEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0");
1616
WithEnvironmentVariable("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "1");
17+
// workaround msbuild issue - https://github.com/dotnet/runtime/issues/74328
18+
WithEnvironmentVariable("DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER", "1");
1719
}
1820
}

src/tests/Common/CLRTest.Execute.Bash.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ else
286286
__Command+=" dotnet"
287287
fi
288288
289+
# workaround msbuild issue - https://github.com/dotnet/runtime/issues/74328
290+
export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1
291+
289292
$__Command msbuild $CORE_ROOT/wasm-test-runner/WasmTestRunner.proj /p:NetCoreAppCurrent=$(NetCoreAppCurrent) /p:TestAssemblyFileName=$(MsBuildProjectName).dll /p:TestBinDir=`pwd` $(CLRTestMSBuildArgs) || exit $?
290293
291294
]]>

0 commit comments

Comments
 (0)