DavidoTek/ProtonUp-Qt

DXVK Nightly Listing Test Windows Builds

Closed this issue · 1 comments

Please fill out following when reporting a new bug:

Describe the bug
DXVK's GitHub Actions has two workflows: The Linux builds (artifacts.yml) and the test workflow to build on Windows (test-build-windows.yml).

These runners build against the same commit, resulting in two problems:

  • DXVK Nightly will list the same commit SHA twice, one for each time that commit has had an Action run against it.
  • Only one of these versions is valid (should always be the "first" occurrence, but not guaranteed).

To fix this, we need to check which workflow the build was run against, so as to only pick the one for the Linux builds' artifact.yml. The way DXVK Nightly currently works is that it runs an API request against artifacts, meaning we get all build artifacts from the DXVK GitHub Actions and so from all workflows. This is why we get the Windows builds included.


Fortunately, we've already solved this problem around the codebase! The Proton-tkg Ctmod does exactly this, although it is considerably less elegant than what we currently have for DXVK Nightly:

def __fetch_workflows(self, count=30):
tags = []
for workflow in self.rs.get(f'{self.CT_WORKFLOW_URL}?per_page={str(count)}').json().get("workflows", {}):
if workflow['state'] != "active" or self.PROTON_PACKAGE_NAME not in workflow['path']:
continue
page = 1
while page != -1 and page < 5: # fetch more (up to 5 pages) if first releases all failed
at_least_one_failed = False # ensure the reason that len(tags)=0 is that releases failed
for run in self.rs.get(workflow["url"] + f"/runs?per_page={str(count)}&page={page}").json()["workflow_runs"]:
if run['conclusion'] == "success":
tags.append(str(run['id']))
elif run['conclusion'] == "failure":
at_least_one_failed = True
if len(tags) == 0 and at_least_one_failed:
page += 1
else:
page = -1
return tags

Note that Proton-tkg fetches the workflows and not artifacts, meaning its workflow object is different than what we have for DXVK Nightly. This means we cannot simply check workflow['path'] in DXVK Nightly (I checked 😦).

Proton-tkg can fetch from multiple workflows, and child classes will override PROTON_PACKAGE_NAME to determine which workflow to download build artifacts from. It also has some extra logic to fetch historical artifacts if all builds on the current page failed.

So we can take this logic from Proton-tkg and apply it to DXVK Nightly: Telling it to check for the artifacts.yml workflow name, and only fetch artifacts that are a part of that workflow. This will solve the problem of DXVK Nightly builds listening seemingly duplicate versions, and so will only list valid versions.

We could break out this logic that we have for Proton-tkg into a util function that we can re-use between Proton-tkg and DXVK Nightly (and any future builds we download from GitHub Actions).


I plan to take a look at this in the near future, but opened this issue so I don't lose track of the problem :-)

To Reproduce

  1. Select a Launcher that supports DXVK Nightly (i.e. Lutris).
  2. Click on "Add Version".
  3. Select "DXVK Nightly"
  4. In the versions dropdown, the same commit SHA will be listed twice.
  5. One of these (usually the 2nd occurrence) will be an invalid DXVK version as it is the Windows build and not the Linux build we expect.

Expected behavior
ProtonUp-Qt only lists valid and non-seemingly-duplicate versions of DXVK Nightly.

Screenshots
Image

Desktop (please complete the following information):

  • Platform: Laptop
  • System: Arch Linux
  • Version: 7264188
  • How did you install ProtonUp-Qt?: Git via virtualenv

Additional context
N/A.

Terminal output
N/A.

I am taking a look at solving this now as part of a wider effort to unify DXVK and DXVK Nightly :-)