This guide explains how to compile Encrusted (a modern Z-machine interpreter) from source.
- Rust (stable toolchain recommended)
git
# Clone the repository
git clone https://github.com/YetAnotherRandomGuy/Re-encrusted.git
cd Re-encrusted
# Build the release binary
cargo build --release --bin encrusted
# The binary will be located at:
# target/release/encrusted# Run a Z-machine game file (e.g. Zork)
./target/release/encrusted path/to/game.z3
# Common commands inside the game:
# save
# restore
# $undo
# $redo# Add the wasm32 target
rustup target add wasm32-unknown-unknown
# Build the WebAssembly module
cargo build --release --lib --target wasm32-unknown-unknown
# The .wasm file will be at:
# target/wasm32-unknown-unknown/release/web.wasmCopy the generated file into the web/ directory:
cp target/wasm32-unknown-unknown/release/web.wasm web/After building the WebAssembly module and copying web.wasm, you can serve the web player.
python3 -m http.server 8000Open http://localhost:8000/web/
See the Building a Container Image section below.
- Docker or Podman installed
- You must have already built the WebAssembly module and copied
web.wasminto theweb/directory (see above).
On Artix Linux (and other systems without /dev/net/tun), Podman's default pasta networking fails. You must build with --network=host:
podman build --network=host -t encrusted-web -f Containerfile .Docker does not require the --network=host workaround; the standard build command works:
docker build -t encrusted-web -f Containerfile .podman run -d \
--name encrusted-web \
--network=host \
localhost/encrusted-webdocker run -d \
--name encrusted-web \
-p 8999:8999 \
encrusted-webAccess at http://localhost:8999
# Stop
podman stop encrusted-web # or: docker stop encrusted-web
# Start again
podman start encrusted-web # or: docker start encrusted-web
# Remove
podman rm -f encrusted-web # or: docker rm -f encrusted-web- The container expects
web.wasmto already exist in theweb/directory. - If you see "Failed to load WebAssembly", make sure you completed the WebAssembly build step and copied the
.wasmfile before building the container. - Podman tags images as
localhost/<name>; Docker tags them as just<name>. Use the appropriate image reference when running. - The container serves static files via nginx on port 8999 with
Cache-Control: no-storeso WASM/HTML updates are always served fresh during development.