Skip to content

fix(linux): the log says why the renderer did not load - #2875

Open
jordanella wants to merge 1 commit into
NotRexed:mainfrom
jordanella:fix/renderer-load-error
Open

jordanella wants to merge 1 commit into
NotRexed:mainfrom
jordanella:fix/renderer-load-error

Conversation

@jordanella

@jordanella jordanella commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

When the Linux renderer fails to load, the log says only (2). That covers a missing file and a hookshot_vk.so from another build alike, though the second is the one that needs explaining: it takes symbols from the executable, so it fails at dlopen, before mkwvk_init's version check, and the game quietly falls back to WebGPU.

Change

  • host/posix/win32_posix.c: LoadLibraryA keeps dlerror()'s text for the last failure, per thread, and hos_load_error() returns it ("" after a success). GetLastError() is still ERROR_FILE_NOT_FOUND, as before.

  • host/rx_backend.c: load_vulkan's failure line prints that text on Linux:

    rx: RX_BACKEND=vulkan, but .../hookshot_vk.so did not load (.../hookshot_vk.so: undefined symbol: mkwvk_...): WebGPU
    

    Windows keeps the error number, which already tells a missing file (126) from a missing function (127).

Part of the dev-loop proposal's B1 (#2636): a renderer swap during development needs this line to say why the new one was refused.

Testing

  • tests/test_renderer_load_error.py (new):

    • everywhere: the source keeps the text and logs it (it fails on main);
    • on Linux: builds win32_posix.c as it is and loads, through LoadLibraryA, a .dll name with no library behind it, a library that needs a symbol nothing has, then a good one.
  • The Linux part, run by hand on WSL Ubuntu (gcc), as the check does it:

    failed|2|<tmp>/absent_vk.so: cannot open shared object file: No such file or directory
    failed|2|<tmp>/needs.so: undefined symbol: mkwvk_from_another_build
    loaded|0|
    
  • Every check that reads the changed files (37), through run_all.py, rebased on today's main, on Windows: 34 pass; nx2/test_bc_storage_views.py, nx2/test_dll.py and nx2/test_leaf.py fail the same way on main here. The new check's Linux part is skipped on Windows.

  • Not run: the game on Linux. The change is the failure path's log line.

See #2636 (B1).

🤖 Generated with Claude Code

hookshot_vk.so is opened with RTLD_NOW and takes symbols from the
executable, so one from another build fails at dlopen, before
mkwvk_init's version check, and the game falls back to WebGPU. The POSIX
LoadLibraryA kept only ERROR_FILE_NOT_FOUND, so the log said "(2)" for
that and for a missing file alike. It keeps dlerror()'s text
(hos_load_error), and load_vulkan prints it:

  rx: RX_BACKEND=vulkan, but .../hookshot_vk.so did not load
  (.../hookshot_vk.so: undefined symbol: mkwvk_...): WebGPU

tests/test_renderer_load_error.py: the source everywhere; on Linux,
the shim as it is loading a missing file, a library needing a missing
symbol and a good one. Part of the dev-loop proposal's B1 (NotRexed#2636).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant