Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

#82: a windows-arm64 zip: RAEA_WIN_ARCH=arm64 has onnxruntime.sh and win-bundle.sh take the ARM64 runtime, VC++ CRT, uv and DXC (FFmpeg stays x64, run emulated), release.sh names and packs raea-VERSION-windows-arm64.zip, and windows-arm.yml packs and checks it on WARP

shinyobjectz1905dc723c64
diff --git a/.github/workflows/windows-arm.yml b/.github/workflows/windows-arm.yml
index ed07f9b2..19b76172 100644
--- a/.github/workflows/windows-arm.yml
+++ b/.github/workflows/windows-arm.yml
@@ -10,6 +10,9 @@ on:
ref:
description: "commit, branch or tag to build"
required: false
+ version:
+ description: "the version the zip is named for (raea-VERSION-windows-arm64.zip)"
+ required: false
push:
branches: [windows-arm64]
@@ -93,6 +96,34 @@ jobs:
TSX
(cd "$d" && "$GITHUB_WORKSPACE/target/dist/raea.exe" render still.tsx -o still.png --frame 0 --w 1280 --h 720) 2>&1 | tail -20
ls -la "$d"/still.png
+ - name: Models (pinned by URL and sha256 in tools/release/models.tsv)
+ run: |
+ while IFS=$'\t' read -r path url sha; do
+ case $path in ''|'#'*) continue ;; esac
+ mkdir -p "$HOME/.local/share/raea-models/$(dirname "$path")"
+ curl -fsSL "$url" -o "$HOME/.local/share/raea-models/$path"
+ echo "$sha $HOME/.local/share/raea-models/$path" | sha256sum -c -
+ done < <(tr -d '\r' < tools/release/models.tsv)
+ # bin\ as release.yml's windows job fills it, with the ARM64 runtime, uv and DXC (RAEA_WIN_ARCH=arm64), then the
+ # zip packed and checked by tools/release.sh as raea-VERSION-windows-arm64.zip. The skills gate is this commit's
+ # (public raea has no feed app; cli.md is still checked against this build's help); renders run on WARP
+ - name: Pack and check (tools/release.sh)
+ env:
+ RAEA_WIN_ARCH: arm64
+ RAEA_CHECK_DIR: ${{ runner.temp }}/release-check
+ WGPU_BACKEND: dx12
+ run: |
+ bash tools/release/onnxruntime.sh target/dist
+ bash tools/release/win-bundle.sh target/dist
+ RAEA_SKILLS_PASSED=$(git rev-parse HEAD) bash tools/release.sh "${{ inputs.version || '0.0.0-arm64' }}" target/dist HEAD
+ - uses: actions/upload-artifact@v4
+ if: always()
+ with:
+ name: windows-arm64-zip
+ path: dist/raea-*-windows-arm64.zip*
+ retention-days: 7
+ compression-level: 0
+ if-no-files-found: ignore
- uses: actions/upload-artifact@v4
if: always()
with:
diff --git a/tools/release.sh b/tools/release.sh
index b4ea3e55..ff5468cb 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# A release of the raea engine for macOS on Apple Silicon, Linux on x86_64 or Windows on x86_64 (whichever machine runs
+# A release of the raea engine for macOS on Apple Silicon, Linux on x86_64 or Windows on x86_64 or ARM64 (whichever machine runs
# it; .github/workflows/release.yml builds all three on GitHub's runners for a tag, Windows in Git's bash): raea and
# its bundler, with raea's own files beside them (share/raea: the raea SDK's TypeScript, the lite runtime and its
# packages, the shell's sources, the tools that install the local music and foley models, and the agent skills), laid
@@ -24,7 +24,7 @@
# tools/cpu-heartbeat.sh (a line while rustc's CPU grows) and keep `--stall 25m`; a raised stall would only wait longer
# on a real hang.
#
-# Writes dist/raea-VERSION-macos-arm64.tar.gz (-linux-x86_64.tar.gz, or -windows-x86_64.zip) and its .sha256, then
+# Writes dist/raea-VERSION-macos-arm64.tar.gz (-linux-x86_64.tar.gz, -windows-x86_64.zip or -windows-arm64.zip) and its .sha256, then
# checks the archive with tools/release-check.sh: unpacked into a fresh folder, its raea renders a frame with
# RAEA_NO_TREE=1 (so it can't be reading this checkout), has the plugin catalog, names none of raea's API and holds
# nothing key-shaped (on Windows, no Microsoft file). Nothing is published.
@@ -37,7 +37,9 @@ cd "$root"
out=$root/dist
case $(uname -s) in
Linux) platform=linux-x86_64 ;;
- MINGW*|MSYS*|CYGWIN*) platform=windows-x86_64 ;;
+ # RAEA_WIN_ARCH=arm64: the Windows on ARM build (#82), whose bin\ tools/release/onnxruntime.sh and win-bundle.sh fill
+ # with the same variable; Git's bash on that runner may be x64 itself, so uname -m can't say
+ MINGW*|MSYS*|CYGWIN*) [ "${RAEA_WIN_ARCH:-x64}" = arm64 ] && platform=windows-arm64 || platform=windows-x86_64 ;;
*) platform=macos-arm64 ;;
esac
name=raea-$version-$platform
@@ -52,7 +54,7 @@ untar() {
local err rc=0
err=$(tar -x -C "$1" 2>&1 >/dev/null) || rc=$?
[ $rc -eq 0 ] && return 0
- if [ "$platform" = windows-x86_64 ] && ! grep -v -e "Cannot create symlink" -e "Exiting with failure status" <<< "$err" | grep -q .; then
+ if [ "${platform%%-*}" = windows ] && ! grep -v -e "Cannot create symlink" -e "Exiting with failure status" <<< "$err" | grep -q .; then
echo "release.sh: note: the skills gate left out $(grep -c "Cannot create symlink" <<< "$err") symlinks (Windows makes none)"
return 0
fi
@@ -129,7 +131,7 @@ Install a CJK font for Japanese, Chinese and Korean text (Debian and Ubuntu: apt
An app's window, on either target (raea app run, raea-rune-host and raea-page-host), needs a display (X11 or
Wayland; Xvfb on a server, as raea app check does there too), libxkbcommon-x11, the X client libraries and the Vulkan
loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 libxrandr2 libx11-xcb1 libvulkan1)." > "$stage/README" ;;
- windows-x86_64)
+ windows-*)
cp "$bin/raea.exe" "$bin/raea_bundle.dll" "$bin/raea-perceive.exe" "$bin/raea-rune-host.exe" "$bin/raea-page-host.exe" "$stage/bin/"
# ONNX Runtime as Microsoft builds it (MIT), which raea.exe and raea-perceive.exe load when a model first runs (#110),
# with its licence and notices; tools/release/onnxruntime.sh put them beside the build
@@ -144,7 +146,7 @@ loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 lib
[ -f "$bin/$f" ] || { echo "release.sh: $bin has no $f (tools/release/win-bundle.sh $bin)" >&2; exit 1; }
cp "$bin/$f" "$stage/bin/"
done
- printf '%s\r\n' "raea $version for Windows x86_64 (Windows 10 or 11, a DirectX 12 or Vulkan GPU driver; with no GPU, Mesa's lavapipe and WGPU_BACKEND=vulkan)." \
+ printf '%s\r\n' "raea $version for Windows ${platform#windows-} (Windows 10 or 11, a DirectX 12 or Vulkan GPU driver; with no GPU, Mesa's lavapipe and WGPU_BACKEND=vulkan)." \
"bin\\ carries what raea needs from outside it: Microsoft's Visual C++ runtime, ONNX Runtime and DXC, FFmpeg (LGPL) and uv," \
"each with its licence beside it (ffmpeg-README.txt says where FFmpeg's source is)." > "$stage/README.txt" ;;
*) cp "$bin/raea" "$bin/libraea_bundle.dylib" "$bin/raea-perceive" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/"
@@ -205,7 +207,7 @@ printf '%s\n' "$version" > "$stage/share/raea/VERSION"
for md in "$stage"/share/raea/skills/*/SKILL.md; do
perl -0pi -e 's/\A---\n(.*?)\n---\n/"---\n" . join("\n", grep { !\/^version:\/ } split(\/\n\/, $1)) . "\nversion: '"$version"'\n---\n"/se' "$md"
done
-if [ $platform = windows-x86_64 ]; then
+if [ "${platform%%-*}" = windows ]; then
# RAEA_WIN_SIGN=1: raea's own programs signed before they're zipped (tools/release/win-sign.sh, #221). Off, the zip is
# as it was: unsigned, which Smart App Control blocks on a PC that has it on
if [ "${RAEA_WIN_SIGN:-}" = 1 ]; then
diff --git a/tools/release/onnxruntime.sh b/tools/release/onnxruntime.sh
index d92194eb..c6ca9d38 100755
--- a/tools/release/onnxruntime.sh
+++ b/tools/release/onnxruntime.sh
@@ -7,10 +7,13 @@
# CPU without AVX2 and BMI2 (an Ivy Bridge, a Celeron), whatever was asked of it. Microsoft's runtime picks its kernels
# by the CPU it finds; it loads and opens raea's models under Intel's emulator as an Ivy Bridge and a Sandy Bridge.
# 1.28.0 is the runtime the static build was (ort-sys 2.0.0-rc.13's [email protected]); ort asks for API 17 or newer.
+# RAEA_WIN_ARCH=arm64 takes the package's win-arm64 runtime instead, for raea's Windows on ARM build (#82).
# tools/release/onnxruntime.sh DEST
set -euo pipefail
die() { echo "onnxruntime: $*" >&2; exit 1; }
dest=${1:?DEST}
+arch=${RAEA_WIN_ARCH:-x64}
+case $arch in x64|arm64) ;; *) die "RAEA_WIN_ARCH is $arch: x64 or arm64" ;; esac
v=1.28.0
# the package's sha256; its sha512 is the one NuGet records for it (packageHash)
sum=769d1d3ea8ab6cd69f737c9dd4d4462aa4ad0ccfa106eaf506efc40d7bead5db
@@ -20,9 +23,9 @@ trap 'rm -rf "$tmp"' EXIT
curl -fsSL --retry 5 --retry-all-errors --connect-timeout 30 -o "$tmp/ort.nupkg" "$url" || die "couldn't download $url"
got=$( (sha256sum "$tmp/ort.nupkg" 2>/dev/null || shasum -a 256 "$tmp/ort.nupkg") | cut -d' ' -f1)
[ "$got" = "$sum" ] || die "Microsoft.ML.OnnxRuntime $v is $got, not the $sum pinned here"
-unzip -q -o "$tmp/ort.nupkg" runtimes/win-x64/native/onnxruntime.dll LICENSE ThirdPartyNotices.txt -d "$tmp/x"
+unzip -q -o "$tmp/ort.nupkg" runtimes/win-$arch/native/onnxruntime.dll LICENSE ThirdPartyNotices.txt -d "$tmp/x"
mkdir -p "$dest"
-cp "$tmp/x/runtimes/win-x64/native/onnxruntime.dll" "$dest/onnxruntime.dll"
+cp "$tmp/x/runtimes/win-$arch/native/onnxruntime.dll" "$dest/onnxruntime.dll"
cp "$tmp/x/LICENSE" "$dest/onnxruntime-LICENSE.txt"
cp "$tmp/x/ThirdPartyNotices.txt" "$dest/onnxruntime-ThirdPartyNotices.txt"
-echo "onnxruntime: Microsoft.ML.OnnxRuntime $v's onnxruntime.dll ($(wc -c < "$dest/onnxruntime.dll" | tr -d ' ') bytes) and its notices in $dest"
+echo "onnxruntime: Microsoft.ML.OnnxRuntime $v's win-$arch onnxruntime.dll ($(wc -c < "$dest/onnxruntime.dll" | tr -d ' ') bytes) and its notices in $dest"
diff --git a/tools/release/win-bundle.sh b/tools/release/win-bundle.sh
index fcb7a40d..c30451a7 100755
--- a/tools/release/win-bundle.sh
+++ b/tools/release/win-bundle.sh
@@ -13,11 +13,19 @@
# three licences: wgpu compiles DX12's shaders with it when it sits beside raea.exe, else with the old FXC, which cost
# 6 to 13 s of hitches at start and as new 3D appeared on every PC DX12 is chosen for: Intel, AMD and Arc (#215; the
# chat page 17.7 s with FXC, 12.0 s with DXC on the test PC)
-# The pins are setup.rs's, so what ships and what's fetched are the same build.
+# The pins are setup.rs's, so what ships and what's fetched are the same build. RAEA_WIN_ARCH=arm64 (raea's Windows on
+# ARM build, #82) takes the ARM64 runtime, uv and DXC; FFmpeg stays x64, which Windows on ARM runs emulated in its own
+# process, as setup.rs fetches it there.
# tools/release/win-bundle.sh DEST (on the Windows runner, in Git's bash)
set -euo pipefail
die() { echo "win-bundle: $*" >&2; exit 1; }
dest=${1:?DEST}
+arch=${RAEA_WIN_ARCH:-x64}
+case $arch in
+ x64) vc=x86.x64 uvt=x86_64-pc-windows-msvc ;;
+ arm64) vc=ARM64 uvt=aarch64-pc-windows-msvc ;;
+ *) die "RAEA_WIN_ARCH is $arch: x64 or arm64" ;;
+esac
root=$(cd "$(dirname "$0")/../.." && pwd)
setup=$root/io/assets/src/setup.rs
const() { sed -n "s/^const $1: &str = \"\\(.*\\)\";$/\\1/p" "$setup"; }
@@ -30,10 +38,10 @@ mkdir -p "$dest"
# the VC++ runtime, from the newest Visual Studio with the C++ tools
vswhere="/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
[ -x "$vswhere" ] || die "no vswhere at $vswhere: the C runtime comes from the runner's Visual Studio"
-vs=$(cygpath -u "$("$vswhere" -latest -products '*' -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | tr -d '\r')")
+vs=$(cygpath -u "$("$vswhere" -latest -products '*' -requires Microsoft.VisualStudio.Component.VC.Tools.$vc -property installationPath | tr -d '\r')")
ver=$(tr -d '\r\n ' < "$vs/VC/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt")
-crt=$(ls -d "$vs/VC/Redist/MSVC/$ver/x64"/Microsoft.VC14*.CRT 2>/dev/null | tail -1)
-[ -n "$crt" ] || die "no Microsoft.VC14*.CRT under $vs/VC/Redist/MSVC/$ver/x64"
+crt=$(ls -d "$vs/VC/Redist/MSVC/$ver/$arch"/Microsoft.VC14*.CRT 2>/dev/null | tail -1)
+[ -n "$crt" ] || die "no Microsoft.VC14*.CRT under $vs/VC/Redist/MSVC/$ver/$arch"
for f in vcruntime140.dll vcruntime140_1.dll msvcp140.dll msvcp140_1.dll; do
[ -f "$crt/$f" ] || die "$crt has no $f"
cp "$crt/$f" "$dest/$f"
@@ -55,18 +63,18 @@ cp "$tmp/ff/$top/libvpx-PATENTS" "$dest/libvpx-PATENTS.txt"
# uv, and its licences from its source at the same tag
uv=$(const UV)
-uvsum=$(sed -n 's/^ *("x86_64-pc-windows-msvc", "\([0-9a-f]*\)"),$/\1/p' "$setup")
-[ -n "$uv" ] && [ -n "$uvsum" ] || die "no UV and its x86_64-pc-windows-msvc sha256 in $setup"
-fetch "https://github.com/astral-sh/uv/releases/download/$uv/uv-x86_64-pc-windows-msvc.zip" "$tmp/uv.zip" "$uvsum"
+uvsum=$(sed -n 's/^ *("'"$uvt"'", "\([0-9a-f]*\)"),$/\1/p' "$setup")
+[ -n "$uv" ] && [ -n "$uvsum" ] || die "no UV and its $uvt sha256 in $setup"
+fetch "https://github.com/astral-sh/uv/releases/download/$uv/uv-$uvt.zip" "$tmp/uv.zip" "$uvsum"
unzip -q -o "$tmp/uv.zip" uv.exe -d "$dest"
[ "$uv" = 0.12.24 ] || die "uv is $uv: pin its LICENSE-MIT and LICENSE-APACHE here for that tag"
fetch "https://raw.githubusercontent.com/astral-sh/uv/$uv/LICENSE-MIT" "$dest/uv-LICENSE-MIT.txt" 860e3d7a86b84e6a7012c7a635fc64df475cebc6cce34dfeb73a5982ec58176c
fetch "https://raw.githubusercontent.com/astral-sh/uv/$uv/LICENSE-APACHE" "$dest/uv-LICENSE-APACHE.txt" c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4
-# DXC: Microsoft's distributable dxcompiler.dll and dxil.dll (LICENSE-MS.txt), the x64 ones, and the release's licences
+# DXC: Microsoft's distributable dxcompiler.dll and dxil.dll (LICENSE-MS.txt), the architecture's, and the release's licences
dxc=v1.8.2502
fetch "https://github.com/microsoft/DirectXShaderCompiler/releases/download/$dxc/dxc_2025_02_20.zip" "$tmp/dxc.zip" 70b1913a1bfce4a3e1a5311d16246f4ecdf3a3e613abec8aa529e57668426f85
-unzip -q -o -j "$tmp/dxc.zip" bin/x64/dxcompiler.dll bin/x64/dxil.dll -d "$dest"
+unzip -q -o -j "$tmp/dxc.zip" bin/$arch/dxcompiler.dll bin/$arch/dxil.dll -d "$dest"
for l in MS LLVM MIT; do unzip -p "$tmp/dxc.zip" "LICENSE-$l.txt" > "$dest/dxc-LICENSE-$l.txt"; done
-echo "win-bundle: in $dest: the VC++ runtime $ver, FFmpeg ($top), uv $uv, DXC $dxc, with their licences"
+echo "win-bundle: in $dest ($arch): the VC++ runtime $ver, FFmpeg ($top), uv $uv, DXC $dxc, with their licences"