ddnet icon indicating copy to clipboard operation
ddnet copied to clipboard

[Linux] Starting DDNet nightly from steam does not work

Open Jupeyy opened this issue 6 months ago • 22 comments

~/.steam/debian-installation/steamapps/common/DDraceNetwork/ddnet/DDNet: symbol lookup error: 

~/.steam/debian-installation/steamapps/common/DDraceNetwork/ddnet/DDNet: undefined symbol: curl_multi_poll

if i start the game files downloaded by steam manually in the terminal without steam (./DDNet) it works

maybe steam ships its own curl library?

Jupeyy avatar Feb 04 '24 08:02 Jupeyy

apparently steam ships version libcurl 7.22.0

Jupeyy avatar Feb 04 '24 09:02 Jupeyy

Sadly that version seems to lack both curl_multi_wait and curl_multi_poll. I'll have to investigate further and see what is available, but it seems we'll have to resort to getting the fds with curl_multi_fdset and doing a select of our own

Assuming we can't ship our own libcurl, ignore the steam runtime for libcurl or statically link libcurl.

Learath2 avatar Feb 04 '24 09:02 Learath2

We could probably try to ship our own libcurl. Although that might give us more issues such as #3909.

heinrich5991 avatar Feb 04 '24 12:02 heinrich5991

We could probably try to ship our own libcurl. Although that might give us more issues such as #3909.

Hm, isn't #3909 an issue of steams shipped libcurl? I'd think shipping our own would fix that too.

I'm open to both solutions, idk which would really be better, there might be issues with shipping our own because libcurl itself links to other stuff, so it'll be using the steam-runtime libraries, which might be e.g. too old for the libcurl we ship.

curl_multi_poll was shipped in 7.66. This is what we use currently. cutl_multi_wait was shipped in 7.29. This can be made to work as I did in #5842

Learath2 avatar Feb 04 '24 12:02 Learath2

I thought #3909 was an issue with any libcurl that isn't the nix-provided one. Not sure though.

heinrich5991 avatar Feb 04 '24 13:02 heinrich5991

Better leave nix broken and fix it for anyone else than not fixing at all, because nix is broken xd.

In the steam dev-options for the game there is no option to disable certain steam-runtime libs?

Then i guess only option is to provide a build of curl our own

Jupeyy avatar Feb 05 '24 16:02 Jupeyy

Better leave nix broken and fix it for anyone else than not fixing at all, because nix is broken xd.

I agree. But my concern wasn't about nix getting broken but us breaking other distributions where the steam-provided libcurl works and ours might not.

heinrich5991 avatar Feb 05 '24 21:02 heinrich5991

anything we could try to resolve this?

E.g. "In the steam dev-options for the game there is no option to disable certain steam-runtime libs?"

Jupeyy avatar Feb 13 '24 19:02 Jupeyy

@Learath2 Let's ship our own curl for Linux?

def- avatar Mar 02 '24 13:03 def-

I think that's the easiest fix if it plays well with the rest of the steam runtime. Since steam curl is too old for even curl_multi_wait, the fix without bumping curl is to call out to select ourselves, which can be done, but it is more work

Learath2 avatar Mar 02 '24 13:03 Learath2

I'll try to implement that.

def- avatar Mar 02 '24 13:03 def-

I think the main problem is what version of openssl to use and we really don't want to ship openssl.

def- avatar Mar 02 '24 13:03 def-

Does steam maybe ship multiple curl versions and we could select a newer one?

def- avatar Mar 02 '24 13:03 def-

https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/2266ff49ee8f05acc8a60b91a89658d2899f4573/docs/container-runtime.md

Maybe we can look for newer ones here. Not sure how to select them yet, though.

heinrich5991 avatar Mar 02 '24 13:03 heinrich5991

We apparently need to contact Valve support for this: https://gitlab.steamos.cloud/steamrt/sniper/sdk/-/blob/e712350c0a405a0dac2c078e31468ed6fd7d273c/README.md

Native Linux games that require sniper can be released on Steam. The intention is that this will become available as a "self-service" feature via the Steamworks partner web interface, which can be used by any game that benefits from a newer library stack. However, as of early 2024, this mechanism is not yet ready, so configuring a game to run in sniper requires manual setup by a Valve developer. Please contact Valve for more information.

heinrich5991 avatar Mar 02 '24 13:03 heinrich5991

Perhaps we could also ask them to disable all compatibility tools? DDNet should run well with the distribution packages.

heinrich5991 avatar Mar 02 '24 13:03 heinrich5991

Krita does the following to escape the Steam runtime: https://github.com/KDE/krita/blob/c60015632a2d4916c314007cd666d22a59d1af50/packaging/steam/launch.sh.

#!/bin/bash
# Launcher script for running the Krita AppImage inside of the Steam Linux Runtime.
# Include alongside krita.appimage (probably in `content/linux/`) and 
# configure Steamworks to use this as the default/primary launch option.

# Prevent runtime environment or host system libraries from being used over AppImage packaged ones. 
unset LD_LIBRARY_PATH

# UTF-8 Locale support.
LC_ALL=en_US.UTF-8

# Prevents Auto-Updates.
STARTED_BY_STEAM=1

# Launch Krita.
appdir=$(dirname "$0")
$appdir/krita.appimage

heinrich5991 avatar Mar 02 '24 13:03 heinrich5991

@heinrich5991 Do you want to try to communicate to Steam to get this resolved? That sounds like the cleanest solution.

def- avatar Mar 02 '24 17:03 def-

I'll try. I don't know where to start, so I opened an issue: https://gitlab.steamos.cloud/steamrt/steamrt/-/issues/29.

heinrich5991 avatar Mar 02 '24 18:03 heinrich5991

Perhaps we could also ask them to disable all compatibility tools? DDNet should run well with the distribution packages.

I don't think you can rely on this. Distros like NixOS probably won't be very compatible with this

Scrumplex avatar Mar 02 '24 21:03 Scrumplex

DDNet is already broken on NixOS with Steam runtime. ~~But it apparently works without, so it seems like it might be the opposite of what you're stating?~~ (EDIT: incorrect, see below.) See #3909.

heinrich5991 avatar Mar 02 '24 21:03 heinrich5991

DDNet is broken on NixOS if you don't force the use of SLR 1.0 (scout) seemingly because of the mixed libcurl and libopenssl.

I think SLR 1.0 just makes DDNet load Steam's OpenSSL?

Scrumplex avatar Mar 02 '24 22:03 Scrumplex

https://github.com/ValveSoftware/steam-runtime/issues/654

heinrich5991 avatar Mar 04 '24 20:03 heinrich5991

Hi, I'm a Steam Runtime developer (but I am not able to do what you request in https://github.com/ValveSoftware/steam-runtime/issues/654, someone from Valve will have to handle that for you). I'm glad to see another open source game heading towards sniper!

For binaries that will be shipped on a branch that targets sniper, please compile in the sniper SDK (I see you've already found its documentation). Binaries built in other environments (Debian, Ubuntu, Fedora, etc.) are not guaranteed to work correctly in sniper - they sometimes might, if you're sufficiently lucky, but the sniper SDK is the only supportable build environment for SLR 3.0 (sniper).

Krita does the following to escape the Steam runtime

Please don't do that :-)

Perhaps we could also ask them to disable all compatibility tools?

That is intentionally not an option that Valve offers, because making the same binaries work on every distribution is difficult and limiting. I know this from experience, because we have to do this for the container framework itself - and that's "easy mode" in some ways, because it doesn't have a GUI, and certainly no accelerated graphics.

libcurl is particularly painful for this, because for historical reasons there have been multiple incompatible approaches to its versioned symbols, and we were unlucky enough that Steam Runtime 1 'scout' happens to be based on a distribution release that ended up incompatible with the libcurl from the rest of the world.

In the steam dev-options for the game there is no option to disable certain steam-runtime libs

This is not an option that is likely to be added. When someone with the appropriate access to the Steam partner interface has the necessary development time available to give you a self-service way to switch to a different runtime environment, the highest priority is likely to be providing a way to switch some or all branches to sniper for yourself, without having to ask Valve to set it up. Unfortunately, that's not available, so asking for it like https://github.com/ValveSoftware/steam-runtime/issues/654 is the best that's possible right now.

smcv avatar Mar 04 '24 20:03 smcv

That is intentionally not an option that Valve offers, because making the same binaries work on every distribution is difficult and limiting. I know this from experience, because we have to do this for the container framework itself - and that's "easy mode" in some ways, because it doesn't have a GUI, and certainly no accelerated graphics.

Like Krita, we're shipping Linux binaries from our website that are supposed to work on all distributions. As you can see above, there are problems with Nix, but I have not heard from others.

libcurl is particularly painful for this, because for historical reasons there have been multiple incompatible approaches to its versioned symbols, and we were unlucky enough that Steam Runtime 1 'scout' happens to be based on a distribution release that ended up incompatible with the libcurl from the rest of the world.

We explicitly opt out of the versioned symbols since we don't tamper with the TLS libraries that libcurl uses. We do that by linking against a fake curl library that exports the unversioned symbols: https://github.com/ddnet/ddnet/blob/b88cdbf21ee5d0faa9e38e596fdd965c0a8a9f09/scripts/generate_fake_curl.py.

heinrich5991 avatar Mar 04 '24 20:03 heinrich5991

The sniper runtime should be enabled now: https://github.com/ValveSoftware/steam-runtime/issues/654#issuecomment-1982153652.

heinrich5991 avatar Mar 10 '24 13:03 heinrich5991

This seems to be fixed now!

Scrumplex avatar Mar 10 '24 14:03 Scrumplex

Works for me as well, on Arch Linux.

heinrich5991 avatar Mar 10 '24 14:03 heinrich5991

Thank you @heinrich5991 ! Do we still need to do anything since you only asked for Sniper runtime on beta and RC branches? Or will it work for default too?

def- avatar Mar 10 '24 22:03 def-

Thank you @heinrich5991 ! Do we still need to do anything since you only asked for Sniper runtime on beta and RC branches? Or will it work for default too?

We'll have to ask for the main branch as well. I'll do so now.

heinrich5991 avatar Mar 10 '24 23:03 heinrich5991