Johni0702 / mumble-web-proxy

Mumble to WebSocket+WebRTC proxy for use with mumble-web
68 stars 24 forks source link

Build fails with Rust 1.49 #22

Open QuentinRQTT opened 3 years ago

QuentinRQTT commented 3 years ago

The build is successful with Rust v1.45.0, however, with the latest version of Rust (1.49.0), the build fails with the following error :


Compiling rtp v0.1.0 (https://github.com/johni0702/rtp?rev=6c0223d#6c0223d8)
error[E0282]: type annotations needed
   --> /home/walui/.cargo/git/checkouts/rtp-23e67d7854ed482f/6c0223d/src/rfc3711.rs:477:19
    |
476 |         let iv = iv ^ (BigUint::from(1_u8) << (context.session_encr_key.len() * 8));
    |             -- consider giving `iv` a type
477 |         let iv = &iv.to_bytes_be()[1..context.session_encr_key.len() + 1];
    |                   ^^ cannot infer type
    |
    = note: type must be known at this point

error[E0282]: type annotations needed
   --> /home/walui/.cargo/git/checkouts/rtp-23e67d7854ed482f/6c0223d/src/rfc3711.rs:511:19
    |
510 |         let iv = iv ^ (BigUint::from(1_u8) << (context.session_encr_key.len() * 8));
    |             -- consider giving `iv` a type
511 |         let iv = &iv.to_bytes_be()[1..context.session_encr_key.len() + 1];
    |                   ^^ cannot infer type
    |
    = note: type must be known at this point

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0282`.
error: could not compile `rtp`
UndeRus commented 3 years ago

to fix this - rtp crate must be forked and fixed

r4dh4l commented 3 years ago

For people like me a workaround in adaption of https://github.com/Johni0702/mumble-web-proxy/issues/21#issuecomment-754614350:

mumble-web@vm-mumble:~$ rustup default 1.45.0
mumble-web@vm-mumble:~/mumble-web-proxy$ cargo build --release
F3nryll commented 3 years ago

trying on centos 7 With Rust 1.49 (and above, just tried 1.52.0), I have the same issue than @Quentin-Rouquette, but if default to 1.45.0, I get these errors:

``` Compiling libnice v0.3.0 error[E0425]: cannot find value `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE` in crate `sys` --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.3.0/src/ffi.rs:595:22 | 595 | TcpActive = sys::NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE as isize, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` | ::: /usr/local/mumble-web-proxy/target/release/build/libnice-sys-be4c88b1787e560a/out/bindings.rs:180:1 | 180 | pub const NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP: NiceCandidateTransport = 0; | ------------------------------------------------------------------------------------------ similarly named constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` defined here error[E0425]: cannot find value `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE` in crate `sys` --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.3.0/src/ffi.rs:596:23 | 596 | TcpPassive = sys::NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE as isize, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` | ::: /usr/local/mumble-web-proxy/target/release/build/libnice-sys-be4c88b1787e560a/out/bindings.rs:180:1 | 180 | pub const NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP: NiceCandidateTransport = 0; | ------------------------------------------------------------------------------------------ similarly named constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` defined here error[E0425]: cannot find value `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_SO` in crate `sys` --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.3.0/src/ffi.rs:597:18 | 597 | TcpSO = sys::NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_SO as isize, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` | ::: /usr/local/mumble-web-proxy/target/release/build/libnice-sys-be4c88b1787e560a/out/bindings.rs:180:1 | 180 | pub const NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP: NiceCandidateTransport = 0; | ------------------------------------------------------------------------------------------ similarly named constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` defined here error[E0531]: cannot find unit struct, unit variant or constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE` in crate `sys` --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.3.0/src/ffi.rs:604:18 | 604 | sys::NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` | ::: /usr/local/mumble-web-proxy/target/release/build/libnice-sys-be4c88b1787e560a/out/bindings.rs:180:1 | 180 | pub const NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP: NiceCandidateTransport = 0; | ------------------------------------------------------------------------------------------ similarly named constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` defined here error[E0531]: cannot find unit struct, unit variant or constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE` in crate `sys` --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.3.0/src/ffi.rs:607:18 | 607 | sys::NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` | ::: /usr/local/mumble-web-proxy/target/release/build/libnice-sys-be4c88b1787e560a/out/bindings.rs:180:1 | 180 | pub const NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP: NiceCandidateTransport = 0; | ------------------------------------------------------------------------------------------ similarly named constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` defined here error[E0531]: cannot find unit struct, unit variant or constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_SO` in crate `sys` --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.3.0/src/ffi.rs:610:18 | 610 | sys::NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_TCP_SO => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` | ::: /usr/local/mumble-web-proxy/target/release/build/libnice-sys-be4c88b1787e560a/out/bindings.rs:180:1 | 180 | pub const NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP: NiceCandidateTransport = 0; | ------------------------------------------------------------------------------------------ similarly named constant `NiceCandidateTransport_NICE_CANDIDATE_TRANSPORT_UDP` defined here error: aborting due to 6 previous errors Some errors have detailed explanations: E0425, E0531. For more information about an error, try `rustc --explain E0425`. error: could not compile `libnice`. To learn more, run the command again with --verbose. ```
Johni0702 commented 3 years ago

@F3nryll that is in no way related to this issue. From the errors I'd guess that your system's libnice library is way too old or lacking in some features for other reasons.

F3nryll commented 3 years ago

@Johni0702 yum install libnice and yum install libnice-devel install respectively: libnice-0.1.3-4.el7.x86_64 and libnice-devel-0.1.3-4.el7.x86_64

I could remove these packages but don't know where to find more recent ones ?

Is the issue from @Quentin-Rouquette is happening after libnice is successfully compiled ? if yes, I was thinking fixing the code from rtp could be an easier solution, no ?

Johni0702 commented 3 years ago

@Johni0702 yum install libnice and yum install libnice-devel install respectively: libnice-0.1.3-4.el7.x86_64 and libnice-devel-0.1.3-4.el7.x86_64

0.1.3 is a bit ancient. I believe you need at least 0.1.11 (released 2015) to have a chance of it working. If your distribution does not provide any newer versions, you will have to build it yourself.

Is the issue from @Quentin-Rouquette is happening after libnice is successfully compiled ? if yes, I was thinking fixing the code from rtp could be an easier solution, no ?

libnice and rtp are completely independent pieces of software. Just because you ran into issues with both of them one after the other does not mean that the two are related. Please always open a separate issue unless you are certain that you are running into the exact same bug as an existing one.

F3nryll commented 3 years ago

Thank you so much for the follow-up and to have pointed me the direction: I just built the last libnice (0.1.18) and it went like a charm!