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

Don't enable Steam Runtime when switching to wine-ge-proton #2593

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

SuperSamus
Copy link
Contributor

Description

wine-ge-proton contains proton in its name, which caused Bottles to enable the Steam Runtime.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Kinsteen
Kinsteen previously approved these changes Jan 21, 2023
@TheEvilSkeleton
Copy link
Member

If I remember right, this was actually intended, because it's made for Steam. @mirkobrombin thoughts?

@Kinsteen
Copy link
Contributor

@TheEvilSkeleton No, Proton-GE is intended for Steam. Wine-GE can and should be used without Steam. I don't know why "-proton" was added, but it definitely shouldn't force enable the Steam runtime

@TheEvilSkeleton
Copy link
Member

Wait, what is this one? I know of wine-ge-custom and proton-ge-custom. I've never heard of wine-ge-proton.

@Kinsteen
Copy link
Contributor

Because it doesn't exist, this is Wine-GE aka wine-ge-proton. For some reason, @koplo199 added "proton" to the name of Wine-GE here: bottlesdevs/components#190

Why was this change needed?

@koplo199
Copy link
Contributor

@Kinsteen Interesting, I originally changed it because:

  1. It is the official name (see titles: it is Wine-GE-Proton7-35 Released, not Wine-GE-7-35 Released)
  2. It is consistent with other components/runners names: they all fit the {prefix}-{tag} naming scheme, including wine-ge: {wine}-{GE-Proton7-35} (using again the official GitHub repository tags)
  3. Any attempt to use the old name would have required a special handling/tweak/hack just to support it, and the more hack there is, the more difficult it becomes to maintain.

To me, the bug here is on the core side and not on the component side: whether the runner is a proton/wine one shouldn't be guessed by checking a list of hard-coded names when the components yml files already specify Sub-category: proton or Sub-category: wine.

I see that in manager.py there is:

supported_wine_runners = {}
supported_proton_runners = {}

Could we instead of hard-coding the name, just check if the runner is contained in supported_proton_runners? Would it be an acceptable fix?

@@ -89,7 +89,7 @@ def runner_update(config: BottleConfig, manager: 'Manager', runner: str) -> Resu
the host system. There are some exceptions, like the Soda and Wine-GE runners,
which are built to work without the Steam Runtime.
"""
if "proton" in runner.lower() and RuntimeManager.get_runtimes("steam"):
if "proton" in runner.lower() and not runner.startswith("wine-ge-proton") and RuntimeManager.get_runtimes("steam"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if "proton" in runner.lower() and not runner.startswith("wine-ge-proton") and RuntimeManager.get_runtimes("steam"):
if runner in manager.supported_proton_runners and RuntimeManager.get_runtimes("steam"):

@Kinsteen
Copy link
Contributor

@koplo199 It would be a perfect fix, even more so than what we had before. I tested quickly, and it seemed to work fine. More tests would be welcome, but I think it's the way to go.

@Kinsteen Kinsteen dismissed their stale review January 21, 2023 16:47

See converstation with koplo

@SuperSamus
Copy link
Contributor Author

Looking around the code, it seems that "Proton" in runner is used in multiple places, like here, or here. (Just grep "proton"/"Proton" to find them)
I guess these should be changed too, but I'm not familiar with the codebase (nor with Python), so I don't know how I should do manager.supported_proton_runners in these cases.

@Kinsteen
Copy link
Contributor

Okay. Would you be more comfortable closing this, and letting someone else do it, and change this like I suggested so we could merge? Someone else can do the other occurrences of this behavior, if you don't want to do it.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2023

Pylint result on modfied files:
************* Module bottles.backend.runner
bottles/backend/runner.py:43:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/runner.py:84:8: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/runner.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods)
************* Module bottles.backend.managers.manager
bottles/backend/managers/manager.py:128:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/backend/managers/manager.py:695:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/backend/managers/manager.py:1209:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/backend/managers/manager.py:1223:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/backend/managers/manager.py:1237:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/backend/managers/manager.py:1:0: C0302: Too many lines in module (1520/1000) (too-many-lines)
bottles/backend/managers/manager.py:409:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/managers/manager.py:765:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/managers/manager.py:1424:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/managers/manager.py:1424:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/managers/manager.py:41:0: W0404: Reimport 'Samples' (imported line 26) (reimported)
bottles/backend/managers/manager.py:150:16: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:150:19: C0103: Variable name "t" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:154:16: C0103: Variable name "t" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:162:8: C0103: Variable name "rv" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:167:8: W0106: Expression "self.check_dxvk(install_latest) or rv.set_status(False)" is assigned to nothing (expression-not-assigned)
bottles/backend/managers/manager.py:170:8: W0106: Expression "self.check_vkd3d(install_latest) or rv.set_status(False)" is assigned to nothing (expression-not-assigned)
bottles/backend/managers/manager.py:173:8: W0106: Expression "self.check_nvapi(install_latest) or rv.set_status(False)" is assigned to nothing (expression-not-assigned)
bottles/backend/managers/manager.py:176:8: W0106: Expression "self.check_latencyflex(install_latest) or rv.set_status(False)" is assigned to nothing (expression-not-assigned)
bottles/backend/managers/manager.py:179:8: W0106: Expression "self.check_runtimes(install_latest) or rv.set_status(False)" is assigned to nothing (expression-not-assigned)
bottles/backend/managers/manager.py:182:8: W0106: Expression "self.check_winebridge(install_latest) or rv.set_status(False)" is assigned to nothing (expression-not-assigned)
bottles/backend/managers/manager.py:185:8: W0106: Expression "self.check_runners(install_latest) or rv.set_status(False)" is assigned to nothing (expression-not-assigned)
bottles/backend/managers/manager.py:368:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:372:22: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
bottles/backend/managers/manager.py:377:31: C0207: Use version.split('\n', maxsplit=1)[0] instead (use-maxsplit-arg)
bottles/backend/managers/manager.py:397:12: C0206: Consider iterating with .items() (consider-using-dict-items)
bottles/backend/managers/manager.py:397:16: C0103: Variable name "r" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:407:25: W1202: Use lazy % or % formatting in logging functions (logging-format-interpolation)
bottles/backend/managers/manager.py:411:8: R1702: Too many nested blocks (6/5) (too-many-nested-blocks)
bottles/backend/managers/manager.py:456:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
bottles/backend/managers/manager.py:456:40: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:483:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
bottles/backend/managers/manager.py:483:44: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:551:25: W1202: Use lazy % or % formatting in logging functions (logging-format-interpolation)
bottles/backend/managers/manager.py:620:8: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:648:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:665:16: W0702: No exception type(s) specified (bare-except)
bottles/backend/managers/manager.py:738:21: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
bottles/backend/managers/manager.py:738:48: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:797:16: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:810:16: C0103: Variable name "p" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:819:16: C0103: Variable name "c" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:820:16: C0103: Variable name "c" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:843:12: C0103: Variable name "b" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:844:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:851:25: W1202: Use lazy % or % formatting in logging functions (logging-format-interpolation)
bottles/backend/managers/manager.py:860:4: R0913: Too many arguments (7/5) (too-many-arguments)
bottles/backend/managers/manager.py:885:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:922:8: C0206: Consider iterating with .items() (consider-using-dict-items)
bottles/backend/managers/manager.py:923:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:935:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:943:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:948:16: R1721: Unnecessary use of a comprehension, use list(self.dxvk_available) instead. (unnecessary-comprehension)
bottles/backend/managers/manager.py:953:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:958:16: R1721: Unnecessary use of a comprehension, use list(self.vkd3d_available) instead. (unnecessary-comprehension)
bottles/backend/managers/manager.py:963:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:968:16: R1721: Unnecessary use of a comprehension, use list(self.nvapi_available) instead. (unnecessary-comprehension)
bottles/backend/managers/manager.py:976:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:994:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:1000:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:1006:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:1013:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:1016:29: C0201: Consider iterating the dictionary directly instead of calling .keys() (consider-iterating-dictionary)
bottles/backend/managers/manager.py:1024:4: R0913: Too many arguments (14/5) (too-many-arguments)
bottles/backend/managers/manager.py:1125:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:1142:8: W0702: No exception type(s) specified (bare-except)
bottles/backend/managers/manager.py:1154:12: W0702: No exception type(s) specified (bare-except)
bottles/backend/managers/manager.py:1151:21: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
bottles/backend/managers/manager.py:1151:84: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:1191:8: C0103: Variable name "rk" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:1201:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/manager.py:1205:15: W0125: Using a conditional statement with a constant value (using-constant-test)
bottles/backend/managers/manager.py:1200:8: R1702: Too many nested blocks (6/5) (too-many-nested-blocks)
bottles/backend/managers/manager.py:1200:8: R1702: Too many nested blocks (7/5) (too-many-nested-blocks)
bottles/backend/managers/manager.py:1200:8: R1702: Too many nested blocks (7/5) (too-many-nested-blocks)
bottles/backend/managers/manager.py:1285:21: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
bottles/backend/managers/manager.py:1285:54: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:1423:12: W0621: Redefining name 'uuid' from outer scope (line 23) (redefined-outer-name)
bottles/backend/managers/manager.py:1438:8: W1510: 'subprocess.run' used without explicitly defining the value for 'check'. (subprocess-run-check)
bottles/backend/managers/manager.py:1441:12: C0103: Variable name "b" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/manager.py:1481:4: R0913: Too many arguments (7/5) (too-many-arguments)
bottles/backend/managers/manager.py:79:0: R0904: Too many public methods (23/20) (too-many-public-methods)
bottles/backend/managers/manager.py:28:0: C0411: standard import "import shutil" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:29:0: C0411: standard import "import fnmatch" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:30:0: C0411: standard import "import contextlib" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:31:0: C0411: standard import "from glob import glob" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:32:0: C0411: standard import "from datetime import datetime" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:33:0: C0411: standard import "from gettext import gettext as _" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:34:0: C0411: standard import "from typing import Union, Any, Dict, List" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:35:0: C0411: third party import "from gi.repository import GLib" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:36:0: C0411: third party import "import pathvalidate" should be placed before "from bottles.backend.models.config import BottleConfig" (wrong-import-order)
bottles/backend/managers/manager.py:38:0: C0412: Imports from package bottles are not grouped (ungrouped-imports)
bottles/backend/managers/manager.py:19:0: W0611: Unused import hashlib (unused-import)
bottles/backend/managers/manager.py:39:0: W0611: Unused Runner imported from bottles.backend.runner (unused-import)
bottles/backend/managers/manager.py:43:0: W0611: Unused JournalManager imported from bottles.backend.managers.journal (unused-import)
bottles/backend/managers/manager.py:43:0: W0611: Unused JournalSeverity imported from bottles.backend.managers.journal (unused-import)
bottles/backend/managers/manager.py:61:0: W0611: Unused cache imported from bottles.backend.utils.decorators (unused-import)

…nner name

Fixes an issue where using to `wine-ge-proton` would make Bottles think it's a Proton runner, thus enabling the Steam Runtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants