THMonster / Revda

Tools to play live stream with danmaku.
GNU General Public License v2.0
217 stars 12 forks source link

QLivePlayer_Lib编译失败 #30

Closed goduck777 closed 3 years ago

goduck777 commented 3 years ago

编译QLivePlayer_Lib遇到以下错误。因为是依赖,导致QLivePlayer也无法编译

QLivePlayer-Lib % cargo build
    Updating crates.io index
  Downloaded bit-vec v0.6.3
  Downloaded parking_lot v0.11.1
  Downloaded scopeguard v1.1.0
  Downloaded rand_core v0.6.3
  Downloaded signal-hook-registry v1.4.0
  Downloaded futures-channel v0.3.16
  Downloaded slab v0.4.4
  Downloaded smallvec v1.6.1
  Downloaded tokio-macros v1.3.0
  Downloaded tower-service v0.3.1
  Downloaded utf-8 v0.7.6
  Downloaded autocfg v1.0.1
  Downloaded thiserror-impl v1.0.26
  Downloaded env_logger v0.9.0
  Downloaded mio v0.7.13
  Downloaded rand v0.8.4
  Downloaded tungstenite v0.14.0
  Downloaded want v0.3.0
  Downloaded version_check v0.9.3
  Downloaded h2 v0.3.3
  Downloaded tinyvec_macros v0.1.0
  Downloaded hyper-tls v0.5.0
  Downloaded httparse v1.4.1
  Downloaded html-escape v0.2.9
  Downloaded getrandom v0.2.3
  Downloaded num_cpus v1.13.0
  Downloaded ppv-lite86 v0.2.10
  Downloaded rand_chacha v0.3.1
  Downloaded proc-macro-hack v0.5.19
  Downloaded pkg-config v0.3.19
  Downloaded pin-project-lite v0.2.7
  Downloaded serde v1.0.127
  Downloaded serde_urlencoded v0.7.0
  Downloaded sha-1 v0.9.7
  Downloaded tinyvec v1.3.1
  Downloaded thiserror v1.0.26
  Downloaded unicode-bidi v0.3.6
  Downloaded utf8-width v0.1.5
  Downloaded unicode-xid v0.2.2
  Downloaded unicode-normalization v0.1.19
  Downloaded uuid v0.8.2
  Downloaded adler v1.0.2
  Downloaded byteorder v1.4.3
  Downloaded cpufeatures v0.1.5
  Downloaded cfg-if v1.0.0
  Downloaded regex v1.5.4
  Downloaded fancy-regex v0.7.1
  Downloaded futures v0.3.16
  Downloaded futures-sink v0.3.16
  Downloaded syn v1.0.74
  Downloaded openssl v0.10.35
  Downloaded socket2 v0.4.1
  Downloaded regex-syntax v0.6.25
  Downloaded quote v1.0.9
  Downloaded tokio v1.10.0
  Downloaded http v0.2.4
  Downloaded generic-array v0.14.4
  Downloaded pin-utils v0.1.0
  Downloaded ryu v1.0.5
  Downloaded termcolor v1.1.2
  Downloaded hyper v0.14.11
  Downloaded num-traits v0.2.14
  Downloaded time v0.1.43
  Downloaded lock_api v0.4.4
  Downloaded hashbrown v0.11.2
  Downloaded lazy_static v1.4.0
  Downloaded humantime v2.1.0
  Downloaded pin-project v1.0.8
  Downloaded opaque-debug v0.3.0
  Downloaded native-tls v0.2.8
  Downloaded libc v0.2.99
  Downloaded percent-encoding v2.1.0
  Downloaded ipnet v2.3.1
  Downloaded memchr v2.4.0
  Downloaded matches v0.1.9
  Downloaded encoding_rs v0.8.28
  Downloaded httpdate v1.0.1
  Downloaded proc-macro2 v1.0.28
  Downloaded miniz_oxide v0.4.4
  Downloaded iovec v0.1.4
  Downloaded instant v0.1.10
  Downloaded idna v0.2.3
  Downloaded http-body v0.4.3
  Downloaded futures-macro v0.3.16
  Downloaded futures-io v0.3.16
  Downloaded futures-executor v0.3.16
  Downloaded futures-core v0.3.16
  Downloaded foreign-types v0.3.2
  Downloaded form_urlencoded v1.0.1
  Downloaded foreign-types-shared v0.1.1
  Downloaded fnv v1.0.7
  Downloaded flate2 v1.0.20
  Downloaded crc32fast v1.2.1
  Downloaded bytes v0.4.12
  Downloaded bytes v1.0.1
  Downloaded cc v1.0.69
  Downloaded bincode v1.3.3
  Downloaded block-buffer v0.9.0
  Downloaded bitflags v1.3.1
  Downloaded bit-set v0.5.2
  Downloaded atty v0.2.14
  Downloaded async-compression v0.3.8
  Downloaded aho-corasick v0.7.18
  Downloaded url v2.2.2
  Downloaded typenum v1.13.0
  Downloaded try-lock v0.2.3
  Downloaded tracing-core v0.1.18
  Downloaded tracing v0.1.26
  Downloaded tokio-util v0.6.7
  Downloaded tokio-tungstenite v0.15.0
  Downloaded tokio-native-tls v0.3.0
  Downloaded log v0.4.14
  Downloaded serde_json v1.0.66
  Downloaded serde_derive v1.0.127
  Downloaded reqwest v0.11.4
  Downloaded parking_lot_core v0.8.3
  Downloaded openssl-probe v0.1.4
  Downloaded once_cell v1.8.0
  Downloaded num-integer v0.1.44
  Downloaded itoa v0.4.7
  Downloaded indexmap v1.7.0
  Downloaded futures-util v0.3.16
  Downloaded futures-task v0.3.16
  Downloaded digest v0.9.0
  Downloaded chrono v0.4.19
  Downloaded base64 v0.13.0
  Downloaded quick-error v1.2.3
  Downloaded proc-macro-nested v0.1.7
  Downloaded pin-project-internal v1.0.8
  Downloaded openssl-sys v0.9.65
  Downloaded mime v0.3.16
  Downloaded 131 crates (8.0 MB) in 3.35s (largest was `encoding_rs` at 1.4 MB)
   Compiling autocfg v1.0.1
   Compiling libc v0.2.99
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.28
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.74
   Compiling memchr v2.4.0
   Compiling log v0.4.14
   Compiling pin-project-lite v0.2.7
   Compiling futures-core v0.3.16
   Compiling once_cell v1.8.0
   Compiling bytes v1.0.1
   Compiling pkg-config v0.3.19
   Compiling cc v1.0.69
   Compiling scopeguard v1.1.0
   Compiling smallvec v1.6.1
   Compiling proc-macro-hack v0.5.19
   Compiling futures-task v0.3.16
   Compiling proc-macro-nested v0.1.7
   Compiling itoa v0.4.7
   Compiling futures-sink v0.3.16
   Compiling futures-channel v0.3.16
   Compiling fnv v1.0.7
   Compiling foreign-types-shared v0.1.1
   Compiling version_check v0.9.3
   Compiling typenum v1.13.0
   Compiling futures-io v0.3.16
   Compiling openssl v0.10.35
   Compiling pin-utils v0.1.0
   Compiling slab v0.4.4
   Compiling httparse v1.4.1
   Compiling tinyvec_macros v0.1.0
   Compiling native-tls v0.2.8
   Compiling matches v0.1.9
   Compiling bitflags v1.3.1
   Compiling serde_derive v1.0.127
   Compiling percent-encoding v2.1.0
   Compiling openssl-probe v0.1.4
   Compiling lazy_static v1.4.0
   Compiling serde v1.0.127
   Compiling hashbrown v0.11.2
   Compiling crc32fast v1.2.1
   Compiling ryu v1.0.5
   Compiling unicode-bidi v0.3.6
   Compiling adler v1.0.2
   Compiling ppv-lite86 v0.2.10
   Compiling try-lock v0.2.3
   Compiling byteorder v1.4.3
   Compiling regex-syntax v0.6.25
   Compiling serde_json v1.0.66
   Compiling base64 v0.13.0
   Compiling encoding_rs v0.8.28
   Compiling tower-service v0.3.1
   Compiling cpufeatures v0.1.5
   Compiling opaque-debug v0.3.0
   Compiling httpdate v1.0.1
   Compiling bit-vec v0.6.3
   Compiling utf-8 v0.7.6
   Compiling utf8-width v0.1.5
   Compiling quick-error v1.2.3
   Compiling termcolor v1.1.2
   Compiling humantime v2.1.0
   Compiling ipnet v2.3.1
   Compiling mime v0.3.16
   Compiling instant v0.1.10
   Compiling lock_api v0.4.4
   Compiling futures-macro v0.3.16
   Compiling tokio v1.10.0
   Compiling futures-util v0.3.16
   Compiling indexmap v1.7.0
   Compiling miniz_oxide v0.4.4
   Compiling num-traits v0.2.14
   Compiling num-integer v0.1.44
   Compiling http v0.2.4
   Compiling foreign-types v0.3.2
   Compiling tinyvec v1.3.1
   Compiling form_urlencoded v1.0.1
   Compiling tracing-core v0.1.18
   Compiling generic-array v0.14.4
   Compiling openssl-sys v0.9.65
   Compiling html-escape v0.2.9
   Compiling bit-set v0.5.2
   Compiling tracing v0.1.26
   Compiling want v0.3.0
   Compiling aho-corasick v0.7.18
   Compiling unicode-normalization v0.1.19
   Compiling quote v1.0.9
   Compiling parking_lot_core v0.8.3
   Compiling num_cpus v1.13.0
   Compiling signal-hook-registry v1.4.0
   Compiling mio v0.7.13
   Compiling getrandom v0.2.3
   Compiling socket2 v0.4.1
   Compiling iovec v0.1.4
   Compiling time v0.1.43
   Compiling atty v0.2.14
   Compiling http-body v0.4.3
   Compiling flate2 v1.0.20
   Compiling regex v1.5.4
   Compiling parking_lot v0.11.1
   Compiling idna v0.2.3
   Compiling rand_core v0.6.3
   Compiling uuid v0.8.2
   Compiling bytes v0.4.12
   Compiling digest v0.9.0
   Compiling block-buffer v0.9.0
   Compiling chrono v0.4.19
   Compiling rand_chacha v0.3.1
   Compiling url v2.2.2
   Compiling sha-1 v0.9.7
   Compiling env_logger v0.9.0
   Compiling fancy-regex v0.7.1
   Compiling tars-stream v0.1.0 (/home/xxxxx/Downloads/QLivePlayer-Lib/tars-stream)
   Compiling rand v0.8.4
   Compiling tokio-macros v1.3.0
   Compiling thiserror-impl v1.0.26
   Compiling pin-project-internal v1.0.8
   Compiling thiserror v1.0.26
   Compiling tungstenite v0.14.0
   Compiling pin-project v1.0.8
   Compiling futures-executor v0.3.16
   Compiling futures v0.3.16
   Compiling tokio-util v0.6.7
   Compiling tokio-native-tls v0.3.0
   Compiling async-compression v0.3.8
   Compiling tokio-tungstenite v0.15.0
   Compiling h2 v0.3.3
   Compiling serde_urlencoded v0.7.0
   Compiling bincode v1.3.3
   Compiling hyper v0.14.11
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.4
   Compiling qliveplayer_lib v0.4.0 (/home/xxxxx/Downloads/QLivePlayer-Lib)
warning: unused import: `sleep_ms`
 --> src/implementation.rs:4:21
  |
4 |     thread::{sleep, sleep_ms},
  |                     ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: use of deprecated function `std::thread::sleep_ms`: replaced by `std::thread::sleep`
 --> src/implementation.rs:4:21
  |
4 |     thread::{sleep, sleep_ms},
  |                     ^^^^^^^^
  |
  = note: `#[warn(deprecated)]` on by default

error[E0308]: mismatched types
  --> src/danmaku/huya.rs:93:71
   |
93 |             let mut ios = TarsDecoder::from(&ios.read_bytes(1, false, bytes::Bytes::from(""))?);
   |                                                                       ^^^^^^^^^^^^^^^^^^^^^^ expected struct `bytes::bytes::Bytes`, found struct `bytes::Bytes`
   |
   = note: perhaps two different versions of crate `bytes` are being used?

error[E0308]: mismatched types
  --> src/danmaku/huya.rs:95:75
   |
95 |                 let mut ios = TarsDecoder::from(&ios.read_bytes(2, false, bytes::Bytes::from(""))?);
   |                                                                           ^^^^^^^^^^^^^^^^^^^^^^ expected struct `bytes::bytes::Bytes`, found struct `bytes::Bytes`
   |
   = note: perhaps two different versions of crate `bytes` are being used?

error: aborting due to 2 previous errors; 2 warnings emitted

For more information about this error, try `rustc --explain E0308`.
error: could not compile `qliveplayer_lib`

To learn more, run the command again with --verbose.

不明白为什么close,我发这里好了

THMonster commented 3 years ago

抱歉,因为QLivePlayer-Lib只是给QLivePlayer使用的,我以为你是把那东西当成普通的rust lib用了。为了防止类似的事情再发生,我就把那边的issue disable了(可能因此你没看到我在那边的回复)。 这个问题大概是由于没有cargo.lock,下个版本我会修复这些问题

goduck777 commented 3 years ago

可以在Cargo.toml中加入bytes的版本

diff -Naur a/src/QLivePlayer-Lib/Cargo.toml b/src/QLivePlayer-Lib/Cargo.toml
--- a/src/QLivePlayer-Lib/Cargo.toml    2021-08-15 13:17:46.959877390 -0400
+++ b/src/QLivePlayer-Lib/Cargo.toml    2021-08-15 13:18:14.168880011 -0400
@@ -30,7 +30,7 @@
 html-escape = "*"
 futures = "0.3"
 tars-stream = { path = "tars-stream"}
-bytes = "*"
+bytes = "0.4"

 [lib]
 name = "rust"
goduck777 commented 3 years ago

我的错,我改了一下QLivePlayer-Lib下载的commit就可以了。

see #31