Skip to content

ci: fix the native builds - #183

Merged
triniwiz merged 25 commits into
masterfrom
fix/ci-native-builds
Nov 8, 2026
Merged

triniwiz merged 25 commits into
masterfrom
fix/ci-native-builds

Conversation

@triniwiz

@triniwiz triniwiz commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

The Canvas Native workflow has failed on every run since v3 (#152). The causes were layered, so fixing one exposed the next:

Job Failure Fix
Canvas / Canvas SVG / AudioContext Android setup-android@v3 runs sdkmanager tools; cmdline-tools 16 has no tools package setup-android@v4
Canvas / Canvas SVG Android The action pointed the Rust build at NDK 29, API 21, overriding the NDK 28.2 / API 23 pin in build-android.sh (Skia's ICU needs posix_madvise) Rust uses NDK 28.2 at API 23; NDK 29 is also installed for the gradle CMake builds
Canvas / Canvas SVG Android bindgen loaded the runner's libclang 15; NDK 28's libc++ needs Clang 16+ LIBCLANG_PATH points at the NDK's own libclang
Canvas / Canvas SVG Android i686 layout assertions fail (100_usize - 104_usize). The rust-skia fork restores the alignment of opaque blobs by matching bindgen's formatted output, and with no rustfmt (minimal profile) bindgen leaves its output unformatted Install the rustfmt component
Canvas SVG Android CMake: canvas's libNativeScript.so stub and V8 headers are missing; only the canvas job prepared them Run download-v8.sh and build-android-v8-stub.sh in the SVG job too
AudioContext Android CMake: third_party/oboe is empty Check out submodules (Oboe)
Canvas iOS, Canvas SVG iOS pre-build.sh: cbindgen: command not found cargo install [email protected] in setup-apple-native
AudioContext iOS 'opusfile.h' file not found: third_party/build is gitignored and only exists locally Build it with build_opus_deps_ios.sh, cached on that script and the fetch script
Canvas Windows (x64) device-lost.test.mjs passes, then its process exits with 2170 (0x87A, FACILITY_DXGI), even with every RemoveDevice skipped The file skips when GITHUB_ACTIONS is set. Root cause still open, see below.

Still open: device-lost.test.mjs on the runners

The runner adapter is "Microsoft Basic Render Driver" (WARP), and the 2170 exit happens with no device removal, so the cause is something else in that file. Never exercised by any other suite: __setContextLostListener, restoreContext, isContextLost, and a 2D context presented into a headless panel. Also, __d3dAdapterInfo().isWarp is false on that adapter: it is not flagged DXGI_ADAPTER_FLAG_SOFTWARE, so hardware_device() takes it.

The first runs on this branch tried a nightly pin (commit, then revert). It turned out not to be the cause of the i686 failure.

- Android: setup-android@v4 (v3 installs the 'tools' package, gone from
  cmdline-tools 16). The Rust crates build with NDK 28.2 at API 23, as
  build-android.sh pins (Skia's ICU and posix_madvise); NDK 29 is still
  installed for the gradle CMake builds.
- Canvas / SVG iOS: install cbindgen 0.29.0; the Xcode pre-build phases
  regenerate the C headers with it.
- AudioContext iOS: build the gitignored ogg/vorbis/opus/opusfile libs
  (cached on their scripts) before the framework.
- Windows: skip the device-removal tests on WARP. There the process exits
  with 2170 (FACILITY_DXGI) once they pass.
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ebbc17aa-4d37-46b0-a54f-eaa78fb4ec8d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Comment thread .github/workflows/build-native.yml Fixed
…isWarp

Their adapter is not flagged software, so isWarp is false there.
The latest nightly (1.101, 2026-10-08) lays out i686-android structs unlike
the bindgen output skia-bindings checks them against. Pin nightly-2026-01-25,
the toolchain the shipped libraries are built with. The Makefile and the
Android / SVG build scripts take it from CANVAS_RUST_TOOLCHAIN, as
canvas-ios/pre-build.sh already did.
…tHub runners

skia-bindings restores the 8-byte alignment of i686 opaque blobs by
matching bindgen's formatted output, and bindgen leaves its output
unformatted without rustfmt (the minimal profile has none): the layout
assertions then fail on i686-linux-android.

device-lost.test.mjs still exits with 2170 with its removals skipped, so
skip the whole file on the runners.
…stub

canvassvg's CMake links canvas's build-time libNativeScript.so and
includes its V8 headers, which only the canvas job prepared.
Comment thread .github/workflows/build-native.yml Fixed
@github-actions

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

1 similar comment
@github-actions

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Comment thread .github/workflows/build-native.yml Fixed
…caching of untrusted files'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Comment thread .github/workflows/build-native.yml Fixed
@github-actions

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

1 similar comment
@github-actions

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

…caching of untrusted files'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

- Linux x64 and arm64 build every package's .node with tools/scripts/build-linux.sh on
  Ubuntu 22.04 runners (glibc 2.35, GTK 4.6, clang 18), then run the canvas, canvas-svg
  and audio-context Node-API tests on Mesa.
- canvas-gamepad's Windows modules join the napi-windows matrix.
- Every job checks out inputs.ref. On manual runs the Windows jobs built the default
  branch and Canvas SVG Android built github.ref, whatever ref was asked for.
- Artifact caches are restored only when no ref is given and the run is not manual.
- tools/scripts/place-native-artifacts.sh puts a download of every artifact in the tree
  and fails if one is missing.
npm Release calls build-native.yml on the release tag, with no cache, and places its
artifacts over the committed ones before packaging. Only the AARs with no sources in
this repo (canvas-media, canvas-gamepad, canvas-polyfill) still ship as committed.
Comment thread .github/workflows/build-native.yml Fixed
Comment thread .github/workflows/build-native.yml Fixed
Re-applies e4899d0 (reverted in 57f9567), now so the Skia cache stays valid: a cached
build is only reusable with the compiler that made it, and an unpinned nightly changes daily.
nightly-2026-01-25 is the toolchain the shipped libraries are built with. Local builds still
default to `nightly` through CANVAS_RUST_TOOLCHAIN.
…s-gamepad

- .github/actions/skia-cache keeps the Skia libraries skia-bindings builds, per target and
  feature set, in rust-skia's prebuilt-binaries format. With an exact hit skia-bindings
  installs them instead of building Skia. A cargo shim files each build's export under its
  rust-skia key. Saved only by pushes to master.
- build-native.yml has no ref input: every job builds the commit that triggered the run.
  npm Release is dispatched on the release tag, so its runs restore master's caches but
  save only into the tag's scope. A ref checked out from master's scope could have
  rewritten what master restores (CodeQL: cache poisoning).
- The cache guards for manual and explicit-ref runs are gone with that input.
- The unit-test target cache (~1.8 GB an entry) is saved only by master.
- canvas-gamepad is published by npm Release and the master prerelease.
canvas_gamepad.aar, canvas_media.aar and canvas_polyfill.aar are what the CLI builds from
each plugin's platforms/android sources during an app build. They are now gitignored.
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

…aster

Each pull request saved three ~1.3 GB registry caches, enough to evict master's Skia
entries from the 10 GB budget. No Cargo.lock is committed, so the key hashes the manifests
instead of the empty hash it had.
…stores; revert before merge"

This reverts commit 5747708.
They pin the NDK, the toolchains and clang that a cached Skia was built with. Hashing all of
.github/actions meant any edit there, even to this action, threw away every entry.
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

1 similar comment
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

@triniwiz
triniwiz marked this pull request as ready for review November 8, 2026 03:16
@triniwiz
triniwiz merged commit 5bf388f into master Nov 8, 2026
27 checks passed
@triniwiz
triniwiz deleted the fix/ci-native-builds branch November 8, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants