From e6163a042bcaa0ea2a81cdfee7e97cf6907e37be Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 4 May 2021 18:05:36 -0400 Subject: [PATCH] [wasm] Fix Emscripten SDK provisioning for tests - For running on AOT tests on helix, we need to send emsdk as a payload - On the CI machines, emscripten is available in `/usr/local/emscripten/` - but the helix tasks try to write a `.payload` file in that dir, which fails because of permissions - So, we copy emsdk to local `src/mono/wasm/emsdk` - But we were doing it as part of *every* test build! - this meant unncessarily copying, and races causing errors like: ``` /__w/1/s/eng/testing/tests.wasm.targets(138,5): error MSB3026: Could not copy "/usr/local/emscripten/emsdk/node/14.15.5_64bit/bin/node" to "/__w/1/s/src/mono/wasm/emsdk/node/14.15.5_64bit/bin/node". Beginning retry 1 in 1000ms. The process cannot access the file '/__w/1/s/src/mono/wasm/emsdk/node/14.15.5_64bit/bin/node' because it is being used by another process. [/__w/1/s/src/libraries/System.Collections.Specialized/tests/System.Collections.Specialized.Tests.csproj] ``` - Instead, do that once when preparing work items for helix Fixes https://github.com/dotnet/runtime/issues/52254 . --- eng/testing/tests.wasm.targets | 17 ----------------- src/libraries/sendtohelixhelp.proj | 21 ++++++++++++++++++++- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index e302af8a7d59b5..5d6c2e626eab70 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -65,11 +65,8 @@ PrepareForWasmBuildApp;$(WasmBuildAppDependsOn) - $([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'emsdk')) WasmBuildApp - StageEmSdkForHelix - $(BundleTestWasmAppDependsOn);_BundleAOTTestWasmAppForHelix @@ -124,20 +121,6 @@ - - - - - - - - - - - - $(BundleDir) diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index d326ebfae53103..3fc915089df2cc 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -200,7 +200,7 @@ such as the HelixWorkItem item group) before Helix "Test" target is invoked (as a normal target). --> - + @@ -320,6 +320,25 @@ + + + + + + $([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'emsdk')) + + + + <_EmSdkFiles Include="$(EMSDK_PATH)\**\*" Exclude="$(EMSDK_PATH)\.git\**\*" /> + + + + + +