From 4e6f7d0c41aeed85e24f89e8a50789f83dcd619f Mon Sep 17 00:00:00 2001 From: InstaZDLL Date: Sat, 17 Oct 2026 12:16:45 +0200 Subject: [PATCH] build: stop compiling libopus, and drop cmake from the image waveflow-core now keeps its libopus decoder behind an opus feature in its default set (InstaZDLL/WaveFlow#883). This server declares default-features = false and decodes through FFmpeg, so moving the pin removes opusic-sys and the cmake crate from the graph, and the builder stage no longer installs cmake. The pin also brings what landed on WaveFlow's main since bd8d360, which adds realfft for its rhythm analysis; lofty does not move. Closes #282 Signed-off-by: InstaZDLL --- Cargo.lock | 79 ++++++++++++++++++++++++++++++++++++++++-------------- Cargo.toml | 2 +- Dockerfile | 7 ++--- 3 files changed, 64 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dfe1a51..1b74c2f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -497,15 +497,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486" -[[package]] -name = "cmake" -version = "0.1.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" -dependencies = [ - "cc", -] - [[package]] name = "cmov" version = "0.5.4" @@ -1672,6 +1663,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1708,15 +1708,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "opusic-sys" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d1ecdf206421bc74343ab3bb2f30ad2abbfee41fa341f7181fecbaf957769a" -dependencies = [ - "cmake", -] - [[package]] name = "parking" version = "2.2.1" @@ -1843,6 +1834,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "primal-check" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08" +dependencies = [ + "num-integer", +] + [[package]] name = "proc-macro2" version = "1.0.107" @@ -2005,6 +2005,15 @@ dependencies = [ "rand_core 0.10.1", ] +[[package]] +name = "realfft" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f821338fddb99d089116342c46e9f1fbf3828dba077674613e734e01d6ea8677" +dependencies = [ + "rustfft", +] + [[package]] name = "redox_syscall" version = "0.5.18" @@ -2190,6 +2199,20 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" +[[package]] +name = "rustfft" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21db5f9893e91f41798c88680037dba611ca6674703c1a18601b01a72c8adb89" +dependencies = [ + "num-complex", + "num-integer", + "num-traits", + "primal-check", + "strength_reduce", + "transpose", +] + [[package]] name = "rustix" version = "1.1.4" @@ -2651,6 +2674,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + [[package]] name = "strict-num" version = "0.1.1" @@ -3223,6 +3252,16 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "transpose" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" +dependencies = [ + "num-integer", + "strength_reduce", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -3519,7 +3558,7 @@ dependencies = [ [[package]] name = "waveflow-core" version = "1.9.1" -source = "git+https://github.com/InstaZDLL/WaveFlow?rev=bd8d360cf3db4da946fcd52ec14ed912169c25ec#bd8d360cf3db4da946fcd52ec14ed912169c25ec" +source = "git+https://github.com/InstaZDLL/WaveFlow?rev=9b50f3de288d62b0ff9f867ab7bda504b255cc5c#9b50f3de288d62b0ff9f867ab7bda504b255cc5c" dependencies = [ "anyhow", "async-trait", @@ -3532,8 +3571,8 @@ dependencies = [ "image", "lofty", "md-5", - "opusic-sys", "pinyin", + "realfft", "regex", "reqwest", "resvg", diff --git a/Cargo.toml b/Cargo.toml index 995fb81..845e927 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ utoipa-scalar = { version = "0.4", features = ["axum"] } url = "2" uuid = { version = "1", features = ["v4", "v8", "serde"] } walkdir = "2" -waveflow-core = { git = "https://github.com/InstaZDLL/WaveFlow", rev = "bd8d360cf3db4da946fcd52ec14ed912169c25ec", default-features = false } +waveflow-core = { git = "https://github.com/InstaZDLL/WaveFlow", rev = "9b50f3de288d62b0ff9f867ab7bda504b255cc5c", default-features = false } [dev-dependencies] http-body-util = "0.1" diff --git a/Dockerfile b/Dockerfile index 9d1088e..8457045 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,10 @@ RUN bun run build FROM rust:1.98-bookworm AS builder WORKDIR /build -# cmake builds the libopus that waveflow-core bundles (`opusic-sys`); the -# rust image ships a C compiler but not cmake. -RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates cmake && rm -rf /var/lib/apt/lists/* +# No cmake: waveflow-core's libopus decoder sits behind its `opus` feature, +# which `default-features = false` leaves off. The server decodes through +# FFmpeg (#282). +RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/* COPY . . # After COPY . ., so the built assets win over any stale local dist/. COPY --from=web /web/dist ./webapp/dist