From dcd592bafb7f85b0f032ba2dca4988ad29d3d8d0 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Tue, 27 Aug 2024 23:16:48 +0200 Subject: [PATCH 1/6] Update MSRV to 1.74.0 and sysinfo to 0.31.3 Signed-off-by: yubiuser --- .devcontainer/Dockerfile | 2 +- .github/workflows/test.yml | 6 +++--- CHANGELOG.md | 2 +- Cargo.lock | 9 ++++----- Cargo.toml | 4 ++-- audio/Cargo.toml | 2 +- connect/Cargo.toml | 2 +- contrib/Dockerfile | 2 +- core/Cargo.toml | 4 ++-- discovery/Cargo.toml | 2 +- metadata/Cargo.toml | 2 +- playback/Cargo.toml | 2 +- protocol/Cargo.toml | 2 +- src/main.rs | 4 ++-- 14 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8de63190..c5cf4356 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ # 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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b22bd715..f5d81398 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -109,7 +109,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 @@ -163,7 +163,7 @@ 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 @@ -206,7 +206,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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6896180c..f320c104 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 24fe042c..ef1f4d75 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2939,16 +2939,15 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.12" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" +checksum = "2b92e0bdf838cbc1c4c9ba14f9c97a7ec6cdcd1ae66b10e1e42775a25553f45d" dependencies = [ - "cfg-if", "core-foundation-sys", "libc", + "memchr", "ntapi", - "once_cell", - "windows 0.52.0", + "windows 0.54.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b99531b6..00d94577 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "librespot" version = "0.5.0-dev" -rust-version = "1.73" +rust-version = "1.74" authors = ["Librespot Org"] license = "MIT" description = "An open source client library for Spotify, with support for Spotify Connect" @@ -57,7 +57,7 @@ getopts = "0.2" log = "0.4" rpassword = "7.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 3610ed4c..ec0945a5 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 3c3bbe84..14fad592 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 448a8f38..377ece7a 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 ea9a906e..6be4d567 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" @@ -49,7 +49,7 @@ 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"] } diff --git a/discovery/Cargo.toml b/discovery/Cargo.toml index 8076d8e4..f8b317dc 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 449cd3d5..bdc2da38 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 ce60fd29..282d5078 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" diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index 7e69971a..28fb3b7f 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 3e656be2..a6e54d44 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; @@ -1700,7 +1700,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}"); From dc229106735aba77bbcb2f72d6079ade9f44db5b Mon Sep 17 00:00:00 2001 From: yubiuser Date: Wed, 28 Aug 2024 13:13:29 +0200 Subject: [PATCH 2/6] Update vergen to version 9 by using the new vergen-gitctl libary Signed-off-by: yubiuser --- Cargo.lock | 149 ++++++++++++++++++++++++++++++++++++++++++++++-- core/Cargo.toml | 2 +- core/build.rs | 21 +++++-- 3 files changed, 161 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef1f4d75..92cc377e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -419,6 +419,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.66", +] + +[[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.66", +] + [[package]] name = "dasp_sample" version = "0.11.0" @@ -451,6 +486,37 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derive_builder" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" +dependencies = [ + "derive_builder_core", + "syn 2.0.66", +] + [[package]] name = "digest" version = "0.10.7" @@ -690,6 +756,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" @@ -1264,6 +1342,12 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "1.0.0" @@ -1641,7 +1725,7 @@ dependencies = [ "tokio-util", "url", "uuid", - "vergen", + "vergen-gitcl", ] [[package]] @@ -2264,6 +2348,30 @@ dependencies = [ "toml_edit 0.21.1", ] +[[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.85" @@ -2814,6 +2922,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "subtle" version = "2.5.0" @@ -3334,14 +3448,41 @@ dependencies = [ [[package]] name = "vergen" -version = "8.3.1" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +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/core/Cargo.toml b/core/Cargo.toml index 6be4d567..1f73669d 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -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 920455d0..008ec1d2 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(()) } From bec54a64f1c18f7759e1c6e40ad7ed7f4db55f42 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Wed, 28 Aug 2024 13:42:13 +0200 Subject: [PATCH 3/6] Update quick-xml to 0.36.1 Signed-off-by: yubiuser --- Cargo.lock | 4 ++-- core/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 92cc377e..97f35bf6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2434,9 +2434,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", diff --git a/core/Cargo.toml b/core/Cargo.toml index 1f73669d..d3b2db28 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -42,7 +42,7 @@ 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"] } From 102a8fd833942c994f28e43f93c360742fe9da7d Mon Sep 17 00:00:00 2001 From: yubiuser Date: Thu, 29 Aug 2024 22:28:53 +0200 Subject: [PATCH 4/6] Add cargo clean to test.sh Signed-off-by: yubiuser --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 0d6bb291..0d0c34ad 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 From 09ffc01e779401d5eec53b3cf5c86f38cd5c9409 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Thu, 29 Aug 2024 22:35:45 +0200 Subject: [PATCH 5/6] Update rodio Signed-off-by: yubiuser --- Cargo.lock | 4 ++-- playback/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97f35bf6..7732e0a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2546,9 +2546,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", diff --git a/playback/Cargo.toml b/playback/Cargo.toml index 282d5078..3f87b939 100644 --- a/playback/Cargo.toml +++ b/playback/Cargo.toml @@ -43,7 +43,7 @@ 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 From ac02ca224e5c32594fd68e7fd6c5c13fc11dce4a Mon Sep 17 00:00:00 2001 From: yubiuser Date: Thu, 29 Aug 2024 22:40:35 +0200 Subject: [PATCH 6/6] Update sdl2 Signed-off-by: yubiuser --- Cargo.lock | 8 ++++---- playback/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7732e0a8..184d4cdc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2725,9 +2725,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", @@ -2737,9 +2737,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", diff --git a/playback/Cargo.toml b/playback/Cargo.toml index 3f87b939..3e6b3962 100644 --- a/playback/Cargo.toml +++ b/playback/Cargo.toml @@ -36,7 +36,7 @@ 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 }