Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokio migration #665

Merged
merged 92 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
6f5607d
[Core] Bump hyper to ~0.12
ashthespy Jan 23, 2021
931c820
[Connect] Migrate to hyper ~v12
ashthespy Jan 23, 2021
962d7af
Clean up hyper from binary
ashthespy Jan 23, 2021
9bbf8c3
WIP tokio-core -> tokio migration
ashthespy Jan 23, 2021
53b4ab0
Migrate to `tokio` 0.1
ashthespy Jan 23, 2021
c69ccf7
[Connect] Migrate to `tokio` 0.1
ashthespy Jan 23, 2021
47a1575
WIP Futures
ashthespy Jan 23, 2021
94fc0a1
[Core/connection] Refactor to async/await
ashthespy Jan 23, 2021
c273d51
[AudioKeyManager] Convert to async
ashthespy Jan 23, 2021
20dd94f
Fix tokio dependency in main
ashthespy Jan 23, 2021
0892587
[Core] WIP: Sessions
ashthespy Jan 23, 2021
40e6355
Migrate core to tokio 1.0
Johannesd3 Jan 21, 2021
6867ad0
Added test
Johannesd3 Jan 21, 2021
424ba3a
Migrated metadata crate to futures 0.3
Johannesd3 Jan 21, 2021
80d384e
Migrated audio crate to futures 0.3
Johannesd3 Jan 21, 2021
90905b8
Improved RangeSet implementation
Johannesd3 Jan 21, 2021
0895f17
Migrated playback crate to futures 0.3
Johannesd3 Jan 21, 2021
6c9d8c8
Replace pin_project and updated dependencies
Johannesd3 Jan 22, 2021
fe37186
Make librespot_playback work
Johannesd3 Jan 22, 2021
91d7d04
Preparing main crate for testing
Johannesd3 Jan 22, 2021
9546fb6
Merge branch 'futures_migration' of https://github.com/Johannesd3/lib…
ashthespy Jan 25, 2021
07514c9
Add proxy support to apresolve
Johannesd3 Jan 25, 2021
c97fdeb
Replaced .fold(0, add) by .sum()
Johannesd3 Jan 25, 2021
aa90278
Merge pull request #581 from ashthespy/tokio_migration
ashthespy Jan 26, 2021
a45fe85
Enable logging in test
Johannesd3 Jan 30, 2021
c1d62d7
Fixed ProxyTunnel
Johannesd3 Jan 30, 2021
bb44b99
Use proxytunnel in apresolve
Johannesd3 Jan 30, 2021
d662e03
Merge pull request #583 from Johannesd3/tokio_migration_proxy
ashthespy Feb 10, 2021
872fab6
Merge branch 'dev' into tokio_migration
Johannesd3 Feb 10, 2021
1f40aff
Merge pull request #599 from Johannesd3/tokio_migration
ashthespy Feb 11, 2021
2f05ddf
Fix bugs in player
Johannesd3 Feb 12, 2021
b2f1be4
Make `RodioSink` `Send` and improve error handling
Johannesd3 Feb 12, 2021
689415a
Improved error handling in rodio backend
Johannesd3 Feb 12, 2021
b77f0a1
Fix formatting
Johannesd3 Feb 13, 2021
afacaea
Merge pull request #601 from Johannesd3/tokio_migration
ashthespy Feb 20, 2021
daf7ecd
Migrate librespot-connect to tokio 1.0
Johannesd3 Feb 19, 2021
2c81aaa
Implement MercurySender not as sink
Johannesd3 Feb 20, 2021
1c4d57c
Add shutdown to discovery server
Johannesd3 Feb 20, 2021
007e653
Restore original blocking player behaviour
Johannesd3 Feb 20, 2021
220061e
Migrate application to tokio 1.0
Johannesd3 Feb 21, 2021
c9b3b95
Merge pull request #606 from Johannesd3/tokio_connect_migration
ashthespy Feb 23, 2021
1fc5267
Revert "Merge pull request #548 from Lcchy/rodiojack-backend"
Johannesd3 Feb 23, 2021
678d177
Merge branch 'dev' into tokio_migration
Johannesd3 Feb 23, 2021
c0942f1
Restore rodiojack support
Johannesd3 Feb 23, 2021
9253be7
Small refactor of librespot-core
Johannesd3 Feb 10, 2021
8cff10e
Put apresolve behind feature flag
Johannesd3 Feb 10, 2021
10827bd
Clean up dependencies of librespot-core
Johannesd3 Feb 10, 2021
a6ed685
Clean up dependencies in librespot-metadata
Johannesd3 Feb 10, 2021
746e6c8
Put lewton behind feature flag
Johannesd3 Feb 10, 2021
b83976a
Remove "extern crate"s from librespot-audio
Johannesd3 Feb 10, 2021
5c42d2e
Clean up dependencies in librespot-audio
Johannesd3 Feb 10, 2021
5aeb733
Clean up dependencies in librespot-playback
Johannesd3 Feb 22, 2021
45f42ac
Refactor 'find_available_alternatives'
Johannesd3 Feb 22, 2021
27f308b
Replace error_chain by thiserror
Johannesd3 Feb 13, 2021
f9c0e26
Simplify code
Johannesd3 Feb 13, 2021
d064ffc
Use tokio channels and fix compilation errors
Johannesd3 Feb 21, 2021
59c5566
Clean up librespot-connect dependencies
Johannesd3 Feb 21, 2021
18179e7
Remove unused dependencies and fix feature flags
Johannesd3 Feb 21, 2021
b606d8c
Replace "extern crate"s
Johannesd3 Feb 21, 2021
f22b419
Update url crate to 2.1
Johannesd3 Feb 22, 2021
9d77fef
Merge pull request #649 from Johannesd3/tokio-migration-refactor-deps
ashthespy Feb 26, 2021
6a33eb4
minor cleanup
leshow Mar 1, 2021
3388508
use current_thread
leshow Mar 1, 2021
3876139
Merge pull request #652 from leshow/cleanup
ashthespy Mar 9, 2021
5616004
Fix many clippy lints
Johannesd3 Mar 10, 2021
059b902
Remove redundant field names
Johannesd3 Mar 10, 2021
173a363
Merge pull request #667 from Johannesd3/small-fixes
ashthespy Mar 11, 2021
e71a004
Refactor AudioFileFetch using async/await
Johannesd3 Feb 28, 2021
ca255c1
Split file fetch.rs
Johannesd3 Feb 28, 2021
963d50e
Merge pull request #658 from Johannesd3/refactor-audio-file-fetch
sashahilton00 Mar 17, 2021
ec1ec59
update examples
ThouCheese Mar 6, 2021
1051f98
Merge pull request #663 from ThouCheese/tokio_migration
ashthespy Mar 24, 2021
95fedf5
Add back hyper-proxy
Johannesd3 Mar 17, 2021
d4dfd48
Merge pull request #674 from Johannesd3/proxy-support
ashthespy Mar 29, 2021
f5274f5
Merge branch 'dev' into tokio_migration
Johannesd3 Apr 9, 2021
7c3d891
Fix clippy warnings
Johannesd3 Mar 31, 2021
11ce290
Fix formatting
Johannesd3 Apr 1, 2021
7ddb1a2
Reuse librespot-core's Diffie Hellman in discovery
Johannesd3 Mar 10, 2021
9378ae5
Bump num-bigint dependency
Johannesd3 Mar 18, 2021
e688e7e
Almost eliminate util module
Johannesd3 Mar 18, 2021
cb8c9c2
Enable apresolve always in binary
Johannesd3 Apr 1, 2021
b7350b7
Restore previous feature flags
Johannesd3 Apr 9, 2021
9a3a666
Bump MSRV to 1.45
Johannesd3 Apr 9, 2021
5435ab3
Fix compile errors in backends
Johannesd3 Apr 1, 2021
690e0d2
Add simple tests to librespot-core
Johannesd3 Apr 2, 2021
ff49982
Add missing feature flag to tokio
Johannesd3 Apr 9, 2021
317e586
Improve CI
Johannesd3 Apr 9, 2021
26c127c
Merge branch 'dev' into tokio_migration
Johannesd3 Apr 10, 2021
a576194
Fix bug in rodio backend
Johannesd3 Apr 10, 2021
b4f9ae3
Fix clippy warnings
Johannesd3 Apr 10, 2021
3e9aee1
Renamed variable
Johannesd3 Apr 10, 2021
f158d23
Merge pull request #687 from Johannesd3/tokio_migration
sashahilton00 Apr 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 105 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,81 @@ name: test
on:
push:
branches: [master, dev]
paths: ['**.rs', '**.toml', '**.lock', '**.yml']
paths:
[
"**.rs",
"Cargo.toml",
"/Cargo.lock",
"/rustfmt.toml",
"/.github/workflows",
]
pull_request:
branches: [master, dev]
paths: ['**.rs', '**.toml', '**.lock', '**.yml']
paths:
[
"**.rs",
"Cargo.toml",
"/Cargo.lock",
"/rustfmt.toml",
"/.github/workflows",
]
schedule:
# Run CI every week
- cron: "00 01 * * 0"

env:
RUST_BACKTRACE: 1

jobs:
fmt:
name: 'Rust: format check'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Only run the formatting check for stable
include:
- os: ubuntu-latest
toolchain: stable
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
# Use default profile to get rustfmt
profile: default
toolchain: ${{ matrix.toolchain }}
profile: minimal
toolchain: stable
override: true
- run: cargo fmt --verbose --all -- --check
components: rustfmt
- run: cargo fmt --all -- --check

test:
test-linux:
needs: fmt
name: cargo +${{ matrix.toolchain }} build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
toolchain:
- 1.41.1 # MSRV (Minimum supported rust version)
- 1.45 # MSRV (Minimum supported rust version)
- stable
- beta
experimental: [false]
# Ignore failures in nightly, not ideal, but necessary
# Ignore failures in nightly
include:
- os: ubuntu-latest
toolchain: nightly
experimental: true
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true

- name: Get Rustc version
id: get-rustc-version
run: echo "::set-output name=version::$(rustc -V)"
shell: bash

- name: Cache Rust dependencies
uses: actions/cache@v2
with:
Expand All @@ -67,20 +87,65 @@ jobs:
~/.cargo/registry/cache
~/.cargo/git
target
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install developer package dependencies
run: sudo apt-get update && sudo apt-get install libpulse-dev portaudio19-dev libasound2-dev libsdl2-dev gstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- run: cargo build --locked --no-default-features
- run: cargo build --locked --examples
- run: cargo build --locked --no-default-features --features "with-tremor"
- run: cargo build --locked --no-default-features --features "with-vorbis"
- run: cargo build --locked --no-default-features --features "alsa-backend"
- run: cargo build --locked --no-default-features --features "portaudio-backend"
- run: cargo build --locked --no-default-features --features "pulseaudio-backend"
- run: cargo build --locked --no-default-features --features "jackaudio-backend"
- run: cargo build --locked --no-default-features --features "rodio-backend"
- run: cargo build --locked --no-default-features --features "sdl-backend"
- run: cargo build --locked --no-default-features --features "gstreamer-backend"
run: sudo apt-get update && sudo apt-get install libpulse-dev portaudio19-dev libasound2-dev libsdl2-dev gstreamer1.0-dev libgstreamer-plugins-base1.0-dev libavahi-compat-libdnssd-dev

- run: cargo build --workspace --examples
- run: cargo test --workspace

- run: cargo install cargo-hack
- run: cargo hack --workspace --remove-dev-deps
- run: cargo build -p librespot-core --no-default-features
- run: cargo build -p librespot-core
- run: cargo hack build --each-feature -p librespot-audio
- run: cargo build -p librespot-connect
- run: cargo build -p librespot-connect --no-default-features --features with-dns-sd
- run: cargo hack build --locked --each-feature

test-windows:
needs: fmt
name: cargo build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
toolchain: [stable]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true

- name: Get Rustc version
id: get-rustc-version
run: echo "::set-output name=version::$(rustc -V)"
shell: bash

- name: Cache Rust dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git
target
key: ${{ runner.os }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}

- run: cargo build --workspace --examples
- run: cargo test --workspace

- run: cargo install cargo-hack
- run: cargo hack --workspace --remove-dev-deps
- run: cargo build --no-default-features
- run: cargo build

test-cross-arm:
needs: fmt
Expand All @@ -96,13 +161,20 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: ${{ matrix.target }}
toolchain: ${{ matrix.toolchain }}
override: true

- name: Get Rustc version
id: get-rustc-version
run: echo "::set-output name=version::$(rustc -V)"
shell: bash

- name: Cache Rust dependencies
uses: actions/cache@v2
with:
Expand All @@ -111,7 +183,7 @@ jobs:
~/.cargo/registry/cache
~/.cargo/git
target
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.target }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install cross
run: cargo install cross || true
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ curl https://sh.rustup.rs -sSf | sh

Follow any prompts it gives you to install Rust. Once that’s done, Rust's standard tools should be setup and ready to use.

*Note: The current minimum required Rust version at the time of writing is 1.41, you can find the current minimum version specified in the `.github/workflow/test.yml` file.*
*Note: The current minimum required Rust version at the time of writing is 1.45, you can find the current minimum version specified in the `.github/workflow/test.yml` file.*

#### Additional Rust tools - `rustfmt`
To ensure a consistent codebase, we utilise [`rustfmt`](https://github.com/rust-lang/rustfmt), which is installed by default with `rustup` these days, else it can be installed manually with:
Expand Down
Loading