DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.16k stars 39 forks source link

`appinfo.vdf` Magic Changed on Steam Client Beta (June 2024) - Needs Resolved Upstream in `ValvePython/steam` #415

Open sonic2kk opened 4 days ago

sonic2kk commented 4 days ago

Relevant upstream PRs:


Please fill out following when reporting a new bug:

Describe the bug
The upstream magic for appinfo.vdf changed again on the latest Steam Client Beta, meaning parse_appinfo from ValvePython/steam is broken. This happened before (ValvePython/steam#418) and this new issue has already been reported upstream (ValvePython/steam#462).

I am making this issue for awareness for anyone who runs into this, and also for us to track this so that we can update the Steam dependency once a version with a fix is available.

To Reproduce
Steps to reproduce the behavior:

  1. Open ProtonUp-Qt while on the latest Steam Client Beta
  2. With Steam selected, it will open significantly faster than normal
  3. Open the Game List
  4. Only Steam Shortcuts will be listed

Expected behavior
ProtonUp-Qt should be able to parse the appinfo.vdf, but cannot pending an upstream fix.

Screenshots
N/A.

Desktop (please complete the following information):

Additional context
Took a stab at trying to submit a patch for this upstream, but no guarantees my fix will be the one that gets merged as it is still in progress :smile:

Terminal output
The parse_appinfo gives the following output because it cannot parse the magic in the file.

Error getting ctool map from appinfo.vdf: Invalid magic, got b')DV\x07'
Error updating SteamApp info from appinfo.vdf: Invalid magic, got b')DV\x07'

The fix is not as straightforward as adding the magic to the file though, as we need to skip past some parts of the file. And then there are some issues around parsing the binary VDF information in this file under data.

sonic2kk commented 4 days ago

A small effort by me and a much larger effort by the Protontricks maintainer have created a working implementation however changes are required for both ValvePython/steam and ValvePython/vdf. So we will need to bump both versions once updates are in place.

sonic2kk commented 3 days ago

It seems like the only thing we depend on from the steam dependency is the parse_appinfo function. We could implement this function ourselves in a thirdparty/steam/utils/appcache folder and remove the Steam dependency altogether. This would also allow us to potentially make some performance-speciifc tweaks, something I have been looking at recently but have not made much headway with - the generator is the biggest bottleneck when opening with/selecting the Steam launcher. We can optimise a little bit by searching directly for the Steam Play tools AppID, roughly halving the time it takes iirc, and perhaps further optimisations could be made.

This would allow us to cut one of the larger dependencies we have, the steam dependency is approximately 10mb and it has the following dependencies:

So by implementing the Steam dependency ourselves we can save about 17mb - 10mb from the dependency itself, and 7 from removing the dependency on Cryptodome.

The upstream license of steam is compatible with ProtonUp-Qt's as it is less restrictive, so there shouldn't be any issues adding this ourselves from that standpoint.


Pros:

Cons:

Personally I think we should only consider this if:

  1. Upstream does not merge the changes fast enough - unsure how actively maintained it is, there haven't been many commits but maybe that's because it's stable rather than anything else. But if we want to do a release and there is no fix in place it may be something to consider, mainly because we only use this part of the Steam dependency.
  2. We think we could really get a lot out of owning this dependency ourselves in terms of optimisations and other patches.