-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This applies all the fancy things we added to the auto splitter template.
- Loading branch information
Showing
8 changed files
with
186 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
[build] | ||
target = "wasm32-unknown-unknown" | ||
rustflags = ["-C", "target-feature=+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,+simd128"] | ||
rustflags = [ | ||
# The auto splitting runtime supports all the following WASM features. | ||
"-C", "target-feature=+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,+simd128", | ||
] | ||
|
||
[alias] | ||
# Alias for building an optimized version of the auto splitter. | ||
# Command: cargo b | ||
b = [ | ||
"build", "--release", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: rust-src | ||
rust-version: nightly | ||
targets: wasm32-unknown-unknown | ||
|
||
- name: Build | ||
env: | ||
RUSTFLAGS: -Z virtual-function-elimination -C lto -C target-feature=+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,+simd128 | ||
run: | | ||
cargo +nightly build --locked --release --features nightly -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort | ||
- name: Release | ||
if: github.ref == 'refs/heads/master' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: target/wasm32-unknown-unknown/release/lunistice_auto_splitter.wasm | ||
name: Latest | ||
tag_name: latest | ||
|
||
clippy: | ||
name: Check clippy lints | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: clippy | ||
targets: wasm32-unknown-unknown | ||
|
||
- name: Run Clippy | ||
run: cargo clippy | ||
|
||
format: | ||
name: Check formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: rustfmt | ||
|
||
- name: Run cargo fmt | ||
run: cargo fmt -- --check || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Build nightly", | ||
"type": "process", | ||
"command": "cargo", | ||
"args": [ | ||
"+nightly", | ||
"build", | ||
"--release", | ||
"--features", | ||
"nightly", | ||
"-Z", | ||
"build-std=std,panic_abort", | ||
"-Z", | ||
"build-std-features=panic_immediate_abort" | ||
], | ||
"options": { | ||
"env": { | ||
"RUSTFLAGS": "-Z virtual-function-elimination -C lto -C target-feature=+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext,+simd128" | ||
} | ||
}, | ||
"problemMatcher": [ | ||
"$rustc" | ||
] | ||
}, | ||
{ | ||
"label": "Build stable", | ||
"type": "process", | ||
"command": "cargo", | ||
"args": [ | ||
"b" | ||
], | ||
"problemMatcher": [ | ||
"$rustc" | ||
] | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,6 @@ strip = true | |
|
||
[profile.release.build-override] | ||
opt-level = 0 | ||
|
||
[features] | ||
nightly = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Lunistice Auto Splitter | ||
|
||
An auto splitter for Lunistice. | ||
|
||
## Compilation | ||
|
||
This auto splitter is written in Rust. In order to compile it, you need to | ||
install the Rust compiler: [Install Rust](https://www.rust-lang.org/tools/install). | ||
|
||
Afterwards install the WebAssembly target: | ||
```sh | ||
rustup target add wasm32-unknown-unknown --toolchain stable | ||
``` | ||
|
||
The auto splitter can now be compiled: | ||
```sh | ||
cargo b | ||
``` | ||
|
||
The auto splitter is then available at: | ||
``` | ||
target/wasm32-unknown-unknown/release/lunistice_auto_splitter.wasm | ||
``` | ||
|
||
Make sure too look into the [API documentation](https://livesplit.org/asr/asr/) for the `asr` crate. | ||
|
||
You can use the [debugger](https://github.com/CryZe/asr-debugger) while | ||
developing the auto splitter to more easily see the log messages, statistics, | ||
dump memory and more. |
Oops, something went wrong.