Make the MoonBit host the default: just run, run-drm and install-session use build/wasmhost
CI / test (push) Failing after 17s
CI / test (push) Failing after 17s
The Rust host stays as a fallback: just run-rust, run-drm-rust, install-session-rust (session/install.py --rust-host). build-wasmhost.sh fetches the wasmtime C API when it is missing and replaces build/wasmhost by renaming, so a running dev session keeps its copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hiNfjrw2edja7LiRLB
This commit is contained in:
6 files changed
+65
-32
No files matched your search
+10
-5
@@ -4,14 +4,15 @@
|
||||
run0 python3 session/install.py # install: the compositor as a wasm component
|
||||
run0 python3 session/install.py --link # dev: symlink into this checkout (see below)
|
||||
run0 python3 session/install.py --native # install the native compositor instead
|
||||
run0 python3 session/install.py --rust-host # the wasm compositor on the Rust host (host-wasm)
|
||||
run0 python3 session/install.py --remove # uninstall
|
||||
|
||||
With --link nothing is copied: the installed files are symlinks to the build outputs in this
|
||||
checkout, so after one root install, `just compositor-wasm host-wasm modules` is all it takes for the
|
||||
checkout, so after one root install, `just compositor-wasm wasmhost modules` is all it takes for the
|
||||
next login to run your latest build (no root, no reinstall). The checkout must stay where it is.
|
||||
|
||||
Installs:
|
||||
/usr/local/bin/chandra-host wasmtime host that runs the compositor component
|
||||
/usr/local/bin/chandra-host host that runs the compositor component (build/wasmhost)
|
||||
/usr/local/share/chandra/compositor.wasm the compositor, as a WebAssembly component
|
||||
/usr/local/bin/chandra (--native) release native compositor binary
|
||||
/usr/local/bin/chandra-session session launcher (starts the host if installed)
|
||||
@@ -25,7 +26,11 @@ root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
native = "--native" in sys.argv
|
||||
linked = "--link" in sys.argv
|
||||
exe = os.path.join(root, "_build/native/release/build/compositor/bin/bin.exe")
|
||||
host = os.path.join(root, "host-wasm/target/release/chandra-host")
|
||||
rust_host = "--rust-host" in sys.argv
|
||||
# The host that runs the compositor component: the MoonBit one (just wasmhost), or the Rust
|
||||
# one (just host-wasm) with --rust-host. Either is installed as chandra-host.
|
||||
host_build = "just host-wasm" if rust_host else "just wasmhost"
|
||||
host = os.path.join(root, "host-wasm/target/release/chandra-host" if rust_host else "build/wasmhost")
|
||||
component = os.path.join(root, "build/compositor.wasm")
|
||||
share = "/usr/local/share/chandra"
|
||||
targets = [
|
||||
@@ -51,7 +56,7 @@ if native:
|
||||
if not os.path.exists(exe):
|
||||
sys.exit("missing %s - run `just build-release` first" % exe)
|
||||
else:
|
||||
for f, how in ((host, "just host-wasm"), (component, "just compositor-wasm")):
|
||||
for f, how in ((host, host_build), (component, "just compositor-wasm")):
|
||||
if not os.path.exists(f):
|
||||
sys.exit("missing %s - run `%s` first" % (f, how))
|
||||
|
||||
@@ -106,7 +111,7 @@ mods = os.path.join(root, "build/components")
|
||||
dst = os.path.join(share, "modules")
|
||||
if linked:
|
||||
link(mods, dst)
|
||||
print("done: pick 'Chandra' in the session menu; rebuild with `just compositor-wasm host-wasm modules`")
|
||||
print("done: pick 'Chandra' in the session menu; rebuild with `just compositor-wasm %s modules`" % host_build.split()[1])
|
||||
sys.exit(0)
|
||||
if os.path.lexists(dst):
|
||||
shutil.rmtree(dst) if os.path.isdir(dst) and not os.path.islink(dst) else os.remove(dst)
|
||||
|
||||
Reference in new issue
Block a user