Skip to content

Commit

Permalink
Merge pull request #772 from unoplatform/dev/eb/threading
Browse files Browse the repository at this point in the history
fix: Initialize threaded runtime properly in AotInterp mode
  • Loading branch information
ebariche authored Sep 12, 2023
2 parents feb2f32 + 9bb4ce0 commit ef10bb7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 39 deletions.
31 changes: 13 additions & 18 deletions .vsts-ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,19 @@ jobs:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
### Threads AOT validation
#- bash: |
# cd $(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot
# dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
# dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true "/p:WasmShellWebAppBasePath=/"
# displayName: Build Threads AOT test
#
#- bash: |
# $(build.sourcesdirectory)/build/scripts/run-tests.sh \
# "$(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot/bin/Release/net6.0/dist" \
# "$(build.sourcesdirectory)/src/Uno.Wasm.Threading.UITests" "http://localhost:8000/"
# displayName: Threading AOT UI Tests
# env:
# BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
#
# Disabled for the following error: https://github.com/unoplatform/Uno.Wasm.Bootstrap/issues/724
# BROWSER LOG: Aborted(Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module,
# but after startup the value is only looked for on a local variable of that name))

- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot
dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true "/p:WasmShellWebAppBasePath=/"
displayName: Build Threads AOT test
- bash: |
$(build.sourcesdirectory)/build/scripts/run-tests.sh \
"$(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot/bin/Release/net6.0/dist" \
"$(build.sourcesdirectory)/src/Uno.Wasm.Threading.UITests" "http://localhost:8000/"
displayName: Threading AOT UI Tests
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
## SWA sub-path validation
- bash: |
Expand Down
34 changes: 15 additions & 19 deletions .vsts-ci-windows-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,25 +238,21 @@ jobs:
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
# # Thread AOT test
# - pwsh: |
# cd $(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot
# dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
# dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true /p:WasmShellEmccLinkOptimization=false /bl:$(build.artifactstagingdirectory)/sample.threads-win.binlog
# displayName: Build Threading AOT Sample

# - pwsh: |
# $(build.sourcesdirectory)\build\scripts\run-tests-windows.ps1 `
# "$(build.sourcesdirectory)\src\Uno.Wasm.Threads.Aot\bin\Release\net6.0\dist" `
# "$(build.sourcesdirectory)\src\Uno.Wasm.Threading.UITests" `
# "http://localhost:8000/"
# displayName: Threading AOT Tests
# env:
# BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
#
# Disabled for the following error: https://github.com/unoplatform/Uno.Wasm.Bootstrap/issues/724
# BROWSER LOG: Aborted(Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module,
# but after startup the value is only looked for on a local variable of that name))
# Thread AOT test
- pwsh: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot
dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true /p:WasmShellEmccLinkOptimization=false /bl:$(build.artifactstagingdirectory)/sample.threads-win.binlog
displayName: Build Threading AOT Sample
- pwsh: |
$(build.sourcesdirectory)\build\scripts\run-tests-windows.ps1 `
"$(build.sourcesdirectory)\src\Uno.Wasm.Threads.Aot\bin\Release\net6.0\dist" `
"$(build.sourcesdirectory)\src\Uno.Wasm.Threading.UITests" `
"http://localhost:8000/"
displayName: Threading AOT Tests
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
- task: PublishBuildArtifacts@1
condition: always()
Expand Down
2 changes: 0 additions & 2 deletions src/Uno.Wasm.Packager/packager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1195,11 +1195,9 @@ int Run (string[] args) {
if (enable_threads)
{
emcc_link_flags.Add("-s USE_PTHREADS=1");
emcc_link_flags.Add("-s PTHREAD_POOL_SIZE=2");
emcc_link_flags.Add("-Wno-pthreads-mem-growth");

emcc_flags += "-s USE_PTHREADS=1 ";
emcc_flags += "-s PTHREAD_POOL_SIZE=2 ";
emcc_flags += "-Wno-pthreads-mem-growth ";

aot_compiler_options += " --wasm-gc-safepoints ";
Expand Down

0 comments on commit ef10bb7

Please sign in to comment.