From 02f419994255960dfc702c3d41c246350e2639ac Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Mon, 10 Nov 2025 20:51:40 +0100 Subject: [PATCH 1/8] ci: improve feature checking - check any tls feature - check each-feature with native-tls --- .github/workflows/build.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ab2ce9a0..346ba189b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,27 +72,17 @@ jobs: - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack - - name: Check packages without TLS requirements - run: cargo hack check -p librespot-protocol --each-feature - - - name: Check workspace with native-tls - run: > - cargo hack check -p librespot --each-feature --exclude-all-features - --include-features native-tls - --exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots - - - name: Check workspace with rustls-tls-native-roots + - name: Check binary with any tls option run: > - cargo hack check -p librespot --each-feature --exclude-all-features - --include-features rustls-tls-native-roots - --exclude-features native-tls,rustls-tls-webpki-roots + cargo hack check -p librespot --each-feature + --exclude-no-default-features --exclude-all-features + --include-features native-tls,rustls-tls-native-roots,rustls-tls-webpki-roots - - name: Check discovery features (Linux only) - if: runner.os == 'Linux' + - name: Check binary with each-feature (native-tls) run: > - cargo hack check -p librespot-discovery --each-feature --exclude-all-features - --include-features native-tls - --exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots + cargo hack check -p librespot --each-feature + --exclude-no-default-features --exclude-all-features + --features native-tls --skip rustls-tls-native-roots,rustls-tls-webpki-roots - name: Build binary with default features run: cargo build --frozen From bc9b12fd1d3759228f7c108b867ee976cf805d5e Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Tue, 11 Nov 2025 14:31:04 +0100 Subject: [PATCH 2/8] ci: separate between cross and linux only features --- .github/workflows/build.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 346ba189b..a67138f4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,7 @@ name: build env: RUST_BACKTRACE: 1 RUSTFLAGS: -D warnings + LINUX_FEATURES: alsa-backend,pulseaudio-backend,jackaudio-backend,with-avahi jobs: test: @@ -78,11 +79,18 @@ jobs: --exclude-no-default-features --exclude-all-features --include-features native-tls,rustls-tls-native-roots,rustls-tls-webpki-roots - - name: Check binary with each-feature (native-tls) + - name: Check binary features (platform independent) run: > cargo hack check -p librespot --each-feature - --exclude-no-default-features --exclude-all-features - --features native-tls --skip rustls-tls-native-roots,rustls-tls-webpki-roots + --exclude-no-default-features --exclude-all-features --features native-tls + --exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots,${{ env.LINUX_FEATURES }} + + - name: Check binary features (linux) + if: runner.os == 'Linux' + run: > + cargo hack check -p librespot --each-feature + --exclude-no-default-features --exclude-all-features --features native-tls + --include-features ${{ env.LINUX_FEATURES }} - name: Build binary with default features run: cargo build --frozen From 3abe3b73108a130a76bb0a9cc769a1c84f2d7a49 Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Thu, 13 Nov 2025 00:16:41 +0100 Subject: [PATCH 3/8] ci: install required packages for windows, cache gstreamer --- .github/workflows/build.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a67138f4f..42c41c943 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,7 @@ name: build env: RUST_BACKTRACE: 1 RUSTFLAGS: -D warnings + GSTREAMER_WIN_PATH: D:\gstreamer LINUX_FEATURES: alsa-backend,pulseaudio-backend,jackaudio-backend,with-avahi jobs: @@ -61,6 +62,22 @@ jobs: gstreamer1.0-dev libgstreamer-plugins-base1.0-dev libavahi-compat-libdnssd-dev + - name: Install developer package dependencies (Windows) + if: runner.os == 'Windows' + run: choco install pkgconfiglite + + - name: Cache gstreamer (Windows) + uses: actions/cache@v4 + id: cache-gstreamer + if: runner.os == 'Windows' + with: + path: ${{ env.GSTREAMER_WIN_PATH }} + key: gstreamer-Windows-${{ hashFiles('**/Cargo.lock') }} + + - name: Install gstreamer (Windows) + if: ${{ runner.os == 'Windows' && !steps.cache-gstreamer.outputs.cache-hit }} + run: choco install gstreamer-devel + - name: Fetch dependencies run: cargo fetch --locked @@ -80,6 +97,8 @@ jobs: --include-features native-tls,rustls-tls-native-roots,rustls-tls-webpki-roots - name: Check binary features (platform independent) + env: + PKG_CONFIG_PATH: ${{ env.GSTREAMER_WIN_PATH }}\1.0\msvc_x86_64\lib\pkgconfig run: > cargo hack check -p librespot --each-feature --exclude-no-default-features --exclude-all-features --features native-tls From 2704eb920dedd6ee58f6382f55cd13acb875f02c Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Fri, 14 Nov 2025 12:45:56 +0100 Subject: [PATCH 4/8] ci: mark `rodiojack-backend` feature as "not windows, yet" --- .github/workflows/build.yml | 6 +++--- Cargo.toml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42c41c943..214896646 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ env: RUST_BACKTRACE: 1 RUSTFLAGS: -D warnings GSTREAMER_WIN_PATH: D:\gstreamer - LINUX_FEATURES: alsa-backend,pulseaudio-backend,jackaudio-backend,with-avahi + NOT_WINDOWS_FEATURES: alsa-backend,pulseaudio-backend,jackaudio-backend,rodiojack-backend,with-avahi jobs: test: @@ -102,14 +102,14 @@ jobs: run: > cargo hack check -p librespot --each-feature --exclude-no-default-features --exclude-all-features --features native-tls - --exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots,${{ env.LINUX_FEATURES }} + --exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots,${{ env.NOT_WINDOWS_FEATURES }} - name: Check binary features (linux) if: runner.os == 'Linux' run: > cargo hack check -p librespot --each-feature --exclude-no-default-features --exclude-all-features --features native-tls - --include-features ${{ env.LINUX_FEATURES }} + --include-features ${{ env.NOT_WINDOWS_FEATURES }} - name: Build binary with default features run: cargo build --frozen diff --git a/Cargo.toml b/Cargo.toml index c89262505..2acdc309b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,9 +78,6 @@ rustls-tls-webpki-roots = [ # on macOS. rodio-backend = ["librespot-playback/rodio-backend"] -# rodiojack-backend: Rodio backend with JACK support for professional audio setups. -rodiojack-backend = ["librespot-playback/rodiojack-backend"] - # gstreamer-backend: Uses GStreamer multimedia framework for audio output. # Provides extensive audio processing capabilities. gstreamer-backend = ["librespot-playback/gstreamer-backend"] @@ -105,6 +102,9 @@ pulseaudio-backend = ["librespot-playback/pulseaudio-backend"] # Professional audio backend for low-latency, high-quality audio routing. jackaudio-backend = ["librespot-playback/jackaudio-backend"] +# rodiojack-backend: Rodio backend with JACK support for professional audio setups. (not windows, yet) +rodiojack-backend = ["librespot-playback/rodiojack-backend"] + # Network discovery backends - choose one for Spotify Connect device discovery # See COMPILING.md for dependencies and platform support. From a771e11c389e05a751ed3e3804f95289e89fe4d6 Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Tue, 18 Nov 2025 23:11:33 +0100 Subject: [PATCH 5/8] ci: exclude `with-dns-sd` feature from windows build --- .github/workflows/build.yml | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 214896646..e8ea739e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ env: RUST_BACKTRACE: 1 RUSTFLAGS: -D warnings GSTREAMER_WIN_PATH: D:\gstreamer - NOT_WINDOWS_FEATURES: alsa-backend,pulseaudio-backend,jackaudio-backend,rodiojack-backend,with-avahi + NOT_WINDOWS_FEATURES: alsa-backend,pulseaudio-backend,jackaudio-backend,rodiojack-backend,with-avahi,with-dns-sd jobs: test: diff --git a/Cargo.toml b/Cargo.toml index 2acdc309b..c1546568d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -119,7 +119,7 @@ with-libmdns = ["librespot-discovery/with-libmdns"] # libavahi-client-dev. with-avahi = ["librespot-discovery/with-avahi"] -# with-dns-sd: Uses DNS Service Discovery (cross-platform). +# with-dns-sd: Uses DNS Service Discovery (Linux and macOS only). # On macOS uses Bonjour, on Linux uses Avahi compatibility layer. Choose this for tight system # integration on macOS or when using Avahi's dns-sd compatibility mode on Linux. with-dns-sd = ["librespot-discovery/with-dns-sd"] From 179672cea4e5512bf4a8a5a0440fa6c2b1b92317 Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Wed, 19 Nov 2025 22:45:27 +0100 Subject: [PATCH 6/8] ci: only execute windows on default branch --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8ea739e6..0502281bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,12 @@ jobs: toolchain: - "1.85" # MSRV (Minimum supported rust version) - stable + isDefault: + - ${{ github.ref_name == github.event.repository.default_branch }} + exclude: + - isDefault: false + os: 'windows-latest' + steps: - name: Checkout code uses: actions/checkout@v5 @@ -96,7 +102,7 @@ jobs: --exclude-no-default-features --exclude-all-features --include-features native-tls,rustls-tls-native-roots,rustls-tls-webpki-roots - - name: Check binary features (platform independent) + - name: Check binary features (cross-platform) env: PKG_CONFIG_PATH: ${{ env.GSTREAMER_WIN_PATH }}\1.0\msvc_x86_64\lib\pkgconfig run: > From b6f41341fadf5c3f18b23ae98bffd1f4a56dd3ec Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Thu, 20 Nov 2025 17:19:30 +0100 Subject: [PATCH 7/8] ci: optional windows execution in PR-CI --- .github/workflows/build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0502281bc..bda4b6330 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,7 @@ name: build - "**/Dockerfile*" - "test.sh" pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] paths-ignore: - "**.md" - "docs/**" @@ -42,11 +43,15 @@ jobs: toolchain: - "1.85" # MSRV (Minimum supported rust version) - stable - isDefault: - - ${{ github.ref_name == github.event.repository.default_branch }} + isPR: + - ${{ github.event.pull_request }} + isCIWindows: + - ${{ github.event.pull_request && contains(github.event.pull_request.labels.*.name, 'CI:Windows') }} exclude: - - isDefault: false - os: 'windows-latest' + # excludes windows in a PR by default, unless labeled with 'CI:Windows' + - os: 'windows-latest' + isPR: true + isCIWindows: false steps: - name: Checkout code From 1d30fccc8161c63eca7402450cd862cca1ef8ef4 Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Thu, 20 Nov 2025 17:52:29 +0100 Subject: [PATCH 8/8] ci: wrong assumption, better label naming --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bda4b6330..0b1cb4de7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,11 +44,11 @@ jobs: - "1.85" # MSRV (Minimum supported rust version) - stable isPR: - - ${{ github.event.pull_request }} + - ${{ github.event_name == 'pull_request' }} isCIWindows: - - ${{ github.event.pull_request && contains(github.event.pull_request.labels.*.name, 'CI:Windows') }} + - ${{ github.event.pull_request && contains(github.event.pull_request.labels.*.name, format('CI{0} Windows', ':')) }} exclude: - # excludes windows in a PR by default, unless labeled with 'CI:Windows' + # excludes windows in a PR by default, unless labeled with 'CI: Windows' - os: 'windows-latest' isPR: true isCIWindows: false