Skip to content

Commit

Permalink
Merge branch 'main' into 32bits-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
orowith2os authored Sep 6, 2023
2 parents 4948a4a + ec424cb commit 6133d89
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 60 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
2 changes: 1 addition & 1 deletion .github/workflows/build_flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
options: --privileged
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6
with:
bundle: bottles.flatpak
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
regex: '[Vv]ersion.*:.*202\d.\d\d?.\d\d?'
- if: ${{ steps.regex-match.outputs.match != '' }}
name: Close Issue
uses: peter-evans/close-issue@v2
uses: peter-evans/close-issue@v3
with:
close-reason: not_planned
comment: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pylint-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
pylint-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.10
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pylint-commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ jobs:
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
uses: actions/github-script@v6.4.1
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts ({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pylint-result"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
pytest-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
update-manifest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: "bottles-repository"
ref: ${{ github.ref_name }}
Expand Down
2 changes: 1 addition & 1 deletion bottles/backend/managers/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, manager, offline: bool = False):
self.__utils_conn = manager.utils_conn

@lru_cache
def get_dependency(self, name: str, plain: bool = False) -> Union[str, dict]:
def get_dependency(self, name: str, plain: bool = False) -> Union[str, dict, bool]:
return self.__repo.get(name, plain)

@lru_cache
Expand Down
19 changes: 12 additions & 7 deletions bottles/backend/managers/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def get_programs(self, config: BottleConfig) -> List[dict]:
skip if the path contains the "Uninstall" word.
'''
executable_path = LnkUtils.get_data(program)
if executable_path is None:
if executable_path in [None, ""]:
continue
executable_name = executable_path.split("\\")[-1]
program_folder = ManagerUtils.get_exe_parent_dir(config, executable_path)
Expand All @@ -727,13 +727,12 @@ def get_programs(self, config: BottleConfig) -> List[dict]:
bottle,
executable_path.replace("C:\\", "drive_c\\").replace("\\", "/")
)

if os.path.exists(path_check):
if executable_name not in found:
installed_programs.append({
"executable": executable_name,
"arguments": "",
"name": executable_name.split(".")[0],
"name": executable_name.rsplit('.',1)[0],
"path": executable_path,
"folder": program_folder,
"icon": "com.usebottles.bottles-program",
Expand Down Expand Up @@ -1064,8 +1063,10 @@ def create_bottle_from_config(self, config: BottleConfig) -> bool:
'''
if dependency in self.supported_dependencies.keys():
dep = [dependency, self.supported_dependencies[dependency]]
self.dependency_manager.install(config, dep)

res = self.dependency_manager.install(config, dep)
if not res.ok:
logging.error(_("Failed to install dependency: %s") % dep.get("Description", "n/a"), jn=True)
return False
logging.info(f"New bottle from config created: {config.Path}")
self.update_bottles(silent=True)
return True
Expand Down Expand Up @@ -1315,7 +1316,7 @@ def components_check():
# blacklisting processes
logging.info("Optimizing environment…")
log_update(_("Optimizing environment…"))
_blacklist_dll = ["winemenubuilder.exe", "mshtml"] # avoid gecko, mono popups
_blacklist_dll = ["winemenubuilder.exe"]
for _dll in _blacklist_dll:
reg.add(
key="HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides",
Expand Down Expand Up @@ -1382,7 +1383,11 @@ def components_check():
if dep in self.supported_dependencies:
_dep = self.supported_dependencies[dep]
log_update(_("Installing dependency: %s …") % _dep.get("Description", "n/a"))
self.dependency_manager.install(config, [dep, _dep])
res = self.dependency_manager.install(config, [dep, _dep])
if not res.ok:
logging.error(_("Failed to install dependency: %s") % _dep.get("Description", "n/a"), jn=True)
log_update(_("Failed to install dependency: %s") % _dep.get("Description", "n/a"))
return Result(False)
template_updated = True

# save bottle config
Expand Down
14 changes: 9 additions & 5 deletions bottles/backend/models/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Samples:
"dxvk": True,
# "nvapi": True,
"vkd3d": True,
"sync": "esync",
"sync": "fsync",
"fsr": False,
"discrete_gpu": True,
"pulseaudio_latency": False
Expand All @@ -19,7 +19,10 @@ class Samples:
"times32",
"courie32",
"d3dcompiler_43",
"d3dcompiler_47"
"d3dcompiler_47",
"mono",
"gecko",
"faudio",
]
},
"application": {
Expand All @@ -33,9 +36,10 @@ class Samples:
"arial32",
"times32",
"courie32",
# "mono",
# "dotnet40",
# "dotnet48"
"mono",
"gecko"
# "dotnet40",
# "dotnet48"
]
}
}
Expand Down
5 changes: 3 additions & 2 deletions bottles/backend/repos/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#

from io import BytesIO
from typing import Union

import pycurl

Expand Down Expand Up @@ -62,7 +63,7 @@ def __get_catalog(self, index: str, offline: bool = False):
logging.error(f"Cannot fetch {self.name} repository index.")
return {}

def get_manifest(self, url: str, plain: bool = False):
def get_manifest(self, url: str, plain: bool = False) -> Union[str, dict, bool]:
try:
buffer = BytesIO()

Expand All @@ -81,4 +82,4 @@ def get_manifest(self, url: str, plain: bool = False):
return yaml.load(res)
except (pycurl.error, yaml.YAMLError):
logging.error(f"Cannot fetch {self.name} manifest.")
return {}
return False
10 changes: 9 additions & 1 deletion bottles/backend/utils/vulkan.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from glob import glob
import shutil
import subprocess
import filecmp


class VulkanUtils:
Expand Down Expand Up @@ -49,7 +50,14 @@ def __get_vk_icd_loaders(self):

for file in _files:
if "nvidia" in file.lower():
loaders["nvidia"] += [file]
# Workaround for nvidia flatpak bug: https://github.com/flathub/org.freedesktop.Platform.GL.nvidia/issues/112
should_skip=False
for nvidia_loader in loaders["nvidia"]:
if filecmp.cmp(nvidia_loader, file):
should_skip=True
continue
if not should_skip:
loaders["nvidia"] += [file]
elif "amd" in file.lower() or "radeon" in file.lower():
loaders["amd"] += [file]
elif "intel" in file.lower():
Expand Down
6 changes: 3 additions & 3 deletions bottles/backend/wine/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ def __init__(
if override_dxvk is not None \
and not override_dxvk \
and self.config.Parameters.dxvk:
env_dll_overrides.append("d3d9,d3d11,d3d10core,dxgi=b")
env_dll_overrides.append("d3d9,d3d11,d3d10core,dxgi=n")

if override_vkd3d is not None \
and not override_vkd3d \
and self.config.Parameters.vkd3d:
env_dll_overrides.append("d3d12=b;d3d12core=b,n")
env_dll_overrides.append("d3d12,d3d12core=n")

if override_nvapi is not None \
and not override_nvapi \
and self.config.Parameters.dxvk_nvapi:
env_dll_overrides.append("nvapi,nvapi64=b")
env_dll_overrides.append("nvapi,nvapi64=n")

if override_fsr is not None and override_fsr:
self.environment["WINE_FULLSCREEN_FSR"] = "1"
Expand Down
15 changes: 5 additions & 10 deletions bottles/backend/wine/winecommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ def get_env(self, environment: Optional[dict] = None, return_steam_env: bool = F

# Default DLL overrides
if not return_steam_env:
if all(not s.startswith("mshtml=") for s in dll_overrides):
dll_overrides.append("mshtml=d")
dll_overrides.append("winemenubuilder=''")

# Get Runtime libraries
Expand Down Expand Up @@ -282,15 +280,17 @@ def get_env(self, environment: Optional[dict] = None, return_steam_env: bool = F
env.add("__GL_SHADER_DISK_CACHE_PATH", os.path.join(bottle, "cache", "gl_shader"))
env.add("MESA_SHADER_CACHE_DIR", os.path.join(bottle, "cache", "mesa_shader"))

# VKD£D environment variables
# VKD3D environment variables
if params.vkd3d and not return_steam_env:
env.add("VKD3D_SHADER_CACHE_PATH", os.path.join(bottle, "cache", "vkd3d_shader"))

# LatencyFleX environment variables
if params.latencyflex and not return_steam_env:
_lf_path = ManagerUtils.get_latencyflex_path(config.LatencyFleX)
_lf_icd = os.path.join(_lf_path, "layer/usr/share/vulkan/implicit_layer.d/latencyflex.json")
_lf_layer_path = os.path.join(_lf_path, "layer/usr/share/vulkan/implicit_layer.d")
env.concat("VK_ADD_LAYER_PATH", _lf_layer_path)
env.add("LFX", "1")
ld.append(os.path.join(_lf_path, "layer/usr/lib/x86_64-linux-gnu"))
else:
env.add("DISABLE_LFX", "1")

Expand Down Expand Up @@ -336,11 +336,6 @@ def get_env(self, environment: Optional[dict] = None, return_steam_env: bool = F
debug_level = "+fixme-all"
env.add("WINEDEBUG", debug_level)

# LatencyFleX
if params.latencyflex and params.dxvk_nvapi and not return_steam_env:
_lf_path = ManagerUtils.get_latencyflex_path(config.LatencyFleX)
ld.append(os.path.join(_lf_path, "wine/usr/lib/wine/x86_64-unix"))

# Aco compiler
# if params["aco_compiler"]:
# env.add("ACO_COMPILER", "aco")
Expand Down Expand Up @@ -511,7 +506,7 @@ def get_cmd(
Sniper is the default runtime used by Proton version >= 8.0
'''
_picked = _rs["sniper"]
if "soldier" in _rs.keys() and "soldier" in self.runner_runtime:
elif "soldier" in _rs.keys() and "soldier" in self.runner_runtime:
'''
Sniper is the default runtime used by Proton version >= 5.13 and < 8.0
'''
Expand Down
9 changes: 7 additions & 2 deletions bottles/frontend/windows/envvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,18 @@ def __save_var(self, *_args):
return

env_name = self.entry_name.get_text()
env_value = "value"
split_value = env_name.rsplit('=', 1)
if len(split_value) == 2:
env_name = split_value[0]
env_value = split_value[1]
self.manager.update_config(
config=self.config,
key=env_name,
value="value",
value=env_value,
scope="Environment_Variables"
)
_entry = EnvVarEntry(parent=self, env=[env_name, "value"])
_entry = EnvVarEntry(parent=self, env=[env_name, env_value])
GLib.idle_add(self.group_vars.add, _entry)
self.entry_name.set_text("")

Expand Down
20 changes: 1 addition & 19 deletions com.usebottles.bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ cleanup:
cleanup-commands:
- mkdir -p /app/utils
- mkdir -p /app/share/steam/compatibilitytools.d
- mkdir -p /app/share/vulkan/implicit_layer.d/

modules:
# PYPI modules
Expand Down Expand Up @@ -178,25 +179,6 @@ modules:
# Libraries
# ----------------------------------------------------------------------------

- name: LatencyFleX
buildsystem: simple
build-commands:
- mkdir -p /app/lib/x86_64-linux-gnu/
- mkdir -p /app/share/vulkan/implicit_layer.d/
- cp layer/usr/lib/x86_64-linux-gnu/liblatencyflex_layer.so /app/lib/x86_64-linux-gnu/liblatencyflex_layer.so
- cp layer/usr/share/vulkan/implicit_layer.d/latencyflex.json /app/share/vulkan/implicit_layer.d/latencyflex.json
sources:
- type: archive
url: https://github.com/ishitatsuyuki/LatencyFleX/releases/download/v0.1.1/latencyflex-v0.1.1.tar.xz
sha256: c992ebd2f43c99ab4a84a6ffce692d9aae4cc2571536a5854ae2e79b6951e78a
x-checker-data:
type: json
is-important: true
url: https://api.github.com/repos/ishitatsuyuki/LatencyFleX/releases/latest
version-query: .tag_name
url-query: '"https://github.com/ishitatsuyuki/LatencyFleX/releases/download/"
+ $version + "/latencyflex-" + $version + ".tar.xz"'

- name: ImageMagick
config-opts:
- --disable-static
Expand Down
6 changes: 6 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ sonar.projectName=Bottles
sonar.sources=.
sonar.python.version=3

sonar.issue.ignore.multicriteria=p1

# Resolve: "Cognitive Complexity of functions should not be too high"
sonar.issue.ignore.multicriteria.p1.ruleKey=python:S3776
sonar.issue.ignore.multicriteria.p1.resourceKey=**/*.py

sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-

0 comments on commit 6133d89

Please sign in to comment.