summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-29 23:20:07 +0100
committersalmonik <salmonik@tuta.io>2026-10-29 23:20:07 +0100
commitd44f647e45745e1ce6073ec2a28dffb5887120dd (patch)
tree5faccc829f087ed5abb38bd3f86cdf1497270c1f
parentPLN changed to Kromer (diff)
downloadzagan-bet-d44f647e45745e1ce6073ec2a28dffb5887120dd.tar.gz
zagan-bet-d44f647e45745e1ce6073ec2a28dffb5887120dd.zip
v3.1.1: make native-tls optional so the client cross-compiles without OpenSSL
-rw-r--r--Cargo.toml20
-rw-r--r--docs/TESTING.md24
2 files changed, 42 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index f212238..d13a16c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,8 +1,24 @@
1[package] 1[package]
2name = "zagan-bet" 2name = "zagan-bet"
3version = "3.1.0" 3version = "3.1.1"
4edition = "2024" 4edition = "2024"
5 5
6[features]
7default = ["server"]
8# The server links native-tls (OpenSSL). The client is rustls-only, so 32-bit
9# builds can skip the server dependency entirely:
10# cargo build --bin client --no-default-features --target i686-unknown-linux-gnu
11server = ["native-tls"]
12
13[[bin]]
14name = "client"
15path = "src/bin/client/main.rs"
16
17[[bin]]
18name = "server"
19path = "src/bin/server/main.rs"
20required-features = ["server"]
21
6[dependencies] 22[dependencies]
7rusqlite = { version = "0.29", features = ["bundled"] } 23rusqlite = { version = "0.29", features = ["bundled"] }
8crossterm = "0.27" 24crossterm = "0.27"
@@ -14,5 +30,5 @@ ctrlc = "3.4"
14serde = { version = "1.0", features = ["derive"] } 30serde = { version = "1.0", features = ["derive"] }
15serde_json = "1.0" 31serde_json = "1.0"
16uuid = { version = "1.0", features = ["v4"] } 32uuid = { version = "1.0", features = ["v4"] }
17native-tls = "0.2" 33native-tls = { version = "0.2", optional = true }
18rustls = { version = "0.21", features = ["dangerous_configuration"] } 34rustls = { version = "0.21", features = ["dangerous_configuration"] }
diff --git a/docs/TESTING.md b/docs/TESTING.md
index 0c931d8..c68b6c4 100644
--- a/docs/TESTING.md
+++ b/docs/TESTING.md
@@ -9,6 +9,30 @@ cargo test
9The suite is deterministic and headless: no network, no PTY, no sleeps, no 9The suite is deterministic and headless: no network, no PTY, no sleeps, no
10shared global database. Each test owns its state. 10shared global database. Each test owns its state.
11 11
12## Cross-compiling the client
13
14The client is rustls-only. The server is the only thing that links OpenSSL via
15`native-tls`, so it is behind the default `server` feature. Building the client
16for another target does not need that toolchain at all:
17
18```sh
19rustup target add i686-unknown-linux-gnu
20cargo build --release --bin client --no-default-features \
21 --target i686-unknown-linux-gnu
22```
23
24`--no-default-features` drops `native-tls`, which is what fails with
25`Could not find OpenSSL` when no 32-bit OpenSSL is installed. `rusqlite` is
26bundled and `ring` (rustls) only needs `gcc -m32`, which a normal multilib
27setup provides. The binary can be checked with
28`file target/i686-unknown-linux-gnu/release/client`; it must say `ELF 32-bit`
29and `Intel i386`.
30
31Building the server for i686 is a different problem: it needs 32-bit OpenSSL
32headers and libraries (`libssl-dev:i386` plus
33`PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig`),
34or a vendored OpenSSL.
35
12| File | Covers | 36| File | Covers |
13| --- | --- | 37| --- | --- |
14| `tests/client_core.rs` | Client command/game flows via a headless screen applying logical effects. | 38| `tests/client_core.rs` | Client command/game flows via a headless screen applying logical effects. |