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

sdl2-sys fails to select SDL2 version when using imgui-sdl2-support #741

Open
Nyabsi opened this issue Aug 6, 2023 · 4 comments
Open

sdl2-sys fails to select SDL2 version when using imgui-sdl2-support #741

Nyabsi opened this issue Aug 6, 2023 · 4 comments

Comments

@Nyabsi
Copy link

Nyabsi commented Aug 6, 2023

Describe the bug

Unable to install both SDL2 and imgui-sdl2-support on M2 Macbook due to conflicting SDL2 version, and I am also unable to compile it from source because the code is not accepted by the strict clang restrictions.

To Reproduce

  1. Install SDL2 from brew (ARM64)
  2. Create new cargo project with cargo new
  3. Install imgui, imgui-sdl2-support, glow, imgui-glow-support
  4. sdl2-sys fails to install because imgui-sdl2-support has conflicting version.

Expected behavior

The library should just work with my system imgui version without any kind of version conflict, but in the least I should be able to compile it myself without any kind of clang strictness errors.

Screenshots

error: failed to select a version for `sdl2-sys`.
    ... required by package `sdl2 v0.34.5`
    ... which satisfies dependency `sdl2 = "^0.34.5"` of package `imgui-sdl2-support v0.11.0`
    ... which satisfies dependency `imgui-sdl2-support = "^0.11.0"` of package `rs-chip-eight v0.1.0 (/Users/name/rs-imgui-test)`
versions that meet the requirements `^0.34.5` are: 0.34.5

the package `sdl2-sys` links to the native library `SDL2`, but it conflicts with a previous package which links to `SDL2` as well:
package `sdl2-sys v0.35.2`
    ... which satisfies dependency `sdl2-sys = "^0.35.2"` of package `sdl2 v0.35.2`
    ... which satisfies dependency `sdl2 = "^0.35.2"` of package `rs-chip-eight v0.1.0 (/Users/name/rs-imgui-test)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='sdl2-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `sdl2-sys` which could resolve this conflict

I suppose a log will suffice?

Please describe your environment

  • imgui-rs version: 0.11.0
  • Operating System: MacOS Sonoma Beta 4
  • System SDL2 version: 2.28.2

Other information

Perhaps change the default SDL2 version so it would work out of box, or make so that the native version can actually be compiled from source without clang errors.

@Bronzdragon
Copy link

It seems you have a sdl2 dependency in in your Cargo.toml, which is pinned to v0.35.2. If you downgrade that version to v0.34, your cargo should be able to resolve (to sdl2-sys v0.34.5).

@sanbox-irl
Copy link
Member

We'll upgrade our SDL2, but i've actually been hesitating -- SDL2 right now fails to work on bundled, static-link on macOS arm. They've fixed it on main, but I want those fixes. That being said, there's no reason to not update and let users patch it

@sanbox-irl
Copy link
Member

check out #740 to see us update

@Nyabsi
Copy link
Author

Nyabsi commented Oct 9, 2023

Hey,

thanks for the great work. I've had completely forgotten this since it didn't work I just put my project on hold, since it really wasn't high priority anyways. But that indeed seems to fix this specific issue. While the above solution probably could've worked, to be honest.

I kinda wrote this issue just out of frustration and not thinking clear because I tried hours to get it working with no avail and I wasn't really that familiar with the Rust package manager back then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants