Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Shell scripts must keep LF endings, also in Windows checkouts with
# core.autocrlf=true, so they run under WSL and Linux.
*.sh text eol=lf
40 changes: 29 additions & 11 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# Builds the Maven reactor (shuttle-java, the example and the WIT tooling)
# and runs its tests.
#
# - linux: native libraries for Linux x86_64 and aarch64 via `cross`; all modules.
# - windows: native library built on the host (MSVC); shuttle-java and the example
# only, because shuttle-wit-parser has no Windows native library yet.
#
# setup-rust-toolchain sets RUSTFLAGS=-D warnings, so Rust warnings fail the build.

name: Java CI with Maven

Expand All @@ -15,21 +16,38 @@ on:
branches: [main]

jobs:
build:
linux:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: wasm32-unknown-unknown # for the valuetest fixture
- uses: actions/checkout@v5
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: "21"
distribution: temurin
cache: maven
- name: Install additional wasm targets for rust
run: rustup target add wasm32-wasip1 wasm32-wasip2 && rustup target add wasm32-wasip1-threads --toolchain nightly
- name: Install cargo cross
run: cargo install cross
- name: Build with Maven
run: mvn -P build-linux-x86-64,build-linux-aarch64,build-windows-x86_64 -Dcargo.profile=release -Dcargo.profile.folder=release -B package --file pom.xml
run: mvn -P build-linux-x86-64,build-linux-aarch64 -Dcargo.profile=release -Dcargo.profile.folder=release -B package --file pom.xml

windows:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: wasm32-unknown-unknown # for the valuetest fixture
- uses: actions/checkout@v5
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: "21"
distribution: temurin
cache: maven
- name: Build with Maven
run: mvn -P build-host-windows-x86_64 -pl shuttle-java,shuttle-java-example -am -Dcargo.profile=release -Dcargo.profile.folder=release -B package --file pom.xml
59 changes: 59 additions & 0 deletions .github/workflows/native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Builds the Shuttle native workspace (native/) on all six target platforms
# and runs the capture/restore verification on each.
name: Native (Shuttle)

on:
push:
branches: [main]
paths: ["native/**", ".github/workflows/native.yml"]
pull_request:
paths: ["native/**", ".github/workflows/native.yml"]
workflow_dispatch:

jobs:
# The C guests are plain wasm32 and identical everywhere: build them once.
guests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install clang and lld
run: sudo apt-get update && sudo apt-get install -y clang lld
- name: Build guests
run: sh native/guests/build.sh
- uses: actions/upload-artifact@v4
with:
name: guests
path: native/guests/out/*.wasm

build:
needs: guests
strategy:
fail-fast: false
matrix:
include:
- { name: linux-x86_64, os: ubuntu-latest }
- { name: linux-aarch64, os: ubuntu-24.04-arm }
- { name: windows-x86_64, os: windows-latest }
- { name: windows-aarch64, os: windows-11-arm }
- { name: macos-x86_64, os: macos-15-intel }
- { name: macos-aarch64, os: macos-latest }
name: build (${{ matrix.name }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: native
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-workspaces: native
rustflags: ""
- uses: actions/download-artifact@v4
with:
name: guests
path: native/guests/out
- name: Build
run: cargo build --locked --release
- name: Verify capture/restore
run: ./target/release/shuttle-runner verify guests/out/bios.wasm guests/out/os.wasm guests/out/child.wasm
12 changes: 6 additions & 6 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,36 @@
## Branches
- New features: `feature/<name>`
- Fixes: `fix/<name>`

## Language
- Talk to the user in Japanese.
- Files in the repository (code, comments, docs, commit messages) are
written in English unless the user says otherwise.

# Project

Shuttle is a WebAssembly runtime library (Java binding + native Rust:
Wasmtime + Weave) for Minecraft computer mods. It is not a mod itself.
OpenComputers will use it through an addon; a new Retro Computing mod
will include it by default. Current status and open decisions:
`native/HANDOFF.md`. Overview and docs: `README.md`, `docs/`.

| Path | What |
| --- | --- |
| `native/` | Rust workspace: `shuttle-core`, `shuttle-runner`, C test guests |
| `shuttle-java/` | `jp.akkiserver.shuttle`: Wasmtime + Weave JNI binding |
| `shuttle-java-example/` | Weave example |
| `shuttle-wit-parser/`, `shuttle-wit-maven-plugin/` | WIT tooling |

## Build and test (Windows)
- Native core: `.\native\scripts\build.ps1` (needs LLVM for clang and
wasm-ld). Do not redirect its output; under Windows PowerShell 5.1 that
makes cargo's progress output abort the script.
- Maven: there is no `mvn` on PATH. Use IntelliJ's bundled Maven,
`%LOCALAPPDATA%\Programs\IntelliJ IDEA\plugins\maven-plugin\lib\maven3\bin\mvn.cmd`,
with `JAVA_HOME=%USERPROFILE%\.jdks\temurin-25.0.4` (the global
`JAVA_HOME` points at `bin\` and is wrong), and the profile
`-P build-host-windows-x86_64`. The default profile uses cross + Docker.
- JNI class names are also written as strings in Rust (`java_type = "..."`).
After renaming Java classes or packages, grep the `.rs` files and run the
tests: a wrong name compiles but fails at run time.
Loading
Loading