Skip to content

Add opt-in Linux RISC-V runner builds - #294

Draft
florentianayuwono wants to merge 5 commits into
mainfrom
riscv-dotnet10
Draft

florentianayuwono wants to merge 5 commits into
mainfrom
riscv-dotnet10

Conversation

@florentianayuwono

@florentianayuwono florentianayuwono commented Nov 24, 2026 •

Copy link
Copy Markdown

Summary

• patches/runner-main-sdk8-riscv64.patch — Adds RISC-V architecture, build, .NET 10 and Node 24 support to the mirrored upstream main source.
• patches/runner-sdk8-riscv64.patch — Equivalent changes for upstream release v2.338.2. Legacy Node 12/16/20 requests fall back to Node 24 on RISC-V; the RISC-V package does not bundle Node 20.
• patches/patch-sync-l0.patch — Adds workflow regression tests to an existing upstream test file. It is maintained separately and is not automatically synchronized by the architecture patch workflows.
• .github/workflows/build.yml — Adds the opt-in RISC-V build and tests, installs the checksum-pinned community SDK, applies patches and guards against bundling Node 20.
• .github/workflows/release.yml — Adds opt-in RISC-V build, packaging, checksum validation and release asset publishing.
• .github/workflows/patch_update_main.yml — Synchronizes the main RISC-V patch using its own upstream commit marker.
• .github/workflows/patch_update_release.yml — Synchronizes the release RISC-V patch using its own release-tag marker.
• .github/release-note-canonical.md — Documents prerequisites, build steps, feature flag and limitations, including disabling automatic runner updates.

Validation

  • Merged-main x64 L0: 1,193 passed, including 28 workflow regression cases. An earlier run hit the pre-existing ProcessExtensionL0.SuccessReadProcessEnv race documented on main; that test passed in isolation and on retry.
  • RISC-V-target L0 on an x64 host: the 28 workflow regression cases passed with the current patches. An earlier full run passed 1,165 tests; other full runs hit the same process-environment race.
  • Release-patch Node compatibility tests on an x64 host: 68 passed.
  • Main and L0 test patches apply together to the exact upstream base, and the release and L0 test patches apply together to v2.338.2. The main patch also applies to merged Canonical main; workflows pass actionlint.
  • Cross-built the RISC-V layout with community runtime packs, verified the archive contains Node 24 and no Node 20, and checked that a corrupt Node download is rejected.
  • QEMU ran Runner.Listener --version with invariant globalization and Node 24's hashFiles with --jitless. Default Node V8 JIT segfaulted under QEMU 8.2.

Native RISC-V execution, a live GitHub Actions job, and CI/release publishing on a native builder remain unverified.

florentianayuwono and others added 2 commits November 24, 2026 16:04
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the architecture patches for the current upstream source and keep RISC-V packages on Node 24 only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@florentianayuwono florentianayuwono self-assigned this Nov 25, 2026
florentianayuwono and others added 3 commits November 26, 2026 14:26
Keep optional RISC-V sync from blocking existing architectures when disabled, and use its own patch baseline when enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Match GitHub Actions string comparison when deciding whether to synchronize the optional RISC-V patches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move workflow regressions into a patch against an existing upstream test file, inline the fork-specific helpers, and preserve x64 CI when optional tests become stale.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Native RISC-V execution, GitHub Actions acceptance of RISCV64 metadata, runtime behavior, and end-to-end CI/release publishing remain unverified and require human validation on a native builder.

No open issues 🎉

What changed in this PR

Adds experimental, opt-in Linux RISC-V runner builds to the fork’s existing architecture-patch system, covering mirrored upstream main and release sources.

Changes:

  • Adds RISC-V architecture support using community .NET 10 and Node 24, including legacy Node request fallback for release builds.
  • Extends CI and release workflows with checksum-pinned SDK installation, L0 tests, package validation and asset publishing.
  • Adds independent RISC-V patch baselines, workflow regression tests and setup documentation.

Native execution, live GitHub Actions jobs and native CI/release publishing remain unverified.

File Description
patches/​runner-sdk8-riscv64.patch Adds release-source RISC-V support, Node 24 fallback and compatibility tests.
patches/​runner-main-sdk8-riscv64.patch Adds main-source RISC-V architecture, runtime and build support.
patches/​patch-sync-l0.patch Adds regression tests for workflow gates, patch baselines and SDK checksum rejection.
.github/​workflows/​release.yml Adds opt-in RISC-V builds, tests, packaging and release assets.
.github/​workflows/​patch_update_release.yml Synchronizes the enabled RISC-V patch from its own release marker.
.github/​workflows/​patch_update_main.yml Synchronizes the enabled RISC-V patch from its own commit marker.
.github/​workflows/​build.yml Adds opt-in RISC-V CI and workflow regression-test integration.
.github/​release-note-canonical.md Documents prerequisites, build steps, opt-in controls and operational limitations.

Review effort: Balanced

@cbartz cbartz assigned cbartz and unassigned florentianayuwono Nov 27, 2026
@cbartz

cbartz commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Tested this end to end on real riscv64 hardware: the runner registers, picks up jobs and runs them, but the bundled Node 24.22.3 segfaults as soon as JavaScript runs for long, so every JavaScript action crashes. The fix is in Node 24.23.0; we'll wait for its riscv64 build and bump NODE24_VERSION rather than work around it here.

Node issue

  • Every riscv64 Node build from v24.22.0 onwards crashes in Runtime_InstallBaselineCode the first time V8's Sparkplug compiler tiers up a function. v24.21.0 is fine. It reproduces under qemu-user as well as on hardware, so it is not specific to the CPU.
  • Cause: Node 24.22.0 backported V8 0b94a9fd23ba, whose riscv64 hunk of GenerateTailCallToReturnedCode drops the argument pushed for CallRuntime(fn, 1). V8 fixed it two days later in ec2f506f97df, which Node didn't take at the time.
  • Fix: [v24.x] deps: V8: cherry-pick ec2f506f97df nodejs/node#67430 cherry-picks ec2f506f97df, and it is in the v24.23.0 release proposal (2026-11-30, Version 24.23.0 'Krypton' (LTS) nodejs/node#67663, planned for 2026-11-30). The riscv64 binary will then come from unofficial-builds.
  • node --version and trivial scripts exit before Sparkplug kicks in, which is why the current package test doesn't catch this.
  • No good interim option: --no-sparkplug avoids the crash, but Node rejects it in NODE_OPTIONS, so it would need a wrapper around bin/node. Pinning back to 24.21.0 would drop two security releases (24.22.1, 24.22.3).

What was tested

  • Build: the package was cross-built on amd64 from f6e8bc8 (amd64 .NET SDK 10.0.115, plus the riscv64 runtime packs from the community SDK). The runner projects don't use ReadyToRun, so the IL matches a native build, and all native bits come from the community runtime.
  • Hardware: a SpacemiT K3 board running Bianbu 4.0.1 (kernel 6.18, 8 harts).
  • Shell-only workflows: pass.
  • JavaScript actions: to check the rest of the stack, a temporary build wrapped node with --no-sparkplug (note: the wrapper has to be bash -p, because dash drops env vars like INPUT_GITHUB-TOKEN). With it, actions/checkout@v4, actions/github-script@v7 and hashFiles() all pass, including the node20→node24 fallback. 10 more runs (20 jobs) passed back to back.

Suggestions

  • Package test: have the riscv64 package test run real JavaScript, not just --version. Something like node -e 'let s=0;for(let i=0;i<5e6;i++)s+=i' would have caught this.
  • Self-update: the runner tried to self-update to 2.338.2 (no riscv64 package exists, so it failed harmlessly). Should riscv64 runners be documented as needing --disableupdate, so an update can't replace the custom build?
  • Listener crash, FYI: we saw one Runner.Listener SIGSEGV (exit 139) mid-job, with nothing in the managed logs. Most likely it is in the community riscv64 .NET runtime. It hasn't recurred in 20+ jobs since, and crash dumps are enabled to catch it if it does.

AI-generated message.

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.

3 participants