-
Notifications
You must be signed in to change notification settings - Fork 473
"bundled" in v0.34.3 is broken on Windows #1029
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
Comments
If you can add details on what version of rust you use, what compiler (msvc or gnu) and more importantly what the complete error message is, I'm sure it will be helpful. |
I am using:
Full error message:
|
We don't know which command is failing so that will need a bit more debugging. I don't have windows so either you'll have to wait until someone fixes that for you, or you'll have to fix that yourself I'm afraid. I think you should try running the CMake file directly without the build.rs file, maybe that will give you a clue. |
I looked at it a little the other night and it fails here: for modified_file in patch_set.modified_files() {
use std::io::{Write, BufRead};
let file_path = sdl2_source_path.join(modified_file.path());
let old_path = sdl2_source_path.join(format!("{}_old", modified_file.path()));
>> fs::rename(&file_path, &old_path)
.expect(&format!(
"Rename of {} to {} failed",
file_path.to_string_lossy(),
old_path.to_string_lossy()));
|
no fixes yet, still doesn't work on latest windows. mine is latest rust, I also have gcc 9.2 installed. |
For anyone looking for a quick workaround, you can use 0.34.2 by running this command: EDIT: sdl2-sys, not sdl2 |
The error I'm getting is that it seems like vcpkg is complaining about a casing difference between
I assume from here -> https://github.com/Rust-SDL2/rust-sdl2/blob/master/sdl2-sys/build.rs#L273 ? |
The current build on Windows is completely broken and it’s messing the whole CI pipeline. I will re-enable it once the problem is fixed upstream. See <Rust-SDL2/rust-sdl2#1029> for further details.
I was switching to 0.34.3 at neovide on Windows, it was working very well, but I was using msvc. |
Can some one hint me how to reproduce the issue ? |
Hello everyone. You're getting hit by this bug. It's the fault of SDL2 itself. You can apply the patch there to the bundled copy of 2.0.12, or you can just wait a bit and it should be fixed in 2.0.14 "fairly soon". Also, the reason that not everyone can reproduce it is because it only affects building the lib using VS2019. If you're using VS2017 to build you won't see the bug. |
Really ? I just use VS2019 |
Are you saying you use VS2019 and do not see the bug? Oh, also you have to be building for dynamic linking for the bug to happen. A static link build can avoid the issue. |
@Lokathor I guess you are right, static link should not have issue. |
AFAICT this is because modified_file.path() returns something like So it tries to rename a file in a non-existent sub-directory EDIT: This is odd behaviour on |
It turns out that the "static-link" feature flag for the `sdl2-sys` crate doesn't link `SDL2_Image` nor `SDL2_TTF`) into it, and the "bundled" feature flag only fetches the main `libsdl2` library at build time and not `SDL2_Image`. Plus, it seems that "bundled" and "static-link" are also broken in other ways, at the time of writing: Rust-SDL2/rust-sdl2#778 Rust-SDL2/rust-sdl2#851 Rust-SDL2/rust-sdl2#858 Rust-SDL2/rust-sdl2#1017 Rust-SDL2/rust-sdl2#1029 Rust-SDL2/rust-sdl2#1034 For the sake of reliability, this commit disables both Cargo feature flags described for the `sdl2` dependency (thereby requiring the user to install external dependencies) and introduces a detailed setup guide in the `README.md` for Windows, macOS, and Linux.
I seem to have a different, but similar issue when building. On my machine, the PatchSet::parse function doesn't properly handle \r characters in the \r\n line endings of the patch details (don't know what they're called), so at one point I end up with a path looking something like "CMakeLists.txt\r" (since the patch details contain the substring [...]"CMakeLists.txt\r\n"[...]). |
https://www.libsdl.org/download-2.0.php, looks like SDL version 2.0.14 (stable) had been released, probably we can try to achieve 0.34.4 now ? FYR: https://bugzilla.libsdl.org/show_bug.cgi?id=5112 |
Certainly we should try, I'm still waiting for feedback from @Cobrand at this point |
Interesting, maybe that's why patching kept failing. If people have "check out as CRLF, commit as LF" checked on their windows git install, maybe |
@LunarLambda my bad, I had totally forgotten about that, end of year holidays and all. I'll answer in the appropriate thread. ( mostly #1059 ) |
@LunarLambda The unidiff dev(s) seem to have fixed this on git (presumably in this commit), though it doesn't seem to be on cargo yet. When using unidiff from git I am able to build successfully. Though I have yet to try actually using the compiled library. EDIT: It seems that the "\r" issue only affects me when trying to build rust-sdl2 myself and not when using it as a cargo dependency. Though it seems unrelated to the issue's author's problem. I get the same issue as the author when I use "bundled" without "static-link". |
Over 6 months later, this is still broken. Is there no one that cares about this getting fixed? |
If it's of any use to anyone: I never fail if I use the |
Compilation of the crate fails with the following error:
failed to run custom build command for
sdl2-sys v0.34.3
Explicity requesting v0.3.42 for sdl2-sys fixes the issue:
[dependencies.sdl2-sys]
version = "=0.34.2"
Everything then compiles & runs as it should.
The text was updated successfully, but these errors were encountered: