From 5413f990f6a1be334f6230d85dba45845258725a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 20 Feb 2025 00:10:46 +0100 Subject: [PATCH 1/6] =?UTF-8?q?Revert=20"Revert=20"[browser][MT]=20move=20?= =?UTF-8?q?wasm=20MT=20CI=20legs=20to=20extra-platforms=20(#11269=E2=80=A6?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d6b62982cf0c9e1d2eb420c943d584a6a3636d6e. --- .../runtime-extra-platforms-wasm.yml | 17 ++++++++++++- eng/pipelines/runtime.yml | 25 ------------------- src/mono/wasm/features.md | 2 +- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index f0b197b68db9ac..dd7f5d2a638203 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -74,6 +74,22 @@ jobs: scenarios: - WasmTestOnChrome + # Library tests with full threading + - template: /eng/pipelines/common/templates/wasm-library-tests.yml + parameters: + platforms: + - browser_wasm + #- browser_wasm_win + nameSuffix: _Threading + extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + extraHelixArguments: /p:WasmEnableThreads=true + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + alwaysRun: ${{ parameters.isWasmOnlyBuild }} + shouldRunSmokeOnly: onLibrariesAndIllinkChanges + scenarios: + - WasmTestOnChrome + # EAT Library tests - only run on linux - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml parameters: @@ -162,7 +178,6 @@ jobs: - browser_wasm_win nameSuffix: MultiThreaded extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - condition: ne(variables['wasmMultiThreadedBuildOnlyNeededOnDefaultPipeline'], true) publishArtifactsForWorkload: true publishWBT: false diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 4880c8475743da..7514379d672533 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -822,20 +822,6 @@ extends: scenarios: - WasmTestOnChrome - # Library tests with full threading - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm - #- browser_wasm_win - nameSuffix: _Threading - extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - extraHelixArguments: /p:WasmEnableThreads=true - alwaysRun: ${{ variables.isRollingBuild }} - shouldRunSmokeOnly: onLibrariesAndIllinkChanges - scenarios: - - WasmTestOnChrome - # EAT Library tests - only run on linux - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml parameters: @@ -871,17 +857,6 @@ extends: publishArtifactsForWorkload: true publishWBT: true - - template: /eng/pipelines/common/templates/wasm-build-only.yml - parameters: - platforms: - - browser_wasm - - browser_wasm_win - condition: or(eq(variables.isRollingBuild, true), eq(variables.wasmSingleThreadedBuildOnlyNeededOnDefaultPipeline, true)) - nameSuffix: MultiThreaded - extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - publishArtifactsForWorkload: true - publishWBT: false - # Browser Wasm.Build.Tests - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml parameters: diff --git a/src/mono/wasm/features.md b/src/mono/wasm/features.md index c13dde952952c9..ec00eff02e3d6a 100644 --- a/src/mono/wasm/features.md +++ b/src/mono/wasm/features.md @@ -23,7 +23,7 @@ Some of these properties require a unique build of the runtime, which means that ### Multi-threading -Multi-threading support is enabled by `true`, and is currently disabled by default. It requires a unique build of the runtime. +Multi-threading experiment is enabled by `true`, and is currently disabled by default. It requires a unique build of the runtime. Your HTTPS server and/or proxy must be configured to send HTTP headers similar to `Cross-Origin-Embedder-Policy:require-corp` and `Cross-Origin-Opener-Policy:same-origin` in order to enable multi-threading support in end-user web browsers for security reasons. From d5a29b17fe671ec334c40a744b111a11e030b16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 20 Feb 2025 00:21:26 +0100 Subject: [PATCH 2/6] Only include multithreaded job dependency when we have it --- .../templates/browser-wasm-build-tests.yml | 36 ++++++++++--------- .../runtime-extra-platforms-wasm.yml | 1 + 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/eng/pipelines/common/templates/browser-wasm-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-build-tests.yml index 3bcbec8607cac0..260d6233500557 100644 --- a/eng/pipelines/common/templates/browser-wasm-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-build-tests.yml @@ -7,6 +7,7 @@ parameters: platforms: [] shouldContinueOnError: false extraBuildArgs: '' + includeMultiThreaded: false jobs: @@ -41,10 +42,12 @@ jobs: jobParameters: dependsOn: - ${{ if eq(platform, 'browser_wasm') }}: - - build_browser_wasm_linux_Release_MultiThreaded_BuildOnly + - ${{ if eq(includeMultiThreaded, true) }}: + - build_browser_wasm_linux_Release_MultiThreaded_BuildOnly - build_browser_wasm_linux_Release_SingleThreaded_BuildOnly - ${{ if eq(platform, 'browser_wasm_win') }}: - - build_browser_wasm_windows_Release_MultiThreaded_BuildOnly + - ${{ if eq(includeMultiThreaded, true) }}: + - build_browser_wasm_windows_Release_MultiThreaded_BuildOnly - build_browser_wasm_windows_Release_SingleThreaded_BuildOnly isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} testGroup: innerloop @@ -68,21 +71,22 @@ jobs: CleanTargetFolder: false # Download for multi-threaded - - task: DownloadBuildArtifacts@0 - displayName: Download built nugets for multi-threaded runtime - inputs: - buildType: current - artifactName: BuildArtifacts_browser_wasm_$(_hostedOs)_Release_MultiThreaded_BuildOnly - downloadType: single - downloadPath: '$(Build.SourcesDirectory)/artifacts' + - ${{ if eq(includeMultiThreaded, true) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download built nugets for multi-threaded runtime + inputs: + buildType: current + artifactName: BuildArtifacts_browser_wasm_$(_hostedOs)_Release_MultiThreaded_BuildOnly + downloadType: single + downloadPath: '$(Build.SourcesDirectory)/artifacts' - - task: CopyFiles@2 - displayName: Copy multithreading runtime pack - inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_Release_MultiThreaded_BuildOnly' - Contents: packages/$(_BuildConfig)/Shipping/Microsoft.NETCore.App.Runtime.Mono.multithread.* - TargetFolder: '$(Build.SourcesDirectory)/artifacts' - CleanTargetFolder: false + - task: CopyFiles@2 + displayName: Copy multithreading runtime pack + inputs: + SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_Release_MultiThreaded_BuildOnly' + Contents: packages/$(_BuildConfig)/Shipping/Microsoft.NETCore.App.Runtime.Mono.multithread.* + TargetFolder: '$(Build.SourcesDirectory)/artifacts' + CleanTargetFolder: false # Download WBT - task: DownloadBuildArtifacts@0 diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index dd7f5d2a638203..b1efa94712d877 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -188,6 +188,7 @@ jobs: - browser_wasm - browser_wasm_win extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + includeMultiThreaded: true - template: /eng/pipelines/common/templates/simple-wasm-build-tests.yml parameters: From 9611330dff46e1d3c51a09ed643a79a431437919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 20 Feb 2025 00:25:36 +0100 Subject: [PATCH 3/6] Fixup --- eng/pipelines/common/templates/browser-wasm-build-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/common/templates/browser-wasm-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-build-tests.yml index 260d6233500557..6bd95e644036b5 100644 --- a/eng/pipelines/common/templates/browser-wasm-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-build-tests.yml @@ -42,11 +42,11 @@ jobs: jobParameters: dependsOn: - ${{ if eq(platform, 'browser_wasm') }}: - - ${{ if eq(includeMultiThreaded, true) }}: + - ${{ if eq(parameters.includeMultiThreaded, true) }}: - build_browser_wasm_linux_Release_MultiThreaded_BuildOnly - build_browser_wasm_linux_Release_SingleThreaded_BuildOnly - ${{ if eq(platform, 'browser_wasm_win') }}: - - ${{ if eq(includeMultiThreaded, true) }}: + - ${{ if eq(parameters.includeMultiThreaded, true) }}: - build_browser_wasm_windows_Release_MultiThreaded_BuildOnly - build_browser_wasm_windows_Release_SingleThreaded_BuildOnly isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} @@ -71,7 +71,7 @@ jobs: CleanTargetFolder: false # Download for multi-threaded - - ${{ if eq(includeMultiThreaded, true) }}: + - ${{ if eq(parameters.includeMultiThreaded, true) }}: - task: DownloadBuildArtifacts@0 displayName: Download built nugets for multi-threaded runtime inputs: From d28269f5acf1895d978e024b060a653ee0df5c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 20 Feb 2025 10:28:34 +0100 Subject: [PATCH 4/6] Keep MT build for WBT --- .../templates/browser-wasm-build-tests.yml | 36 +++++++++---------- .../runtime-extra-platforms-wasm.yml | 1 - 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/eng/pipelines/common/templates/browser-wasm-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-build-tests.yml index 6bd95e644036b5..3bcbec8607cac0 100644 --- a/eng/pipelines/common/templates/browser-wasm-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-build-tests.yml @@ -7,7 +7,6 @@ parameters: platforms: [] shouldContinueOnError: false extraBuildArgs: '' - includeMultiThreaded: false jobs: @@ -42,12 +41,10 @@ jobs: jobParameters: dependsOn: - ${{ if eq(platform, 'browser_wasm') }}: - - ${{ if eq(parameters.includeMultiThreaded, true) }}: - - build_browser_wasm_linux_Release_MultiThreaded_BuildOnly + - build_browser_wasm_linux_Release_MultiThreaded_BuildOnly - build_browser_wasm_linux_Release_SingleThreaded_BuildOnly - ${{ if eq(platform, 'browser_wasm_win') }}: - - ${{ if eq(parameters.includeMultiThreaded, true) }}: - - build_browser_wasm_windows_Release_MultiThreaded_BuildOnly + - build_browser_wasm_windows_Release_MultiThreaded_BuildOnly - build_browser_wasm_windows_Release_SingleThreaded_BuildOnly isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} testGroup: innerloop @@ -71,22 +68,21 @@ jobs: CleanTargetFolder: false # Download for multi-threaded - - ${{ if eq(parameters.includeMultiThreaded, true) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download built nugets for multi-threaded runtime - inputs: - buildType: current - artifactName: BuildArtifacts_browser_wasm_$(_hostedOs)_Release_MultiThreaded_BuildOnly - downloadType: single - downloadPath: '$(Build.SourcesDirectory)/artifacts' + - task: DownloadBuildArtifacts@0 + displayName: Download built nugets for multi-threaded runtime + inputs: + buildType: current + artifactName: BuildArtifacts_browser_wasm_$(_hostedOs)_Release_MultiThreaded_BuildOnly + downloadType: single + downloadPath: '$(Build.SourcesDirectory)/artifacts' - - task: CopyFiles@2 - displayName: Copy multithreading runtime pack - inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_Release_MultiThreaded_BuildOnly' - Contents: packages/$(_BuildConfig)/Shipping/Microsoft.NETCore.App.Runtime.Mono.multithread.* - TargetFolder: '$(Build.SourcesDirectory)/artifacts' - CleanTargetFolder: false + - task: CopyFiles@2 + displayName: Copy multithreading runtime pack + inputs: + SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_Release_MultiThreaded_BuildOnly' + Contents: packages/$(_BuildConfig)/Shipping/Microsoft.NETCore.App.Runtime.Mono.multithread.* + TargetFolder: '$(Build.SourcesDirectory)/artifacts' + CleanTargetFolder: false # Download WBT - task: DownloadBuildArtifacts@0 diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index b1efa94712d877..dd7f5d2a638203 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -188,7 +188,6 @@ jobs: - browser_wasm - browser_wasm_win extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - includeMultiThreaded: true - template: /eng/pipelines/common/templates/simple-wasm-build-tests.yml parameters: From b59aa217c6086c4e271c15aecc3cb2aef93bab97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 20 Feb 2025 10:28:52 +0100 Subject: [PATCH 5/6] Remove WASI from runtime.yml too, keep it only in extra-platforms --- eng/pipelines/runtime.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 7514379d672533..77219fc3ec9682 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -876,18 +876,6 @@ extends: # WASI/WASM - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - wasi_wasm - - wasi_wasm_win - nameSuffix: '_Smoke' - extraBuildArgs: /p:EnableAggressiveTrimming=true /p:RunWasmSamples=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - shouldRunSmokeOnly: true - alwaysRun: ${{ variables.isRollingBuild }} - scenarios: - - WasmTestOnWasmtime - - template: /eng/pipelines/common/templates/simple-wasm-build-tests.yml parameters: platforms: From ff22bbabd365a695adc1e33e4f00ded7953ece3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 20 Feb 2025 10:35:08 +0100 Subject: [PATCH 6/6] Keep build-only WBT in runtime.yml --- eng/pipelines/runtime.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 77219fc3ec9682..8fe7d9bfaa0853 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -857,6 +857,17 @@ extends: publishArtifactsForWorkload: true publishWBT: true + - template: /eng/pipelines/common/templates/wasm-build-only.yml + parameters: + platforms: + - browser_wasm + - browser_wasm_win + condition: or(eq(variables.isRollingBuild, true), eq(variables.wasmSingleThreadedBuildOnlyNeededOnDefaultPipeline, true)) + nameSuffix: MultiThreaded + extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + publishArtifactsForWorkload: true + publishWBT: false + # Browser Wasm.Build.Tests - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml parameters: