Rust-SDL2 / rust-sdl2

SDL2 bindings for Rust
MIT License
2.71k stars 466 forks source link

Possible Bug / Install Guide Issue: cargo vckpg build failing in cargo-vcpkg install method #1139

Open Caleb-T-Owens opened 3 years ago

Caleb-T-Owens commented 3 years ago

I have installed Visual Studio and thus MSVC from prior c++ work.

I was trying to install this package using the cargo-vcpkg method and it fails in the cargo vcpkg build step with the following non-descriptive output

[22:46:22] ~\..\sdl_test on master ❎  +3  ❯  cargo vcpkg build
    Fetching vcpkg
    Checkout rev a0518036077baa4
   Compiling vcpkg
  Installing sdl2 sdl2 sdl2-image[libjpeg-turbo,tiff,libwebp] sdl2-ttf sdl2-gfx sdl2-mixer
-- stdout --

-- stderr --

cargo-vcpkg: failed

My cargo.toml is

[package]
name = "sdl_test"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies.sdl2]
version = "0.34"
default-features = false
features = ["ttf","image","gfx","mixer","static-link","use-vcpkg"]

[package.metadata.vcpkg]
dependencies = ["sdl2", "sdl2-image[libjpeg-turbo,tiff,libwebp]", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"]
git = "https://github.com/microsoft/vcpkg"
rev = "a0518036077baa4"

[package.metadata.vcpkg.target]
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" }

I had a friend follow the same steps with visual studio installed and they came up with the same error which makes me wonder if something is wrong in the installation guide.

waych commented 3 years ago

See #1132. I think you need to update the rev = pointer to newer upstream vcpkg as the older vcpkg.exe binary somehow fails unexpectedly on recent Windows build environment. You are the first report I've seen that has reproduced this outside of github actions. I have not been able to reproduce the failure locally myself.

Caleb-T-Owens commented 3 years ago

That did end up being the case, thank you for linking that for me.

I think that this should definitely be mentioned on the crates.io page as this is not an obvious solution to someone who is new to the cargo-vcpgk package.

waych commented 3 years ago

Ah yes, the crates.io page will update upon the next release. I don't know when that is expected.

deitux123 commented 2 years ago

This is still an issue now, I was getting cargo-vcpkg: failed with no error message until I ran cargo vcpkg --verbose build.

Switching rev to one of the latest (not the very latest) commits, d953973cfbfeaf8022f5219fbabb0bdf9defb706, seems to have solved this issue for me

JohnScience commented 1 year ago

Same issue. Using rev = "ce99c947b64ea3c0e274e18cc3035ca727681089" helped me.

Spencer1O1 commented 1 year ago

I found that using a revision code from a release build, rather than the current state of the repository can fix the issue. Some documentation of the problem should be included in the README, and then this issue should be closed because it seems to be a problem with cargo-vcpkg rather than rust-sdl2. However, if someone can show that the source of the problem isn't originating in cargo-vcpkg, this issue should be investigated further.

Cobrand commented 1 year ago

I'm tagging this at wontfix since this isn't our problem (although documentation could be better), but leaving this open so people can see that is indeed something that affects this project.