WIP: fix(linux): the log says why the renderer did not load #34
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!34
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:fix/renderer-load-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
When the Linux renderer fails to load, the log says only
(2), for a missing file and alongshot_vk.sofrom another build alike. The second needs explaining: it takes symbols from the executable, so it fails atdlopen, beforemkwvk_init's version check, and the game quietly falls back to WebGPU.What changed
host:
LoadLibraryAinhost/posix/win32_posix.ckeepsdlerror()'s text for the last failure, per thread (load_error, cleared at the start of each call), andhos_load_error()returns it (""after a success).GetLastError()is stillERROR_FILE_NOT_FOUND, as before.host/posix/windows.hdeclareshos_load_error.host:
load_vulkaninhost/rx_backend.cprints that text in its failure line on Linux:Windows keeps the error number, which already tells a missing file (126) from a missing function (127).
tests:
tests/test_renderer_load_error.py(new): everywhere, the source keeps the text and logs it (it fails onmain); on Linux, it buildswin32_posix.cas it is and loads, throughLoadLibraryA, a.dllname with no library behind it, a library that needs a symbol nothing has, then a good one.Flags and settings
None.
Measurements
Nothing to measure in the game: the change is the failure path's log line on Linux. What was run, on the GitHub version (NotRexed/Hookshot#2875):
The new check's Linux part, by hand on WSL Ubuntu (gcc), as the check does it:
Every check that reads the changed files (37), through
run_all.py, rebased on GitHub'smainof that day, on Windows: 34 pass;nx2/test_bc_storage_views.py,nx2/test_dll.pyandnx2/test_leaf.pyfail the same way onmainthere. The new check's Linux part is skipped on Windows.Testing
Tested: the runs under Measurements (on the GitHub version) and the game-free checks this description names. Checked but not measured: the Linux part of the new check, on WSL Ubuntu (gcc).
Not tested: the game on Linux. The loader message runs in the game, and was exercised outside it (WSL) only.
Needs other testers:
Screenshots
Nothing on screen.
Risk and rollback
Only the Linux failure path's log line changes: a successful load and Windows are as before, and
GetLastError()still saysERROR_FILE_NOT_FOUND. The text is cut to 512 bytes in a per-thread buffer. Reverting the commit is enough.Reviewer notes
Carried over from NotRexed/Hookshot#2875 with the move to Longshot: the same change on Longshot's
main, with its rename applied. Its review and discussion are there.A draft: its Linux loader message runs in the game, and was exercised outside it (WSL) only.
The checks were done on the GitHub version; this branch is the same change with the rename applied (the same files and line counts). Forgejo runs no checks; they were not run again here. Only the checks that read the changed files were run, not the whole suite. Part of the dev-loop proposal's B1 (NotRexed/Hookshot#2636): a renderer swap during development needs this line to say why the new one was refused.
Issues
None on Longshot. See NotRexed/Hookshot#2636 (B1).
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.docs/tested-configurations.mdfor each measured run.MKWVK_API_VERSIONbumped (gpu/vk/vk_api.h'sMkwVkHostorMkwVkRendererchanged).mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Back to WIP under #48's process: this was carried over before the new template. Its description will be brought to the template and measured on Longshot (main against this PR, at named commits) when it's wanted for review; ask here if you'd like it sooner.
Description brought to Longshot's PR template (#48). Still WIP: its numbers are from the GitHub version, and it isn't rebased on current main; it gets measured on Longshot (main against this PR, at named commits) before it is marked ready.
Description moved to the template's Testing section and whole checklist (#72): what was tested, what wasn't, and what needs other testers (their test requests to open while this is WIP).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.