Skip to content

fix(ci): Serialize WASM+mobile template build to stop flaky wasm-opt OOM - #23530

Merged
MartinZikmund merged 2 commits into
masterfrom
fix/ci-flaky-templates-wasmopt-oom
Jun 25, 2026
Merged

MartinZikmund merged 2 commits into
masterfrom
fix/ci-flaky-templates-wasmopt-oom

Conversation

@nickrandolph

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #23528

PR Type:

🏗️ Build or CI related changes

What changed? 🚀

build/test-scripts/run-netcore-mobile-template-tests.ps1 now passes /m:1 when building the
uno56droidioswasmskia project template, serializing its inner per-TFM builds.

Why this is the correct fix (diagnosis → fix)

Symptom (flaky): Tests - Templates intermittently fails on the macOS agent while building
uno56droidioswasmskia, with wasm-opt aborting:
emcc : error : '…/wasm-opt … -O2 … dotnet.native.wasm' failed (received SIGABRT (-6)). It is flaky,
not a deterministic break — Tests - Templates passes on every recent master build, so it only
forces a stage re-run occasionally.

Root cause: that template is built with no -f, so dotnet build compiles all of its TFMs
in parallel
(android/ios/maccatalyst/browserwasm/desktop). The loop's $extraArgs already
disables the costly mobile AOT/link and the Uno WASM IL-linker, but it does not affect the
.NET WASM SDK native relink (wasm-opt -O2 over the SkiaSharp/HarfBuzz/ICU WASM statics), which is
memory-heavy and still runs. So wasm-opt -O2 executes concurrently with the other TFM builds, and
under peak memory on the macOS agent it intermittently aborts (SIGABRT).

Why /m:1 is correct (not a band-aid): limiting to one MSBuild node serializes the inner TFM
builds, so wasm-opt runs without competing with the other TFMs for memory. This removes the
contention mechanism rather than retrying past the symptom. It is scoped to the single multi-TFM
template that crashes; the only cost is a slightly longer build for that one template (the mobile TFMs
are already lightweight since AOT/link are disabled, so wasm-opt is the long pole regardless) — far
cheaper than the full-stage re-runs the flake currently triggers.

Alternative considered: lowering the WASM native-relink optimization (wasm-opt -O1/-O0) keeps full
parallelism and shrinks the memory spike, but /m:1 is behaviour we are certain of; the lower-O path
can be a follow-up if more headroom is wanted.

PR Checklist ✅

The uno56droidioswasmskia template (built with no -f) compiles all 5 TFMs in
parallel, so the memory-heavy WASM native relink (wasm-opt -O2 over the
SkiaSharp/HarfBuzz/ICU statics) ran concurrently with the android/ios/maccatalyst
builds and intermittently aborted (SIGABRT) under peak memory on the macOS agent,
flaking Tests-Templates. Add /m:1 to serialize the inner per-TFM builds so
wasm-opt runs without contention.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings June 24, 2026 07:34
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Nick Randolph seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses flaky Tests - Templates failures on macOS by reducing peak memory pressure when building the multi-target uno56droidioswasmskia template, preventing intermittent wasm-opt SIGABRT/OOM during the WASM native relink step.

Changes:

  • Passes /m:1 for the uno56droidioswasmskia template build to serialize its per-TFM builds and avoid concurrent wasm-opt execution with other TFMs.
  • Adds an in-script comment documenting the rationale for the serialization (root cause and why it fixes the flake).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@MartinZikmund
MartinZikmund merged commit 1025f45 into master Jun 25, 2026
64 checks passed
@MartinZikmund
MartinZikmund deleted the fix/ci-flaky-templates-wasmopt-oom branch June 25, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky Tests-Templates: wasm-opt SIGABRT building uno56droidioswasmskia (parallel multi-TFM build OOM on macOS)

5 participants