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, sdl2-*] allow disabling transitive dependencies #35311
Comments
First of all, thanks a lot for bringing this up! I am also having problems with sdl2's transitive dependency on systemd via dbus. I tried testing the fixes by @jimwang118 on GitHub actions via
However, systemd (and in turn libmount) are still fetched even if I use the following vcpkg.json file:
Am I using doing something wrong in disabling the transitive dependency on systemd? You can find a test repo reproducing this issue here: https://github.com/chrismile/ActionsTestRepo2 |
Looking through that MR it patches SDL2PP, but not SDL2. This file also needs patched https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/vcpkg.json (Specifically for DBus.) |
I don't quite understand what you mean by repairing dbus? Can you elaborate on that? Do I need to add any restrictions to the dbus that sdl2 depends on? |
Yes, something like this --- a/ports/sdl2/vcpkg.json
+++ b/ports/sdl2/vcpkg.json
@@ -8,7 +8,8 @@
"dependencies": [
{
"name": "dbus",
- "platform": "linux"
+ "platform": "linux",
+ "default-features": false
},
{
"name": "vcpkg-cmake", |
However, vcpkg's |
Really? I see this in the dbus vcpkg.json: https://github.com/microsoft/vcpkg/blob/master/ports/dbus/vcpkg.json#L20 "default-features": [
{
"name": "systemd",
"platform": "linux"
}
], |
|
Yes, I have not updated the master library locally, so it is not displayed. |
Is your feature request related to a problem? Please describe.
I recently discovered that on Linux, it seems impossible for users to disable some transitive dependencies of interdependent SDL2 libraries, because the sdl2-* ports depend on "sdl2" which overrides any
"default-features": false
setting by the user in theirvcpkg.json
file.For example, I'd like to build sdl without wayland support, but as soon as I pull in another library, like sdl2-image (which depends on "sdl2"), wayland support is now required.
Similarly, sdl2 has a default dependency on dbus, which has a default dependency on systemd. Systemd needs a lot of external/system packages installed in order to build, so it'd be nice to be able to disable systemd support for dbus in this case.
As I understand, neither of these things are really possible without patching the vcpkg.json port files.
Proposed solution
I would suggest replacing the named "sdl2" dependency with this:
for the sdl2-gfx, sdl2-image, sdl2-mixer, sdl2-mixer-ext, sdl2-net, and sdl2-ttf libraries.
and a similar patch for the sdl2 port's dependency on dbus:
{ "name": "dbus", + "default-features": false, "platform": "linux" },
Describe alternatives you've considered
I am not aware of any other ways to resolve this issue at the present time due to how default-features work.
Additional context
No response
The text was updated successfully, but these errors were encountered: