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.

GD9: raea builds GodotJS's editors itself: sdk/godot/build holds the macOS (arm64, JavaScriptCore) and Linux (x86_64, QuickJS-ng, on Modal) builds from source, as GodotJS's CI builds its release (Godot 4.6.1-stable 14d1969, GodotJS a8e2567 at v1.1.0.beta1-4.6.1, AccessKit-c 0.18.0), and verify.sh, which runs raea's smoke script on a build and compares the typings it generates with those from GodotJS's own build

shinyobjectz7fd6282cb2f3
diff --git a/docs/godot.feature b/docs/godot.feature
index 49ed4e0f..82b330da 100644
--- a/docs/godot.feature
+++ b/docs/godot.feature
@@ -92,3 +92,13 @@ Feature: Godot from TypeScript: raea/godot (sdk/godot) on GodotJS
Rule: GodotJS is ours to build
Scenario: GD9. GodotJS's source is vendored at the release's tag, and raea builds the JavaScriptCore and QuickJS-ng editors itself
Then `raea setup godot` downloads raea's own builds, and the typings are generated from them
+ And sdk/godot/build holds the builds, from source as GodotJS's CI builds its release (Godot 4.6.1-stable 14d1969,
+ GodotJS a8e2567 at v1.1.0.beta1-4.6.1, AccessKit-c 0.18.0): macos.sh (arm64, JavaScriptCore, Metal only) and
+ linux.py (x86_64, QuickJS-ng, on Ubuntu 22.04 on Modal); verify.sh checks an editor against GodotJS's own
+ And on 11-10 macos.sh built the editor in 370 s at -j6 (133,184,648 bytes, sha256 7908bf67...a92310, reporting
+ 4.6.1.stable.raea.14d19694e); verify.sh on it: raea's smoke printed "PASS raea/godot: 3 boxes, the last
+ 4.000 m out, in Godot 4.6.1-stable (raea)" and the 17 typing files matched GodotJS's build's byte for byte
+ And linux.py built the editor in 511 s on 16 cores (161,938,768 bytes, sha256 8fd01803...699684), before its
+ BUILD_NAME=raea line, so that build reports custom_build; it hasn't run raea's smoke yet
+ And for 0.1.1 `raea setup godot` keeps GodotJS's pinned builds; the pins move to raea's in 0.1.2 once the Windows
+ editor is built too, the Mac one is signed, and each passes the clean-machine smoke; nothing is uploaded before then
diff --git a/sdk/godot/build/linux.py b/sdk/godot/build/linux.py
new file mode 100644
index 00000000..fc5d9f84
--- /dev/null
+++ b/sdk/godot/build/linux.py
@@ -0,0 +1,71 @@
+# GD9: raea's own GodotJS editor for Linux x86_64 (QuickJS-ng), built from source as GodotJS's CI builds its release
+# (build_linux.yml at v1.1.0.beta1-4.6.1): Godot 4.6.1-stable with GodotJS as modules/GodotJS, its JS runtime built by
+# pnpm (scripts/out), AccessKit-c 0.18.0, on Ubuntu 22.04 (one LTS back, for portability). Writes the stripped editor
+# and its sha256 to a Modal volume; nothing is uploaded anywhere else.
+# MODAL_PROFILE=<profile> modal run sdk/godot/build/linux.py
+import subprocess
+
+import modal
+
+image = (
+ modal.Image.from_registry("ubuntu:22.04", add_python="3.12")
+ .apt_install("build-essential", "pkg-config", "git", "curl", "ca-certificates", "xz-utils", "unzip",
+ "libx11-dev", "libxcursor-dev", "libxinerama-dev", "libgl1-mesa-dev", "libglu1-mesa-dev",
+ "libasound2-dev", "libpulse-dev", "libudev-dev", "libxi-dev", "libxrandr-dev", "libwayland-dev",
+ "libwayland-bin")
+ .pip_install("scons==4.9.1")
+)
+vol = modal.Volume.from_name("raea-gd9", create_if_missing=True)
+app = modal.App("raea-gd9-linux", image=image)
+
+SCRIPT = r"""
+set -euo pipefail
+cd /build
+echo "[1] node and pnpm"
+v=$(curl -fsSL https://nodejs.org/dist/latest-v24.x/SHASUMS256.txt | awk '/linux-x64.tar.xz/{print $2}')
+curl -fsSL -o "$v" "https://nodejs.org/dist/latest-v24.x/$v"
+curl -fsSL https://nodejs.org/dist/latest-v24.x/SHASUMS256.txt | grep " $v\$" | sha256sum -c - >/dev/null && echo " $v checked"
+mkdir node && tar -xf "$v" -C node --strip-components 1 && rm "$v"
+export PATH=/build/node/bin:$PATH
+corepack enable --install-directory /build/node/bin && corepack prepare [email protected] --activate >/dev/null
+node --version; pnpm --version
+echo "[2] sources"
+git clone -q --depth 1 --branch 4.6.1-stable https://github.com/godotengine/godot.git godot
+git clone -q --depth 1 --branch v1.1.0.beta1-4.6.1 --recurse-submodules --shallow-submodules https://github.com/godotjs/GodotJS.git godot/modules/GodotJS
+echo " godot $(git -C godot rev-parse --short HEAD), GodotJS $(git -C godot/modules/GodotJS rev-parse --short HEAD), quickjs-ng $(git -C godot/modules/GodotJS/quickjs-ng rev-parse --short HEAD)"
+curl -fsSL -o ak.zip https://github.com/AccessKit/accesskit-c/releases/download/0.18.0/accesskit-c-0.18.0.zip
+unzip -q -o ak.zip -d /build && rm ak.zip && ls -d /build/accesskit-c-0.18.0
+echo "[3] GodotJS's JS runtime (scripts/out)"
+cd godot/modules/GodotJS
+pnpm install --frozen-lockfile >/dev/null 2>&1 || pnpm install >/dev/null
+pnpm build >/dev/null
+ls scripts/out | tr '\n' ' '; echo
+cd /build/godot
+echo "[4] scons: editor, QuickJS-ng"
+start=$(date +%s)
+BUILD_NAME=raea scons -j$(nproc) platform=linuxbsd target=editor use_quickjs_ng=yes module_text_server_fb_enabled=yes \
+ accesskit_sdk_path=/build/accesskit-c-0.18.0/ skip_js_runtime=yes > /build/scons.log 2>&1 || { tail -40 /build/scons.log; exit 1; }
+echo " built in $(( $(date +%s) - start )) s"
+rm -rf bin/build_deps
+strip bin/godot.*
+chmod +x bin/godot.*
+ls -la bin/
+B=bin/godot.linuxbsd.editor.x86_64
+$B --headless --version 2>&1 | tail -1
+mkdir -p /out/linux && cp $B /out/linux/ && (cd /out/linux && sha256sum godot.linuxbsd.editor.x86_64 | tee godot.sha256)
+echo " size: $(stat -c %s /out/linux/godot.linuxbsd.editor.x86_64)"
+"""
+
+
[email protected](cpu=16, memory=32768, timeout=5400, volumes={"/out": vol})
+def build() -> str:
+ import os
+ os.makedirs("/build", exist_ok=True)
+ r = subprocess.run(["bash", "-c", SCRIPT], capture_output=True, text=True)
+ vol.commit()
+ return r.stdout + ("\n--stderr--\n" + r.stderr[-4000:] if r.stderr.strip() else "") + f"\nexit {r.returncode}"
+
+
[email protected]_entrypoint()
+def main():
+ print(build.remote())
diff --git a/sdk/godot/build/macos.sh b/sdk/godot/build/macos.sh
new file mode 100755
index 00000000..0fec27b3
--- /dev/null
+++ b/sdk/godot/build/macos.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# GD9: raea's own GodotJS editor for macOS arm64 (JavaScriptCore), from source as GodotJS's CI builds it
+# (build_macos.yml at v1.1.0.beta1-4.6.1), arm64 only and Metal only. Everything in WORK, the editor in WORK/out.
+# sdk/godot/build/macos.sh WORK
+set -euo pipefail
+W=${1:?usage: macos.sh WORK}
+mkdir -p "$W" && cd "$W"
+echo "[1] sources"
+git clone -q --depth 1 --branch 4.6.1-stable https://github.com/godotengine/godot.git godot 2>/dev/null
+git clone -q --depth 1 --branch v1.1.0.beta1-4.6.1 --recurse-submodules --shallow-submodules https://github.com/godotjs/GodotJS.git godot/modules/GodotJS 2>/dev/null
+echo " godot $(git -C godot rev-parse --short HEAD), GodotJS $(git -C godot/modules/GodotJS rev-parse --short HEAD), quickjs-ng $(git -C godot/modules/GodotJS/quickjs-ng rev-parse --short HEAD)"
+curl -fsSL -o ak.zip https://github.com/AccessKit/accesskit-c/releases/download/0.18.0/accesskit-c-0.18.0.zip
+unzip -q -o ak.zip && rm ak.zip
+echo "[2] GodotJS's JS runtime (scripts/out)"
+(cd godot/modules/GodotJS && { pnpm install --frozen-lockfile >/dev/null 2>&1 || pnpm install >/dev/null; } && pnpm build >/dev/null && ls scripts/out | tr '\n' ' '); echo
+echo "[3] scons in a venv"
+python3 -m venv venv && venv/bin/pip install -q scons==4.9.1
+cd godot
+start=$(date +%s)
+BUILD_NAME=raea ../venv/bin/scons -j6 platform=macos target=editor arch=arm64 use_jsc=yes vulkan=no \
+ module_text_server_fb_enabled=yes accesskit_sdk_path="$W/accesskit-c-0.18.0/" skip_js_runtime=yes > "$W/scons.log" 2>&1 \
+ || { tail -40 "$W/scons.log"; exit 1; }
+echo " built in $(( $(date +%s) - start )) s"
+B=bin/godot.macos.editor.arm64
+strip -S "$B" 2>/dev/null || true
+mkdir -p "$W/out" && cp "$B" "$W/out/" && (cd "$W/out" && shasum -a 256 godot.macos.editor.arm64 | tee godot.sha256)
+echo " size: $(stat -f %z "$W/out/godot.macos.editor.arm64")"
+"$W/out/godot.macos.editor.arm64" --headless --version 2>&1 | tail -1
diff --git a/sdk/godot/build/verify.sh b/sdk/godot/build/verify.sh
new file mode 100755
index 00000000..0055f6e5
--- /dev/null
+++ b/sdk/godot/build/verify.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# GD9: an editor raea built (macos.sh, linux.py) checked against GodotJS's own release build: raea runs the smoke
+# script on it, and `raea godot types` writes the same typings from it as from the build `raea setup godot` downloads.
+# A HOME of its own points raea.godot at the editor, so the person's own settings are never touched.
+# sdk/godot/build/verify.sh EDITOR WORK
+set -uo pipefail
+E=${1:?usage: verify.sh EDITOR WORK}; W=${2:?usage: verify.sh EDITOR WORK}
+RAEA=${RAEA:-raea}
+H=$W/home; rm -rf "$H" "$W/types-ours" "$W/types-theirs"; mkdir -p "$H" "$W/types-ours" "$W/types-theirs"
+for d in ours theirs; do printf 'config_version=5\n\n[application]\nconfig/name="t"\n' > "$W/types-$d/project.godot"; done
+printf '[raea]\n\tgodot = %s\n' "$E" > "$H/.gitconfig"
+echo "[1] smoke on our build"
+(cd "$(dirname "$0")/../../.." && HOME=$H "$RAEA" godot run sdk/godot/test/scripts/smoke.ts alpha --beta 2>&1 | tail -3)
+echo "[2] types from our build, then from GodotJS's"
+(HOME=$H "$RAEA" godot types "$W/types-ours" 2>&1 | tail -1)
+("$RAEA" godot types "$W/types-theirs" 2>&1 | tail -1)
+n=$(diff -r -x .godot "$W/types-ours" "$W/types-theirs" | wc -l | tr -d ' ')
+echo "[3] $(ls "$W/types-ours/typings" | wc -l | tr -d ' ') typing files; diff lines: $n"
+[ "$n" = 0 ]