diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..360564471 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,3 @@ + +[target.armv7-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8de631903..156630dad 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,12 +1,12 @@ # syntax=docker/dockerfile:1 ARG debian_version=slim-bookworm -ARG rust_version=1.73.0 +ARG rust_version=1.74.0 FROM rust:${rust_version}-${debian_version} ARG DEBIAN_FRONTEND=noninteractive ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse" ENV RUST_BACKTRACE=1 -ENV RUSTFLAGS=-Dwarnings +ENV RUSTFLAGS="-D warnings -A renamed-and-removed-lints" RUN apt-get update && \ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32fe3be28..46e8c8153 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ on: env: RUST_BACKTRACE: 1 KEYMASTER_CLIENT_ID: ${{ secrets.KEYMASTER_CLIENT_ID }} - RUSTFLAGS: -D warnings + RUSTFLAGS: -D warnings -A renamed-and-removed-lints # The layering here is as follows: # 1. code formatting @@ -117,7 +117,7 @@ jobs: matrix: os: [ubuntu-latest] toolchain: - - "1.73" # MSRV (Minimum supported rust version) + - "1.74" # MSRV (Minimum supported rust version) - stable experimental: [false] # Ignore failures in beta @@ -171,12 +171,16 @@ jobs: matrix: os: [windows-latest] toolchain: - - "1.73" # MSRV (Minimum supported rust version) + - "1.74" # MSRV (Minimum supported rust version) - stable steps: - name: Checkout code uses: actions/checkout@v4.1.7 + # hyper-rustls >=0.27 uses aws-lc as default backend which requires NASM to build + - name: Install NASM + uses: ilammy/setup-nasm@v1.5.1 + - name: Write Build Configuration File uses: DamianReeves/write-file-action@v1.0 with: @@ -221,7 +225,7 @@ jobs: os: [ubuntu-latest] target: [armv7-unknown-linux-gnueabihf] toolchain: - - "1.73" # MSRV (Minimum supported rust version) + - "1.74" # MSRV (Minimum supported rust version) - stable steps: - name: Checkout code @@ -251,7 +255,15 @@ jobs: ~/.cargo/git target key: ${{ runner.os }}-${{ matrix.target }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} - - name: Install cross - run: cargo install cross || true + + - name: Install the cross compiler targets + run: rustup target add ${{ matrix.target }} + + - name: Install cross compiler toolchain + run: sudo apt-get install -y gcc-arm-linux-gnueabihf + - name: Build - run: cross build --target ${{ matrix.target }} --no-default-features + run: cargo build --verbose --target ${{ matrix.target }} --no-default-features + + - name: Check binary + run: file target/${{ matrix.target }}/debug/librespot diff --git a/.gitignore b/.gitignore index 336924d75..6f1ead001 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ target -.cargo spotify_appkey.key .vagrant/ .project diff --git a/CHANGELOG.md b/CHANGELOG.md index 6896180cb..f320c104a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ https://github.com/librespot-org/librespot configurations. - [audio] Files are now downloaded over the HTTPS CDN (breaking) - [audio] Improve file opening and seeking performance (breaking) -- [core] MSRV is now 1.73 (breaking) +- [core] MSRV is now 1.74 (breaking) - [connect] `DeviceType` moved out of `connect` into `core` (breaking) - [connect] Update and expose all `spirc` context fields (breaking) - [connect] Add `Clone, Defaut` traits to `spirc` contexts diff --git a/Cargo.lock b/Cargo.lock index a576d998e..42910b831 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,6 +149,33 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "aws-lc-rs" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f95446d919226d587817a7d21379e6eb099b97b45110a7f272a444ca5c54070" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5055edc4a9a1b2a917a818258cdfb86a535947feebd9981adc99667a062c6f85" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + [[package]] name = "backtrace" version = "0.3.73" @@ -194,12 +221,15 @@ dependencies = [ "itertools 0.12.1", "lazy_static", "lazycell", + "log", + "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", "syn 2.0.77", + "which", ] [[package]] @@ -310,6 +340,15 @@ dependencies = [ "libloading 0.8.5", ] +[[package]] +name = "cmake" +version = "0.1.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.2" @@ -420,6 +459,41 @@ dependencies = [ "cipher", ] +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.77", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.77", +] + [[package]] name = "dasp_sample" version = "0.11.0" @@ -452,6 +526,37 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derive_builder" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" +dependencies = [ + "derive_builder_core", + "syn 2.0.77", +] + [[package]] name = "digest" version = "0.10.7" @@ -474,6 +579,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "either" version = "1.13.0" @@ -555,6 +666,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures" version = "0.3.30" @@ -680,6 +797,18 @@ dependencies = [ "wasi", ] +[[package]] +name = "getset" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "gimli" version = "0.29.0" @@ -1081,10 +1210,10 @@ dependencies = [ "headers", "http", "hyper", - "hyper-rustls", + "hyper-rustls 0.26.0", "hyper-util", "pin-project-lite", - "rustls-native-certs", + "rustls-native-certs 0.7.3", "tokio", "tokio-rustls 0.25.0", "tower-service", @@ -1103,13 +1232,32 @@ dependencies = [ "hyper-util", "log", "rustls 0.22.4", - "rustls-native-certs", + "rustls-native-certs 0.7.3", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", "tower-service", ] +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "log", + "rustls 0.23.12", + "rustls-native-certs 0.8.0", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.7" @@ -1130,6 +1278,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.5.0" @@ -1440,7 +1594,7 @@ dependencies = [ "httparse", "hyper", "hyper-proxy2", - "hyper-rustls", + "hyper-rustls 0.27.3", "hyper-util", "librespot-protocol", "log", @@ -1470,7 +1624,7 @@ dependencies = [ "tokio-util", "url", "uuid", - "vergen", + "vergen-gitcl", ] [[package]] @@ -1630,6 +1784,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "muldiv" version = "1.0.1" @@ -2061,6 +2221,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn 2.0.77", +] + [[package]] name = "priority-queue" version = "2.1.0" @@ -2081,6 +2251,30 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.86" @@ -2143,9 +2337,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.32.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" dependencies = [ "memchr", "serde", @@ -2255,9 +2449,9 @@ dependencies = [ [[package]] name = "rodio" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1fceb9d127d515af1586d8d0cc601e1245bdb0af38e75c865a156290184f5b3" +checksum = "6006a627c1a38d37f3d3a85c6575418cfe34a5392d60a686d0071e1c8d427acb" dependencies = [ "cpal", "thiserror", @@ -2349,6 +2543,8 @@ version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ + "aws-lc-rs", + "log", "once_cell", "rustls-pki-types", "rustls-webpki", @@ -2369,6 +2565,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -2391,6 +2600,7 @@ version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -2434,9 +2644,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sdl2" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8356b2697d1ead5a34f40bcc3c5d3620205fe0c7be0a14656223bfeec0258891" +checksum = "3b498da7d14d1ad6c839729bd4ad6fc11d90a57583605f3b4df2cd709a9cd380" dependencies = [ "bitflags 1.3.2", "lazy_static", @@ -2446,9 +2656,9 @@ dependencies = [ [[package]] name = "sdl2-sys" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26bcacfdd45d539fb5785049feb0038a63931aa896c7763a2a12e125ec58bd29" +checksum = "951deab27af08ed9c6068b7b0d05a93c91f0a8eb16b6b816a5e73452a43521d3" dependencies = [ "cfg-if", "libc", @@ -2648,6 +2858,12 @@ dependencies = [ "webpki", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "subtle" version = "2.6.1" @@ -2762,16 +2978,15 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.13" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" +checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be" dependencies = [ - "cfg-if", "core-foundation-sys", "libc", + "memchr", "ntapi", - "once_cell", - "windows 0.52.0", + "windows 0.54.0", ] [[package]] @@ -2955,7 +3170,7 @@ dependencies = [ "futures-util", "log", "rustls 0.23.12", - "rustls-native-certs", + "rustls-native-certs 0.7.3", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -3155,14 +3370,41 @@ dependencies = [ [[package]] name = "vergen" -version = "8.3.2" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566" +checksum = "c32e7318e93a9ac53693b6caccfb05ff22e04a44c7cf8a279051f24c09da286f" dependencies = [ "anyhow", - "cfg-if", + "derive_builder", "rustversion", "time", + "vergen-lib", +] + +[[package]] +name = "vergen-gitcl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bbdc9746577cb4767f218d320ee0b623d415e8130332f8f562b910b61cc2c4e" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", + "time", + "vergen", + "vergen-lib", +] + +[[package]] +name = "vergen-lib" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e06bee42361e43b60f363bad49d63798d0f42fb1768091812270eca00c784720" +dependencies = [ + "anyhow", + "derive_builder", + "getset", + "rustversion", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 19a450b96..7854602bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "spotty" version = "1.9.9" -rust-version = "1.73" +rust-version = "1.74" authors = ["Librespot Org", "Michael Herger "] license = "MIT" description = "An open source client library for Spotify, with support for Spotify Connect" @@ -60,7 +60,7 @@ log = "0.4" rpassword = "7.0" serde_json = "1.0" sha1 = "0.10" -sysinfo = { version = "0.30.5", default-features = false } +sysinfo = { version = "0.31.3", default-features = false, features = ["system"] } thiserror = "1.0" tokio = { version = "1", features = ["rt", "macros", "signal", "sync", "parking_lot", "process"] } url = "2.2" diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 3610ed4ce..ec0945a5a 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "librespot-audio" version = "0.5.0-dev" -rust-version = "1.73" +rust-version = "1.74" authors = ["Paul Lietar "] description = "The audio fetching logic for librespot" license = "MIT" diff --git a/connect/Cargo.toml b/connect/Cargo.toml index 3c3bbe842..14fad592c 100644 --- a/connect/Cargo.toml +++ b/connect/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "librespot-connect" version = "0.5.0-dev" -rust-version = "1.73" +rust-version = "1.74" authors = ["Paul Lietar "] description = "The discovery and Spotify Connect logic for librespot" license = "MIT" diff --git a/contrib/Dockerfile b/contrib/Dockerfile index 448a8f387..377ece7ac 100644 --- a/contrib/Dockerfile +++ b/contrib/Dockerfile @@ -28,7 +28,7 @@ RUN apt-get install -y curl git build-essential crossbuild-essential-arm64 cross RUN apt-get install -y libasound2-dev libasound2-dev:arm64 libasound2-dev:armel libasound2-dev:armhf RUN apt-get install -y libpulse0 libpulse0:arm64 libpulse0:armel libpulse0:armhf -RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.73 -y +RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.74 -y ENV PATH="/root/.cargo/bin/:${PATH}" RUN rustup target add aarch64-unknown-linux-gnu RUN rustup target add arm-unknown-linux-gnueabi diff --git a/core/Cargo.toml b/core/Cargo.toml index ea9a906ef..680e6b900 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "librespot-core" version = "0.5.0-dev" -rust-version = "1.73" +rust-version = "1.74" authors = ["Paul Lietar "] build = "build.rs" description = "The core functionality provided by librespot" @@ -30,7 +30,7 @@ hyper = { version = "1.3", features = ["http1", "http2"] } hyper-util = { version = "0.1", features = ["client"] } http-body-util = "0.1.1" hyper-proxy2 = { version = "0.1", default-features = false, features = ["rustls"] } -hyper-rustls = { version = "0.26", features = ["http2"] } +hyper-rustls = { version = "0.27.2", features = ["http2"] } log = "0.4" nonzero_ext = "0.3" num-bigint = { version = "0.4", features = ["rand"] } @@ -42,14 +42,14 @@ parking_lot = { version = "0.12", features = ["deadlock_detection"] } pbkdf2 = { version = "0.12", default-features = false, features = ["hmac"] } priority-queue = "2.0" protobuf = "3" -quick-xml = { version = "0.32", features = ["serialize"] } +quick-xml = { version = "0.36.1", features = ["serialize"] } rand = "0.8" rsa = "0.9.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" sha1 = { version = "0.10", features = ["oid"] } shannon = "0.2" -sysinfo = { version = "0.30.5", default-features = false } +sysinfo = { version = "0.31.3", default-features = false, features = ["system"] } thiserror = "1.0" time = { version = "0.3", features = ["formatting", "parsing"] } tokio = { version = "1", features = ["io-util", "macros", "net", "parking_lot", "rt", "sync", "time"] } @@ -62,7 +62,7 @@ data-encoding = "2.5" [build-dependencies] rand = "0.8" -vergen = { version = "8", default-features = false, features = ["build", "git", "gitcl"] } +vergen-gitcl = { version = "1.0.0", default-features = false, features = ["build"] } [dev-dependencies] env_logger = "0.11.2" diff --git a/core/build.rs b/core/build.rs index 920455d08..008ec1d2b 100644 --- a/core/build.rs +++ b/core/build.rs @@ -1,11 +1,19 @@ use rand::{distributions::Alphanumeric, Rng}; -use vergen::EmitBuilder; +use vergen_gitcl::{BuildBuilder, Emitter, GitclBuilder}; -fn main() { - EmitBuilder::builder() - .build_date() // outputs 'VERGEN_BUILD_DATE' - .git_sha(true) // outputs 'VERGEN_GIT_SHA', and sets the 'short' flag true - .git_commit_date() // outputs 'VERGEN_GIT_COMMIT_DATE' +fn main() -> Result<(), Box> { + let gitcl = GitclBuilder::default() + .sha(true) // outputs 'VERGEN_GIT_SHA', and sets the 'short' flag true + .commit_date(true) // outputs 'VERGEN_GIT_COMMIT_DATE' + .build()?; + + let build = BuildBuilder::default() + .build_date(true) // outputs 'VERGEN_BUILD_DATE' + .build()?; + + Emitter::default() + .add_instructions(&build)? + .add_instructions(&gitcl)? .emit() .expect("Unable to generate the cargo keys!"); let build_id = match std::env::var("SOURCE_DATE_EPOCH") { @@ -18,4 +26,5 @@ fn main() { }; println!("cargo:rustc-env=LIBRESPOT_BUILD_ID={build_id}"); + Ok(()) } diff --git a/discovery/Cargo.toml b/discovery/Cargo.toml index 8076d8e45..f8b317dc0 100644 --- a/discovery/Cargo.toml +++ b/discovery/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "librespot-discovery" version = "0.5.0-dev" -rust-version = "1.73" +rust-version = "1.74" authors = ["Paul Lietar "] description = "The discovery logic for librespot" license = "MIT" diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml index 449cd3d52..bdc2da381 100644 --- a/metadata/Cargo.toml +++ b/metadata/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "librespot-metadata" version = "0.5.0-dev" -rust-version = "1.73" +rust-version = "1.74" authors = ["Paul Lietar "] description = "The metadata logic for librespot" license = "MIT" diff --git a/playback/Cargo.toml b/playback/Cargo.toml index ce60fd290..3e6b39620 100644 --- a/playback/Cargo.toml +++ b/playback/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "librespot-playback" version = "0.5.0-dev" -rust-version = "1.73" +rust-version = "1.74" authors = ["Sasha Hilton "] description = "The audio playback logic for librespot" license = "MIT" @@ -36,14 +36,14 @@ portaudio-rs = { version = "0.3", optional = true } libpulse-binding = { version = "2", optional = true, default-features = false } libpulse-simple-binding = { version = "2", optional = true, default-features = false } jack = { version = "0.11", optional = true } -sdl2 = { version = "0.36", optional = true } +sdl2 = { version = "0.37", optional = true } gstreamer = { version = "0.22.1", optional = true } gstreamer-app = { version = "0.22.0", optional = true } gstreamer-audio = { version = "0.22.0", optional = true } glib = { version = "0.19.2", optional = true } # Rodio dependencies -rodio = { version = "0.18.1", optional = true, default-features = false } +rodio = { version = "0.19.0", optional = true, default-features = false } cpal = { version = "0.15.1", optional = true } # Container and audio decoder diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index 7e69971af..28fb3b7f7 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "librespot-protocol" version = "0.5.0-dev" -rust-version = "1.73" +rust-version = "1.74" authors = ["Paul LiƩtar "] build = "build.rs" description = "The protobuf logic for communicating with Spotify servers" diff --git a/src/main.rs b/src/main.rs index 14962b441..bbd99d976 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use std::{ str::FromStr, time::{Duration, Instant}, }; -use sysinfo::System; +use sysinfo::{ProcessesToUpdate, System}; use thiserror::Error; use url::Url; @@ -52,7 +52,9 @@ const VERSION: &str = concat!(env!("CARGO_PKG_NAME"), " v", env!("CARGO_PKG_VERS #[cfg(feature = "alsa-backend")] use librespot::playback::mixer::alsamixer::AlsaMixer; +#[cfg(not(feature = "spotty"))] mod player_event_handler; +#[cfg(not(feature = "spotty"))] use player_event_handler::{run_program_on_sink_events, EventHandler}; fn device_id(name: &str) -> String { @@ -200,7 +202,9 @@ struct Setup { credentials: Option, enable_discovery: bool, zeroconf_port: u16, + #[allow(unused)] player_event_program: Option, + #[allow(unused)] emit_sink_events: bool, zeroconf_ip: Vec, // spotty @@ -1848,6 +1852,7 @@ async fn main() { let mut auto_connect_times: Vec = vec![]; let mut discovery = None; let mut connecting = false; + #[cfg(not(feature = "spotty"))] let mut _event_handler: Option = None; let mut session = Session::new(setup.session_config.clone(), setup.cache.clone()); @@ -1878,7 +1883,7 @@ async fn main() { { Ok(d) => break Some(d), Err(e) => { - sys.refresh_processes(); + sys.refresh_processes(ProcessesToUpdate::All); if System::uptime() <= 1 { debug!("Retrying to initialise discovery: {e}"); diff --git a/src/spotty.rs b/src/spotty.rs index d2fcf7060..1f375365e 100644 --- a/src/spotty.rs +++ b/src/spotty.rs @@ -219,14 +219,14 @@ impl LMS { // track_id.to_base62().unwrap_or_default() // ); // } -// PlayerEvent::Stopped { track_id, .. } => { -// #[cfg(debug_assertions)] -// info!( -// "event: stopped, track: {}", -// track_id.to_base62().unwrap_or_default() -// ); -// command = r#"["spottyconnect","stop"]"#.to_string(); -// } + // PlayerEvent::Stopped { track_id, .. } => { + // #[cfg(debug_assertions)] + // info!( + // "event: stopped, track: {}", + // track_id.to_base62().unwrap_or_default() + // ); + // command = r#"["spottyconnect","stop"]"#.to_string(); + // } PlayerEvent::Playing { track_id, play_request_id, @@ -309,27 +309,27 @@ impl LMS { auth_header = auth.trim().to_string(); } -// let req = Request::builder() -// .method(Method::POST) -// .uri(base_url.to_string()) -// .header("user-agent", VERSION.to_string()) -// .header("content-type", "application/json") -// .header("authorization", format!("Basic {}", auth_header)) -// .header("x-scanner", "1") -// .body(Body::from(json.clone())); - -// let client = Client::new(); -// let resp = client.request(req).await; - -// match resp { -// Ok(resp) => { -// #[cfg(debug_assertions)] -// info!("Response: {}", resp.status()); -// } -// Err(error) => { -// warn!("Problem posting to {} / {}: {:?}", base_url, json, error); -// } -// } + // let req = Request::builder() + // .method(Method::POST) + // .uri(base_url.to_string()) + // .header("user-agent", VERSION.to_string()) + // .header("content-type", "application/json") + // .header("authorization", format!("Basic {}", auth_header)) + // .header("x-scanner", "1") + // .body(Body::from(json.clone())); + + // let client = Client::new(); + // let resp = client.request(req).await; + + // match resp { + // Ok(resp) => { + // #[cfg(debug_assertions)] + // info!("Response: {}", resp.status()); + // } + // Err(error) => { + // warn!("Problem posting to {} / {}: {:?}", base_url, json, error); + // } + // } } } } diff --git a/test.sh b/test.sh index 0d6bb291c..0d0c34adc 100755 --- a/test.sh +++ b/test.sh @@ -3,7 +3,7 @@ set -e # this script runs the tests and checks that also run as part of the`test.yml` github action workflow - +cargo clean cargo fmt --all -- --check cargo clippy -p librespot-core --no-default-features cargo clippy -p librespot-core