Files
ArenaPublic/docs/PORTABILITY.md

38 lines
1.2 KiB
Markdown

# Portability
Decision 15: `arena-core` stays pure (no I/O, no OS calls) and builds for Windows, Android and WebAssembly. It
uses only `core`/`alloc`/`std` collections and strings plus `serde` and `serde_json`; no `std::fs`,
`std::process`, `std::net`, `std::env`, `std::time` and no `unsafe`.
## Targets checked
| Target | Why |
| :-- | :-- |
| `x86_64-pc-windows-msvc` | the window app on the PC |
| `wasm32-unknown-unknown` | the PWA companion |
| `aarch64-linux-android` | the Android companion |
## Commands
From the repository root (both targets are installed with `rustup target add wasm32-unknown-unknown
aarch64-linux-android`):
```
cargo check -p arena-core
cargo check -p arena-core --target wasm32-unknown-unknown
cargo check -p arena-core --target aarch64-linux-android
```
`cargo check` needs no Android NDK: the crate has no build script and no C dependency, so nothing links.
## Keeping it pure
A quick audit that no I/O crept in (should print nothing):
```
grep -rnE "std::(fs|process|net|env|time)|SystemTime|Instant|Command" crates/arena-core/src
```
Decision 15 asks CI to run the three `cargo check` lines from `core-v0.1.0` on; this repository has no CI file
yet, so for now they are run by hand before each tag.