Platform support
zapline runs on Linux, macOS and Windows. CI builds, lints and runs the full test suite on all three, and checks that projects generated by zapline new build and pass their tests on each.
Support matrix
| Linux | macOS | Windows | |
|---|---|---|---|
| Framework, all Cargo features | ✅ | ✅ | ✅ |
| Default server runtime | thread-per-core (SO_REUSEPORT) | multi-threaded (work-stealing) | multi-threaded (work-stealing) |
| HTTP/1.1, HTTP/2, TLS | ✅ | ✅ | ✅ |
| Graceful shutdown on | SIGINT, SIGTERM | SIGINT, SIGTERM | Ctrl-C, Ctrl-Break, console close, system shutdown / docker stop |
App::run_unix (Unix domain sockets) | ✅ | ✅ | — (not available) |
| Static files | ✅ | ✅ | ✅ plus Windows-specific path protection (below) |
zapline CLI | ✅ | ✅ | ✅ |
zapline dev restart | SIGTERM, then kill after 5s | SIGTERM, then kill after 5s | immediate stop |
zapline bench | wrk or oha | wrk or oha | oha |
bench/run.sh comparison | ✅ | — (uses Linux taskset) | — |
| Local checks | ./scripts/check.sh | ./scripts/check.sh | .\scripts\check.ps1 |
Performance: the thread-per-core runtime depends on Linux's SO_REUSEPORT load balancing. On macOS and Windows, RuntimeMode::PerCore falls back to the work-stealing runtime automatically. That is fast and fully supported, but publish benchmark numbers from Linux.
Setting up on Windows
- Install the Visual Studio Build Tools with the "Desktop development with C++" workload. Rust uses its linker, and two dependencies (
ringfor TLS,zstdfor compression) compile C code.rustup-init.exeoffers to install it for you. - Install Rust from https://rustup.rs (
rustup-init.exe). The defaultx86_64-pc-windows-msvctoolchain is the one CI tests. - In PowerShell:
git clone https://github.com/samsamurai301/zapline.git
cd zapline
.\scripts\check.ps1 # fmt, clippy, tests, feature matrix, examples, docs
cargo install --path crates\zapline-cli # installs zapline.exe and cargo-zapline.exe
zapline new my-api --zapline-path .\crates\zapline
cd my-api; zapline dev
If PowerShell blocks scripts, run powershell -ExecutionPolicy Bypass -File .\scripts\check.ps1.
For load testing, install oha with cargo install oha. zapline bench uses it automatically when wrk isn't available.
Windows-specific behavior
- Ports: zapline doesn't set
SO_REUSEADDRon Windows. There, unlike on Unix, the option would let another process bind the same port while your server is listening. - Shutdown: Windows force-terminates a process about 5 seconds after a console-close event and about 20 seconds after a shutdown event. If you rely on draining, keep
shutdown_timeoutbelow that, for example with.shutdown_timeout(Duration::from_secs(4)). - Static files: besides the protections on every platform (
.., encoded separators, symlink escapes),ServeDirrejects:- drive and stream syntax (
C:,file:stream) - DOS device names (
CON,NUL,COM1,lpt1.txt, ...) - names ending in a dot or space, which Win32 silently strips (
secret.txt.would opensecret.txt)
- drive and stream syntax (
- Line endings:
.gitattributeskeeps every file LF on checkout, so templates, generated code and byte-exact tests behave the same as on Unix. Editors on Windows handle LF fine.
Setting up on macOS
Install the Xcode command-line tools (xcode-select --install) and Rust from https://rustup.rs. Then follow the same steps as on Linux. brew install wrk (or cargo install oha) gives you a load generator.
Deploying
Any of the three platforms works in production. For the highest throughput, deploy on Linux, for example in the slim container image that zapline new generates. That's where the thread-per-core runtime applies.