diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-29 23:20:07 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-29 23:20:07 +0100 |
| commit | d44f647e45745e1ce6073ec2a28dffb5887120dd (patch) | |
| tree | 5faccc829f087ed5abb38bd3f86cdf1497270c1f | |
| parent | PLN changed to Kromer (diff) | |
| download | zagan-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.toml | 20 | ||||
| -rw-r--r-- | docs/TESTING.md | 24 |
2 files changed, 42 insertions, 2 deletions
| @@ -1,8 +1,24 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | name = "zagan-bet" | 2 | name = "zagan-bet" |
| 3 | version = "3.1.0" | 3 | version = "3.1.1" |
| 4 | edition = "2024" | 4 | edition = "2024" |
| 5 | 5 | ||
| 6 | [features] | ||
| 7 | default = ["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 | ||
| 11 | server = ["native-tls"] | ||
| 12 | |||
| 13 | [[bin]] | ||
| 14 | name = "client" | ||
| 15 | path = "src/bin/client/main.rs" | ||
| 16 | |||
| 17 | [[bin]] | ||
| 18 | name = "server" | ||
| 19 | path = "src/bin/server/main.rs" | ||
| 20 | required-features = ["server"] | ||
| 21 | |||
| 6 | [dependencies] | 22 | [dependencies] |
| 7 | rusqlite = { version = "0.29", features = ["bundled"] } | 23 | rusqlite = { version = "0.29", features = ["bundled"] } |
| 8 | crossterm = "0.27" | 24 | crossterm = "0.27" |
| @@ -14,5 +30,5 @@ ctrlc = "3.4" | |||
| 14 | serde = { version = "1.0", features = ["derive"] } | 30 | serde = { version = "1.0", features = ["derive"] } |
| 15 | serde_json = "1.0" | 31 | serde_json = "1.0" |
| 16 | uuid = { version = "1.0", features = ["v4"] } | 32 | uuid = { version = "1.0", features = ["v4"] } |
| 17 | native-tls = "0.2" | 33 | native-tls = { version = "0.2", optional = true } |
| 18 | rustls = { version = "0.21", features = ["dangerous_configuration"] } | 34 | rustls = { 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 | |||
| 9 | The suite is deterministic and headless: no network, no PTY, no sleeps, no | 9 | The suite is deterministic and headless: no network, no PTY, no sleeps, no |
| 10 | shared global database. Each test owns its state. | 10 | shared global database. Each test owns its state. |
| 11 | 11 | ||
| 12 | ## Cross-compiling the client | ||
| 13 | |||
| 14 | The 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 | ||
| 16 | for another target does not need that toolchain at all: | ||
| 17 | |||
| 18 | ```sh | ||
| 19 | rustup target add i686-unknown-linux-gnu | ||
| 20 | cargo 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 | ||
| 26 | bundled and `ring` (rustls) only needs `gcc -m32`, which a normal multilib | ||
| 27 | setup provides. The binary can be checked with | ||
| 28 | `file target/i686-unknown-linux-gnu/release/client`; it must say `ELF 32-bit` | ||
| 29 | and `Intel i386`. | ||
| 30 | |||
| 31 | Building the server for i686 is a different problem: it needs 32-bit OpenSSL | ||
| 32 | headers and libraries (`libssl-dev:i386` plus | ||
| 33 | `PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig`), | ||
| 34 | or 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. | |
