Skip to content
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

Automatic SDL2 build fails on windows with bundled feature #1088

Closed
creikey opened this issue Apr 7, 2021 · 2 comments · Fixed by #1093
Closed

Automatic SDL2 build fails on windows with bundled feature #1088

creikey opened this issue Apr 7, 2021 · 2 comments · Fixed by #1093
Labels
build-process Everything related to build.rs, or the build process in general H-Windows-Support-Needed

Comments

@creikey
Copy link

creikey commented Apr 7, 2021

The error:

thread 'main' panicked at 'Failed to copy SDL2 dynamic library from C:\Users\camer\Documents\Tech\explain\target\debug\build\sdl2-sys-6797cdb03e082686\out\bin\SDL2.dll to C:\Users\camer\Documents\Tech\explain\target\debug\SDL2.dll: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\camer\.cargo\registry\src\github.51.al-1ecc6299db9ec823\sdl2-sys-0.34.4\build.rs:592

My Cargo.toml:

[package]
name = "explain"
version = "0.1.0"
authors = ["Cameron Reikes <cameronreikes@gmail.com>"]
edition = "2018"

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

[dependencies]
sdl2 = { version = "0.34.4", features = ["bundled"] 
@Cobrand Cobrand added build-process Everything related to build.rs, or the build process in general H-Windows-Support-Needed labels Apr 9, 2021
@Cobrand Cobrand mentioned this issue Apr 18, 2021
waych added a commit to waych/rust-sdl2 that referenced this issue Apr 18, 2021
While here, also add CI testing for Windows bundled builds (both dynamic
and static-link).

Closes Rust-SDL2#1088.
waych added a commit to waych/rust-sdl2 that referenced this issue Apr 18, 2021
Broke non-"static-link" builds on Windows when using "bundled" and non
release builds.

Closes Rust-SDL2#1088
@waych
Copy link
Contributor

waych commented Apr 18, 2021

FYI I got linking to work correctly, with CI testing, in PR #1092

What is concerning however is that while the static-link version of "bundled" passes tests 100%, the following happens on the dynamic link version:

 failures:
    src/sdl2\event.rs - event::EventSender::push_custom_event (line 2874)
    src/sdl2\event.rs - event::crate::EventSubsystem::add_event_watch (line 244)
    src/sdl2\event.rs - event::crate::EventSubsystem::push_custom_event (line 203)
    src/sdl2\event.rs - event::crate::EventSubsystem::register_event (line 135)
    src/sdl2\rect.rs - rect::Rect::has_intersection (line 482)
    src/sdl2\rect.rs - rect::Rect::intersection (line 504)
    src/sdl2\rect.rs - rect::Rect::union (line 536)

test result: FAILED. 62 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.63s

Given that most of the tests are passing, but some are failing, something is subtly wrong with this version of the build. My first guess is that there is an ABI difference that isn't getting picked up one one side of the build.

@waych
Copy link
Contributor

waych commented Apr 18, 2021

Ah, these are the examples that actually invoke code in sdl2 thus need the runtime linking.

Cobrand pushed a commit that referenced this issue Apr 19, 2021
Broke non-"static-link" builds on Windows when using "bundled" and non
release builds.

Closes #1088
sypwex pushed a commit to sypwex/rust-sdl2 that referenced this issue Jun 2, 2024
Broke non-"static-link" builds on Windows when using "bundled" and non
release builds.

Closes Rust-SDL2#1088
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-process Everything related to build.rs, or the build process in general H-Windows-Support-Needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants