RFC: CMake/VCPKG: Require SDL3 to have either X11 or Wayland backends#1070
RFC: CMake/VCPKG: Require SDL3 to have either X11 or Wayland backends#1070SharkWipf wants to merge 1 commit into
Conversation
|
Lol. The CI proves it works at least I guess 😅 |
|
ok, thanks. I will look into it tomorrow |
|
Nothing too urgent, only got one report so far. Maybe just updating the docs is enough for now |
|
Alright, update, I have just verified this behavior, as well as the fix. I am thinking the cleanest fix here will be not to force checks on SDL, but to do pre-flight checks in our own CMake that'll trigger an error when known-required packages are missing. If you're not opposed to that, I can work on that. Just let me know. From discord, direct copy-paste: Okay, I just confirmed: SDL3 does not rebuild after you install the required packages even if you delete your entire build folder and rerun cmake with --fresh, thanks to a messed up vcpkg build file and vcpkg lacking any and all mechanisms to manually invalidate a cached package and force a rebuild. Solution:
(Alternatively you can wipe your entire I also confirmed this is indeed the fix I also confirmed that aside from cuda/cuda-toolkit itself, these are the minimal (for Wayland and X11 SDL support at least) packages you need on debian (and thus presumably popos, ubuntu, mint, etc) you need to have I will wrap this up in a more proper documentation tomorrow or so |
|
Hmm, I added now a check so that the cmake configuration will fail in case the sdl version is not correct. |
|
Hmm, at a glance, I don't think this fixes it? That was what my codex also suggested at first and I rejected it, because it only checks the final built version. Edit: Actually it does provide instructions for the user how to unstale this I guess. Still, I think LFS could benefit from a general pre-flight check, as vcpkg output is a mess to figure out whenever errors happen, and a lot of stuff we could easily prevent by simply doing some pre-flight cmake checks of known-needed packages. Edit 2: So I guess what I'm saying is, we'd ideally have both. |
Probably not for merging. And untested. I'm drafting this, because I'm not happy with this solution, but I want to illustrate the problem.
Currently, SDL3 will happily build without wayland and/or x11 if the required dev libraries aren't available, without raising any errors.
The build will complete without any indication of something being wrong, and a LFS binary is produced that cannot launch a GUI under any circumstances, because it lacks X11/Wayland support:
To make matters worse, installing these libraries later does not invalidate the build cache, so the user has to figure out what's wrong from no errors, figure out the missing packages, then do a full --fresh build, to solve the problem.
So, the solution would be simple you'd think. Make SDL3 require either X11 or Wayland or fail the build.
Except it doesn't seem SDL3's vcpkg exposes any way to control this.
It is possible to override SDL3's vcpkg portfile as done in this PR. But this gets messy fast. Because in order to do so, we also have to override rmgui's portfile, because it needs to pull in our new custom SDL3 version. And any other package pulling in SDL3 will also need a custom portfile.
Disregarding that this specific implementation is a mess of course, the whole portfile override solution is nasty. But I don't think there's any other solution, at least not pre-compile.
So in short:
What is the desired way forward here, if any?
The required (and currently undocumented) packages seem to be (Debian packages, Wayland and X11 mixed):