News for hackers. Stuff that matters.
Re:Static Linking Considered Harmful (2004) by klodolph on Monday September 28, 2020 @12:33PM (#24618428)
Games on Linux are a beast, aren’t they! I think doing this kind of thing successfully requires making good decisions about which dependencies you consider to be part of the system and which dependencies you want to include with your application.

For example, it is fairly reasonable to require LibSDL2 to be installed. However, if you bundle LibSDL2 with your app, you’re now directly dependent on things like X11 and ALSA.

Re:Static Linking Considered Harmful (2004) by donio on Monday September 28, 2020 @12:55PM (#24618705)
Controversial opinion but making sure that your game runs well under Wine is not the worst way to ship games for Linux.

This is especially true once the game gets older and less supported. The native Linux libraries might move on over time and the version you require might become unavailable or broken in some way but once a game works on Wine it will likely continue working forever unless you make some change to break it.

These days when it comes to my Steam library I am less worried about the Proton[1] games than the native ones and there have been several cases where I opted to run the Proton version because it worked better than native.

[1] Proton is the version of Wine Steam uses

Re:Static Linking Considered Harmful (2004) by AnIdiotOnTheNet on Monday September 28, 2020 @12:37PM (#24618484)
> I think doing this kind of thing successfully requires making good decisions about which dependencies you consider to be part of the system and which dependencies you want to include with your application.

Herein lies the problem, because Linux has absolutely no distinction between "system" and "application". Everything is part of the system.

Re:Static Linking Considered Harmful (2004) by Joker_vD on Monday September 28, 2020 @12:57PM (#24618726)
> For example, it is fairly reasonable to require LibSDL2 to be installed.

You mean, "the game's package has libsdl2 listed as a requirement"? Or "if you install the game without libsdl2 present, it will install, but will crash on launch"?

> However, if you bundle LibSDL2 with your app, you’re now directly dependent on things like X11 and ALSA.

Well, either those are present and the game will work, or you've tried to install the game on a headless server and surely you don't expect to miraculously just work?

Re:Static Linking Considered Harmful (2004) by klodolph on Monday September 28, 2020 @01:15PM (#24618951)
> You mean, "the game's package has libsdl2 listed as a requirement"? Or "if you install the game without libsdl2 present, it will install, but will crash on launch"?

Are you some kind of malevolent genie? Trying to figure out the worst possible user experience that corresponds to the words I wrote?

> Well, either those are present and the game will work, or you've tried to install the game on a headless server and surely you don't expect to miraculously just work?

The assumption here is that the only two options are either “X11+ALSA” or “headless”, and I don’t agree with that assumption. SDL2 on Linux has two video drivers and five audio drivers. Fact is, I can run horribly old Linux software that uses SDL for audio and it works fine, but old software that uses OSS or /dev/dsp is not going to work. With Wayland, I think it's not unreasonable to prefer a dependency on SDL over a direct dependency on X11.

Re:Static Linking Considered Harmful (2004) by Joker_vD on Monday September 28, 2020 @02:10PM (#24619587)
Oh, I think I understand your point now: there are old versions of SDL2 for old Linuxes, and more recent versions of SDL2 for modern Linuxes, and they use different Linux subsystems, but since they have the same API, any old software that used SDL2 still functions properly to modern Linux even though the low levels of the stack have changed dramatically.

Yes, that's a valid point actually. But ultimately it's a bet on what API will end up more durable: X11 or SDL2, isn't it?

Re:Static Linking Considered Harmful (2004) by klodolph on Monday September 28, 2020 @02:23PM (#24619754)
Yeah, it’s a bet on which API is more durable. Some other minor factors are that you might want a newer SDL anyway, because the library comes with a database of different models of gamepads (https://github.com/gabomdq/SDL_GameControllerDB) and if you link against SDL dynamically, you get support for newer gamepad models for “free”.

One of the other factors here is that the ability to play old games is in some sense about the preservation of culture. If you have an x64 Linux binary that uses SDL + OpenGL, I have a strong feeling that you’ll be able to play it 20 years from now, although it might inconvenient to get working.