-
Notifications
You must be signed in to change notification settings - Fork 2
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
can't build on windows #28
Comments
PS D:\Code\rust\rust-av\opus-rs> cargo build Caused by: --- stderr Most likely, you need to install a pkg-config package for your OS. If you've already installed it, ensure the pkg-config command is one of the If you did not expect this build to link to a pre-installed system library, Caused by: --- stderr Most likely, you need to install a pkg-config package for your OS. If you've already installed it, ensure the pkg-config command is one of the If you did not expect this build to link to a pre-installed system library, Thanks for your reply! As you see, its the same. |
BTW, I'm trying to build static version of libvpx & opus by vcpkg. It will take some time. |
Thank you for your effort! As fast solution, we can try to replace metadeps with system_deps like we already do for aom. We just need to implement these changes Otherwise we can add a |
I tried to use the system_deps but failed. I also found vpx_rs is using the system_deps as well as aom_rs, so I tried them both, and failed again. I use vcpkg_cli to check the aom lib : PS D:\Code\rust\rust-av\aom-rs> vcpkg_cli.exe probe aom here is the BUILD console output : PS D:\Code\rust\rust-av\aom-rs> cargo build -vv Caused by: --- stderr Most likely, you need to install a pkg-config package for your OS. If you've already installed it, ensure the pkg-config command is one of the If you did not expect this build to link to a pre-installed system library, |
I noticed that the system-deps github page says "For now only pkg-config dependencies are supported, but we are planning to gdesmott/system-deps#3 at some point." . So that would be the problem. I'm not familiar with pkg-config. It seems that pkg-config in windows should use mingW, which is not compatible with msvc. So I'd prefer use vcpkg rather than pkg-config. I found that rusty_ffmpeg and rust-ffmpeg-sys use another build system which support vcpkg. Could you please take a look at that? |
Yeah, you're right, I haven't noticed that part, I thought
Unfortunately, I will be out of town for one week, so I won't be able to work on that, but you can try to verify whether it works locally for you. If something happens, feel free to open a PR in each of the three repos, I will be happy to review them when I come back. |
Thanks for your advise. I'll try to solve it, though I am new to Rust 😅 |
Welcome to Rust! Oh, no problem. take your time! 😃 |
I'd argue that either vcpkg gets reimplemented to remove the telemetry or maybe not everybody would be cool with it. (also http://pkgconf.org/ exists) |
Another solution could be to build on Windows through To install packages: To build: |
I just created two PR for vpx and opus. The code may not so rusty but works. for aom, I meet a type convert error https://github.com/rust-av/aom-rs/blob/master/src/encoder.rs#L100-L102 . The aom-sys require aom 3.0.0 but my aom in vcpkg is 3.2.0, and they differ in the type of aom_image.cp, aom_image.tc, aom_image.mc. While my ffmpeg depends on aom, rebuilt them will take a long time. So, I would not try to fix aom-rs. |
I need to say its important to me to make these package support for vcpkg, because all my dev env are built on it. |
Thanks for your PRs @asuper0! I'm going to review them as soon as possible! For what concerns aom, please open an issue on aom repository about the errors you have found. I suppose the first one is a clippy error, while the second one is related to a missing update. Feel free to open PRs if you want, I would like to add dav1d and aom decoders in these examples as well.
I propose to hide vcpkg behind a Rust feature, in this way it's not an official solution, so @lu-zero statement is respected, but at the same time you can use your dev env. You can add this feature, we can call it vcpkg, to your PRs and try if it works on Windows with Have you installed msys2? If you have, try to install opus package with this command |
@lu-zero #rust-av/opus-rs#27 To @Luni-4 , thanks for the help. While the system_deps with pkg-config works well, my PR may be closed, it depends on you. Maybe a build tutorial for windows is good for rust-av or other projects. |
Probably the vcpkg people should be made aware of the problem, they seem fairly responsive from what I saw in the system-deps discussion.
A good tutorial for windows would be great, we have less experience with the platform so your help would be precious :) |
Great that you solved your problem @asuper0! Can you please add here the series of steps you have used to compute the examples with |
|
It seems it is possible to install |
vcpkg make .pc files automatically when your run
|
It is annoying that pkgconf.org doesn't offers builds otherwise it would be an even nicer alternative :/ |
@asuper0 |
What kind of problem?
or without the environment variable :
Notice that vpx is named libvpx. Your can use |
Closed in #29 |
My Environment:
Windows 10 1809
Visual studio 2022
vcpkg commit 6a29f32
libvpx & opus installed with vcpkg:
libvpx:x64-windows 1.11.0#1
opus:x64-windows 1.3.1#6
I have tried some ffmpeg binding crates with vcpkg and succeed, so the vcpkg settings would be correct.
when I run "cargo build", it shows
...
Compiling opus-sys v0.1.0 (https://github.com/rust-av/opus-rs#a59e7a10)
Compiling vpx-sys v0.1.1 (https://github.com/rust-av/vpx-rs#84694096)
error: failed to run custom build command for
opus-sys v0.1.0 (https://github.com/rust-av/opus-rs#a59e7a10)
Caused by:
process didn't exit successfully:
D:\Code\rust\rust-av\examples\target\debug\build\opus-sys-c6e88b1fe60364f8\build-script-build
(exit code: 101)--- stdout
cargo:rerun-if-env-changed=OPUS_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=OPUS_STATIC
cargo:rerun-if-env-changed=OPUS_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
--- stderr
thread 'main' panicked at 'called
Result::unwrap()
on anErr
value: Error(PkgConfig(Could not run"pkg-config" "--libs" "--cflags" "opus" "opus >= 1.3"
The pkg-config command could not be found.
Most likely, you need to install a pkg-config package for your OS.
If you've already installed it, ensure the pkg-config command is one of the
directories in the PATH environment variable.
If you did not expect this build to link to a pre-installed system library,
then check documentation of the opus-sys crate for an option to
build the library from source, or disable features or dependencies
that require pkg-config.), State { next_error: None })', C:\Users\Administrator.cargo\git\checkouts\opus-rs-377ca7da91dbf68d\a59e7a1\opus-sys\build.rs:19:34
note: run with
RUST_BACKTRACE=1
environment variable to display a backtracewarning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for
vpx-sys v0.1.1 (https://github.com/rust-av/vpx-rs#84694096)
Caused by:
process didn't exit successfully:
D:\Code\rust\rust-av\examples\target\debug\build\vpx-sys-603f0f9baa1bcc53\build-script-build
(exit code: 101)--- stdout
cargo:rerun-if-env-changed=VPX_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
--- stderr
thread 'main' panicked at 'called
Result::unwrap()
on anErr
value: PkgConfig(Could not run"pkg-config" "--libs" "--cflags" "vpx" "vpx >= 1.5.0"
The pkg-config command could not be found.
Most likely, you need to install a pkg-config package for your OS.
If you've already installed it, ensure the pkg-config command is one of the
directories in the PATH environment variable.
If you did not expect this build to link to a pre-installed system library,
then check documentation of the vpx-sys crate for an option to
build the library from source, or disable features or dependencies
that require pkg-config.)', C:\Users\Administrator.cargo\git\checkouts\vpx-rs-ab48b307657c386f\8469409\vpx-sys\build.rs:19:51
note: run with
RUST_BACKTRACE=1
environment variable to display a backtraceThe text was updated successfully, but these errors were encountered: