Skip to content
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

ProtonUp-Qt Flatpak can detect missing dependencies #375

Open
madscientist16 opened this issue Apr 16, 2024 · 4 comments
Open

ProtonUp-Qt Flatpak can detect missing dependencies #375

madscientist16 opened this issue Apr 16, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@madscientist16
Copy link

Describe the bug
ProtonUp-Qt Flatpak is detecting that I have missing dependecies when installing steamtinkerlaunch.

To Reproduce
Steps to reproduce the behavior:

  1. If any dependencies for steamtinkerlaunch is installed then uninstall any one of them.
  2. Open ProtonUp-Qt and try to install steamtinkerlaunch.

Expected behavior
ProtonUp-Qt to not detect if there are missing dependencies.

Screenshots
Detecting missing dependencies.

Screenshot_20240416_232706

Installs if the dependencies are met.

Screenshot_20240416_232532

Desktop:

  • Platform: Laptop
  • System: Arch Linux with KDE Plasma
  • Version: ProtonUp-Qt 2.9.1
  • How did you install ProtonUp-Qt?: Flatpak

Additional context
I'm not sure if this is actually a bug. I made an issue here first and was asked to make an issue here.

Terminal output
Same as the screenshot above.

ProtonUp-Qt 2.9.1 by DavidoTek. Build Info: DavidoTek Flathub build.
Python 3.10.13 (main, Nov 10 2011, 15:00:00) [GCC 12.2.0], PySide 6.5.2
Platform: KDE Flatpak runtime 6.5 Linux-6.8.5-zen1-1-zen-x86_64-with-glibc2.35
Loading locale en / en_US
Loaded ctmod GE-Proton
Loaded ctmod Wine-GE
Loaded ctmod Boxtron
Loaded ctmod D8VK (nightly)
Loaded ctmod Kron4ek Wine-Builds Vanilla
Loaded ctmod Lutris-Wine
Loaded ctmod Luxtorpeda
Loaded ctmod Northstar Proton (Titanfall 2)
Loaded ctmod Proton Tkg
Loaded ctmod Proton Tkg (Wine Master)
Loaded ctmod Roberta
Loaded ctmod Steam-Play-None
Loaded ctmod SteamTinkerLaunch
Loaded ctmod SteamTinkerLaunch-git
Loaded ctmod vkd3d-lutris
Loaded ctmod vkd3d-proton
Loaded ctmod Wine Tkg (Valve Wine)
Loaded ctmod Wine Tkg (Vanilla Wine)
Loaded ctmod DXVK
Loaded ctmod DXVK Async
Loaded ctmod DXVK (nightly)
qt.pysideplugin: Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out.
qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
Gamepad error: No gamepad found.
qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
which: no yad in (/home/madscientist/.local/bin:/home/madscientist/stl/prefix:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/madscientist/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
which: no wget in (/home/madscientist/.local/bin:/home/madscientist/stl/prefix:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/madscientist/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
@madscientist16 madscientist16 added the bug Something isn't working label Apr 16, 2024
@sonic2kk
Copy link
Contributor

sonic2kk commented Apr 16, 2024

(See also: sonic2kk/steamtinkerlaunch#1083)

For continuity, to reiterate what I said on the other issue, I find it very strange that the ProtonUp-Qt Flatpak can even check for missing dependencies. I always thought that this was not possible, and across all tools that ProtonUp-Qt installs which have dependencies.

For SteamTinkerLaunch specifically, I thought we ignored this entirely if we were using ProtonUp-Qt Flatpak.

# Possibly excuse some of these if not on Steam Deck and ignore if Flatpak

But perhaps my wires were crossed, and ProtonUp-Qt can actually run which on the host for Flatpak, and will do this for tools? Maybe I got mixed up between dependencies not being able to be installed on SteamOS or something (#129).


Out of interest, if you install these dependencies, does the warning message disappear when you try to re-install? From the screenshot, some low-hanging fruit to try might be wget - which I am surprised is not present, so perhaps this check is not working properly? I don't recall seeing a distribution without wget (except perhaps very early versions of SteamOS 3), so it would be interesting to know if this check is actually working properly.

@madscientist16
Copy link
Author

I just uninstalled wget for the screenshot. If I install it gets detected by ProtonUp-Qt.

I think this might have something to do with org.freedesktop.Flatpak Session Bus since if I remove it using Flatseal it all of the dependencies appear as missing and I get multiple Portal call failed: org.freedesktop.DBus.Error.ServiceUnknown in the terminal output.

@DavidoTek
Copy link
Owner

which: no yad in

Is yad available in the path, i.e., can you just type yad --version in a terminal and it will work? What is the output?

strange that the ProtonUp-Qt Flatpak can even check for missing dependencies
ProtonUp-Qt can actually run which on the host for Flatpak, and will do this for tools?

It's possible to run commands (including which) on the host using flatpak-spawn if it has access to the org.freedesktop.Flatpak session bus.

Maybe I got mixed up between dependencies not being able to be installed on SteamOS or something (#129).

I think we ignore the checks and just show a warning for some compatibility tools, including Boxtron. Can't remember exactly why we do that.

For SteamTinkerLaunch specifically, I thought we ignored this entirely if we were using ProtonUp-Qt Flatpak.

I think we actually do it.
It will check if it is running inside Flatpak (/.flatpak-info exists) and then try to run the commands using flatpak-spawn.

We might want to change the behavior though:

  • If yad --version fails for some reason, it will set yad_ver = 0.0 which results in STL not being installed
  • If yad_exe is None, yad_ver will not even be set. It is fine as we do yad_exe and yad_ver >= 7.2, but feels a bit sketchy
    (Reference: test is an undefined variable. False and test will return False. True and test will throw an exception)

I think this might have something to do with org.freedesktop.Flatpak Session Bus since if I remove it using Flatseal it all of the dependencies appear as missing and I get multiple Portal call failed: org.freedesktop.DBus.Error.ServiceUnknown in the terminal output

Yes, the dependency is required for detecting dependencies.
We might want to consider that a user does not permit ProtonUp-Qt to run commands on the host.

@sonic2kk
Copy link
Contributor

It's possible to run commands (including which) on the host using flatpak-spawn if it has access to the org.freedesktop.Flatpak session bus.

Ah, I see. So this is a SteamTinkerLaunch documentation issue. For some reason I assumed ProtonUp-Qt couldn't check dependencies on Flatpak and noted this as such on the SteamTinkerLaunch ProtonUp-Qt wiki page. I'll update that on my side.

If yad --version fails for some reason, it will set yad_ver = 0.0 which results in STL not being installed

I think this is fine, SteamTinkerLaunch more or less requires Yad. As of sonic2kk/steamtinkerlaunch#1059, it won't even load SteamTinkerLaunch if Yad isn't installed. Some code paths may work but these are likely more along the lines of oversights than intended functionality (for now, in future I may try to decouple this a little bit to allow for a more streamlined commanndline experience, but it's an exceptionally low priority for now).

If yad_exe is None, yad_ver will not even be set. It is fine as we do yad_exe and yad_ver >= 7.2, but feels a bit sketchy

I agree, we could probably resolve this by setting yad_ver = 0.0 above the if yad_exe line. This would also mean we can remove setting yad_ver = 0.0 if we catch an exception.

To be honest, I should really take another look at the SteamTinkerLaunch ctmod. I'm sure there's plenty of cleanup opportunity - we have ugly nested ifs that could likely be replaced with early falsey checks that return early (example), as well as breaking out various bits of logic into internal-ctmod functions to make some operations a bit clearer (like fetching the version), and using some of our newer util functions (such as write_tool_version to replace this block just like how we replaced a similar block like this for Luxtorpeda (#250).

Since I have a SteamTinkerLaunch installation that I use for STL development on my PC, to avoid any conflicts or borking during ctmod development, I originally developed the ctmod stuff on my PC (I prefer developing at my "battlestation" 😆) and then tested the branch on my laptop, but my laptop was in-flux between distros and I haven't used it in a long time, so it's not in a testing-ready state. And setting up a VM is a bit of a pain because it requires Steam. But in future I will take another look at the SteamTinkerLaunch ctmod and give it a bit of a refactor.

We might want to consider that a user does not permit ProtonUp-Qt to run commands on the host.

We should be able to check for an error coming from trying to run a flatpak-spawn command, right? It should return an error code that we could check for. We could check for this at startup, and if we can't run Flatpak commands we should use this in is_system_compatible as a separate early check, but return true since dependencies could be met, we just can't check. This could also be done for other ctmods. Testing this in localdev may be a bit tricky though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants