songbird
songbird copied to clipboard
Fix cross compilation on `stable-x86_64-pc-windows-gnu`
Songbird version: 0.1.6
Rust version (rustc -V
): rustc 1.52.1 (9bc8c42bb 2021-05-09)
Serenity/Twilight version: (version)
Output of ffmpeg -version
, youtube-dl --version
(if relevant):
Not Relavent
Description:
I was trying to work on compiling a serenity bot with the x86_64-pc-windows-gnu
target but got stuck on audiopus-sys
failing to compile, I think due to handling platform features incorrectly.
I managed to fix this by updating audiopus
to 0.3.0-rc.0
in songbird
. I can open a PR if it is wanted. The changes are breaking however as cmake
is now a required dependency of audiopus
.
~Related serenity issue: https://github.com/serenity-rs/serenity/issues/1001.~
It looks like that user tried to build on the windows gnu toolchain instead. I tried to replicate the issue, but got a different error than they did. However, updating audiopus
seems to fix this issue as well.
Steps to reproduce:
- Clone the
current
branch of this repository on Windows 10 with the toolchain and msys2 installed, with the appropriate compiler tools installed and available through thePATH
. - Run
cargo test --all-features --target x86_64-pc-windows-gnu
- Wait for the compilation to fail:
PS D:\Github\songbird> cargo test --all-features --target x86_64-pc-windows-gnu
Updating crates.io index
Compiling songbird v0.1.6 (D:\Github\songbird)
Compiling term v0.4.6
Compiling native-tls v0.2.7
Compiling mio v0.7.11
Compiling audiopus_sys v0.1.8
Compiling tracing v0.1.26
Compiling rustls v0.19.1
Compiling rustls v0.18.1
Compiling poly1305 v0.6.2
Compiling salsa20 v0.7.2
Compiling mio v0.6.23
Compiling audiopus v0.2.0
error: could not find native static library `opus`, perhaps an -L flag is missing?
error: aborting due to previous error
error: could not compile `audiopus_sys`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
Yes, the RC of audiopus should fix cross-compiling. I wanted to port songbird to it myself but did not get around to it. Glad to see that you have, once songbird would work fine with it, I can release a non-RC.
Songbird 0.3.0 now depends on audiopus 0.3.0-rc.0, so this issue can be closed, right?
It should be yes, thanks for the reminder!