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.

What ships is stripped, its symbols kept beside it (#88). Release builds were never stripped: .cargo/config.toml keeps rustc's strip off (it re-signs without the JIT entitlement) and tools/link-jit.sh signed without stripping, so 0.1.1-rc2's macOS raea was 707 MB and its Linux raea 2.67 GB, nearly all symbols and debug info. Now link-jit.sh runs dsymutil on a dist-profile executable (into target/dist/symbols), then strip -x, then signs it with the entitlement; RAEA_KEEP_SYMBOLS=1 keeps them. The release profile the agents build isn't stripped (dsymutil takes 5 minutes a link there, and a stripped binary's panics name no functions). On Linux, release.sh splits each binary's debug info into dist/NAME-symbols/FILE.debug (named by a gnu-debuglink) and strips the copy it packs; on the Mac it copies the dSYMs there and warns of an unstripped binary. release.yml keeps those as a 90-day workflow artifact, never published. Measured on rc2's binaries: macOS raea 707 to 394 MB, raea-page-host 370 to 217; Linux raea 2,665 to 491 MB, raea-page-host 1,541 to 259; the archives 318 to 264 MB (macOS) and 1,008 to 300 MB (Linux). The stripped, re-signed Mac raea keeps com.apple.security.cs.allow-jit (codesign -d --entitlements -) and renders; a test link of a dist executable gets a dSYM whose UUID matches it

shinyobjectz2c2e3ad3b8c4
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1fc2f964..a19144b3 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -85,6 +85,8 @@ jobs:
mkdir ship
cp target/dist/raea target/dist/${{ matrix.lib }} target/dist/raea-rune-host target/dist/raea-page-host ship/
if [ -n "${{ matrix.extra }}" ]; then cp target/dist/${{ matrix.extra }} ship/; fi
+ # the Mac's dSYMs (tools/link-jit.sh made them as it stripped each binary, #88); release.sh keeps them
+ if [ -d target/dist/symbols ]; then cp -R target/dist/symbols ship/; fi
# the packing and its checks need only ship/, and macos-15's disk ran out packing rc1 with target/ kept
- name: Free the build's disk
run: |
@@ -110,6 +112,13 @@ jobs:
${{ runner.temp }}/release-check/**/*.log
retention-days: 7
if-no-files-found: ignore
+ # the stripped binaries' symbols (#88), for symbolicating a crash report from this release; never published
+ - uses: actions/upload-artifact@v4
+ with:
+ name: symbols-${{ runner.os }}
+ path: dist/raea-*-symbols
+ retention-days: 90
+ if-no-files-found: warn
- uses: actions/attest-build-provenance@v2
with:
subject-path: dist/raea-*.tar.gz
diff --git a/tools/link-jit.sh b/tools/link-jit.sh
index 1f174043..bfdabdb1 100755
--- a/tools/link-jit.sh
+++ b/tools/link-jit.sh
@@ -14,6 +14,17 @@ for a in "$@"; do
done
case "$out" in ""|*.dylib|*.so|*.a|*.rlib|*.o) exit 0 ;; esac
if file "$out" 2>/dev/null | grep -q "Mach-O.*executable"; then
+ # what ships (the dist profile) loses its local symbols and debug map before it's signed (#88: 0.1.1-rc2's raea was
+ # 707 MB, 394 MB stripped; .cargo/config.toml keeps rustc's own strip off, as it re-signs without the entitlement).
+ # Its dSYM is made first, into target/dist/symbols, so a crash.txt's addresses still symbolicate (atos -o
+ # raea.dSYM -l LOAD ADDR...). Not the release profile the agents build: dsymutil takes 5 minutes a link there, and
+ # a stripped binary's panics name no functions. RAEA_KEEP_SYMBOLS=1 keeps a dist build's symbols.
+ case "$out" in
+ */dist/deps/*) if [ "${RAEA_KEEP_SYMBOLS:-}" != 1 ]; then
+ syms="${out%/deps/*}/symbols"
+ mkdir -p "$syms" && dsymutil "$out" -o "$syms/$(basename "$out" | sed 's/-[0-9a-f]\{16\}$//').dSYM" && strip -x "$out" || exit $?
+ fi ;;
+ esac
codesign -s - --force --entitlements "$(dirname "$0")/jit.entitlements" "$out" >/dev/null 2>&1 || true
fi
exit 0
diff --git a/tools/release.sh b/tools/release.sh
index 1d14adf5..46a3cf6e 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -106,6 +106,13 @@ since=${RAEA_SINCE:-$(git describe --tags --abbrev=0 --match 'v*' "$ref" 2>/dev/
case $platform in
linux-x86_64)
cp "$bin/raea" "$bin/libraea_bundle.so" "$bin/raea-perceive" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/"
+ # each loses its debug info and local symbols (#88: rc2's raea was 2.67 GB, 491 MB stripped), kept in
+ # dist/NAME-symbols/FILE.debug, which the stripped file names (gdb and addr2line find it); never shipped
+ mkdir -p "$out/$name-symbols"
+ for f in "$stage"/bin/*; do
+ d="$out/$name-symbols/$(basename "$f").debug"
+ objcopy --only-keep-debug "$f" "$d" && strip --strip-debug --discard-all "$f" && objcopy --add-gnu-debuglink="$d" "$f"
+ done
# what a Linux machine needs beside it: the bundled Noto Sans JP is a Latin subset, so kanji and kana come from the
# system, as on a Mac (raea warns once a character when no font has it)
printf '%s\n' "raea $version for Linux x86_64 (glibc 2.39 or newer, Vulkan: a GPU driver or Mesa's llvmpipe).
@@ -121,7 +128,13 @@ loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 lib
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)." \
"It needs the Microsoft Visual C++ Redistributable (x64), which most machines already have:" \
"https://aka.ms/vs/17/release/vc_redist.x64.exe" > "$stage/README.txt" ;;
- *) cp "$bin/raea" "$bin/libraea_bundle.dylib" "$bin/raea-perceive" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/" ;;
+ *) cp "$bin/raea" "$bin/libraea_bundle.dylib" "$bin/raea-perceive" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/"
+ # stripped as they linked (tools/link-jit.sh, #88); a binary that still holds its debug map is a build from before
+ for f in raea raea-page-host raea-rune-host raea-perceive; do
+ [ "$(nm -a "$stage/bin/$f" 2>/dev/null | awk '$2 == "-"' | head -2 | wc -l)" -lt 2 ] || echo "release.sh: $f isn't stripped (a dist build strips it as it links; RAEA_KEEP_SYMBOLS=1 keeps them)" >&2
+ done
+ # their dSYMs, which link-jit.sh made, kept beside the archive (never shipped)
+ if [ -d "$bin/symbols" ]; then mkdir -p "$out/$name-symbols" && cp -R "$bin/symbols/." "$out/$name-symbols/"; fi ;;
esac
# the packages sdk/tsconfig.base.json lists (@raea/<name>: its sources and package.json), which the bundlers resolve by it
pkgs=()