From 82d914ebbbb99c1f8b17f1ef9d654a767ad7621c Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Fri, 6 Jun 2025 13:48:45 +0200 Subject: [PATCH] chore: fix static release binaries using zigbuild --- Cargo.toml | 6 ++++++ Justfile | 21 ++++++++++++++------- README.md | 6 ++++-- otter.toml | 9 ++++++--- otter/Cargo.toml | 4 ++-- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b0064b5..c61cd7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,3 +14,9 @@ edition = "2024" rand = "0.8.5" tracing = "0.1.41" chrono = "0.4.39" + +[profile.release] +lto = "fat" +codegen-units = 1 +panic = "abort" +strip = true diff --git a/Justfile b/Justfile index ecf2c6f..c19ef20 100644 --- a/Justfile +++ b/Justfile @@ -6,15 +6,15 @@ alias b := build # Build statically linked release binaries for all supported architectures [group('build')] build-release-static: - cargo build \ + cargo zigbuild \ --release \ --frozen \ --workspace \ --target 'x86_64-unknown-linux-musl' \ --target 'aarch64-unknown-linux-musl' - [ "$(readelf -d target/x86_64-unknown-linux-musl/release/otterd | grep NEEDED | wc -l)" = 0 ] - [ "$(readelf -d target/aarch64-unknown-linux-musl/release/otterd | grep NEEDED | wc -l)" = 0 ] + [ "$(readelf -d target/x86_64-unknown-linux-musl/release/otter | grep NEEDED | wc -l)" = 0 ] + [ "$(readelf -d target/aarch64-unknown-linux-musl/release/otter | grep NEEDED | wc -l)" = 0 ] test: cargo test --frozen --workspace @@ -38,6 +38,13 @@ fetch: clean: cargo clean +run: + cargo run \ + --bin otter \ + -- serve \ + -c ./otter.toml \ + --log debug + doc: cargo doc --workspace --frozen @@ -45,10 +52,10 @@ publish-release-binaries tag: build-release-static curl \ --netrc \ --fail \ - --upload-file target/x86_64-unknown-linux-musl/release/otterd \ - https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/"{{ tag }}"/otterd-linux-amd64 + --upload-file target/x86_64-unknown-linux-musl/release/otter \ + https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/"{{ tag }}"/otter-linux-amd64 curl \ --netrc \ --fail \ - --upload-file target/aarch64-unknown-linux-musl/release/otterd \ - https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/"{{ tag }}"/otterd-linux-arm64 + --upload-file target/aarch64-unknown-linux-musl/release/otter \ + https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/"{{ tag }}"/otter-linux-arm64 diff --git a/README.md b/README.md index 5ef8cea..8691ec8 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,14 @@ Gpodder, suitable for low-power devices. ## Features -* Implementation of API sections needed for synchronisation +* Implementation of API sections needed for synchronization * Authentication * Devices API * Subscriptions API * Episode actions API - * Device synchronisation API + * Device synchronization API +* Easy-to-use server with flexible configuration + * Can listen on either a TCP or a Unix socket ## Configuration diff --git a/otter.toml b/otter.toml index 168a1f4..89481b4 100644 --- a/otter.toml +++ b/otter.toml @@ -1,6 +1,9 @@ data_dir = "./data" -domain = "127.0.0.1" -port = 8080 [net] -type = "tcp" +# type = "tcp" +# domain = "127.0.0.1" +# port = 8080 + +type = "unix" +path = "./otter.socket" diff --git a/otter/Cargo.toml b/otter/Cargo.toml index 1af69ef..5b98adc 100644 --- a/otter/Cargo.toml +++ b/otter/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "otter" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true [dependencies] gpodder = { path = "../gpodder" }