fix(renhdrum): the release builds renhdrum.dll for Windows, refuses a Linux one, and the game falls back without a Bad Image box #1778
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1778
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/renhdrum-windows-target"
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?
Type: fix · Risk: low · Tested on: none (read only; Linux PC, Windows-only change) · Needs: Windows, any GPU
TL;DR
Since DualSense haptics merged (#405), a Windows build stops at start with a "Bad Image" box naming
renhdrum.dll. The release built that file on its Linux runner without saying "for Windows", so it shipped a Linux library under a Windows name. This PR builds it for Windows, makes the release refuse a library of the wrong kind, and lets the game skip an unusable one with no box. Its controllers then keep their motors. A new game-free test fails on main for this reason.Breakdown
renhdrum.dllas a Linux library, and Windows won't load one (error 0xc000012f).renhdrum.so(already built with--target linux), defaults and saves.renhdrum.dllgives no box, and a good one still loads.LoadLibraryExW.Why
A player's report:
longshot.exe - Bad Image: C:\Recomp Library\longshot\Longshot\bin\renhdrum.dll is either not designed to run on Windows or it contains an error. ... Error status 0xc000012f.0xc000012f isSTATUS_INVALID_IMAGE_NOT_MZ: the file isn't a PE at all..forgejo/workflows/build-windows.ymlrunsscripts/renhdrum.py build --llvm-mingw ...with no--target.cmd_buildfalls back to the system it runs on (a.target or host()), and thereleaserunner is Linux. So it builtx86_64-unknown-linux-gnu, an ELF, and--outnamed itrenhdrum.dll.problems()accepts any x86-64 library, ELF or PE, sobuilder_package.py --renhdrumpackaged it.check_windows_files.pyonly checks that the file is there. A player's build copies it intobin\.host/rumble_renhdrum.cthen loads it with no error mode set, so Windows shows its modal box.How to reproduce
Seen on: Windows, a build from a release made after #405 merged
Settings and switches: defaults
Steps: start the game
Expected: the game starts; a DualSense's haptics come from RenHDrum
Actual: "Bad Image" box for
bin\renhdrum.dll, error 0xc000012f. Deleting that file lets the game start, with motors for vibration.What changed
The release now builds RenHDrum for Windows. Three checks would each have stopped this one: the build, the package step and the zip check. The game also treats an unusable DLL like a missing one.
.forgejo/workflows/build-windows.ymlpasses--target windows.problems(data, target)inscripts/renhdrum.pyrefuses the other system's format ("a Linux (ELF) library, not a Windows DLL").buildpasses its target.checktakes the target from the file's.dll/.soextension.scripts/builder_package.py --renhdrumwants a Windows DLL.scripts/check_windows_files.pywants the zip'stools/third_party/renhdrum/renhdrum.dllto be an x86-64 PE.open_library()inhost/rumble_renhdrum.cloads underSetThreadErrorMode(SEM_FAILCRITICALERRORS)and puts the thread's mode back afterwards. An unusable file is logged (vibration: RenHDrum: renhdrum.dll would not load (error 193)) and its controllers keep their motors.tests/test_renhdrum.pyadds three cases.checkmust refuse an ELF named.dlland a PE named.so.builder_package.package()must refuse an ELF as--renhdrum. The workflow step must pass--target windows. Test and fix are separate commits.Measurements
Verdict: nothing to measure: a build-step and load-error fix. The game-free test is the evidence, and it wasn't run on this PC (see Testing).
Flags and settings
None.
Testing
Tested: nothing run on this PC: no tests and no game runs, by the PC owner's rule. The change was read through against main. The
Buildcases intests/test_renhdrum.pyalready hand a PE to the Windows build and an ELF to the Linux build, so they match the stricterproblems().Not testable by hand: the host change is Windows-only code, and this PC is Linux. A Linux run of the game wouldn't exercise it. Beanstalk's Windows runners stand in.
Not tested:
tests/test_renhdrum.pyon main (expected to fail intest_the_other_systems_format,test_the_package(elf.dll) andtest_the_release_builds_and_packs_it) and on this branch (expected to pass). Forgejo's CI runs the suite. The release workflow itself runs on the next nightly.Must be tested:
bin\renhdrum.dlland start the game. Expect no "Bad Image" box, and the log saysrenhdrum.dll would not load. Then a goodrenhdrum.dllfrom this branch's release build: expectrenhdrum.dll ... loadedin the log (Test Farm: @Beanstalk windows).renhdrum.dllstep logs--target x86_64-pc-windows-gnullvm, andcheck_windows_files.pypasses (by hand: the release run's log).Risks
What could break: a stricter check could refuse a good DLL if
pe_infomisreads one. It already reads the same file today, so the only new refusal is an ELF under.dllor a non-ELF under.so.Turning it off: revert the commit.
Compatibility: the next build replaces the bad
renhdrum.dllinbin\, sincecopy_renhdrumand the finish's staging compare size and bytes. Nothing else changes.Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why. (Windows-only change, Linux PC: Beanstalk asked)
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). (not run on this PC: Forgejo's CI)third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here. (added; not run on this PC)tests/that reads changed source updated in this PR, not weakened.#ifdef _WIN32, andSetThreadErrorModeis in mingw'swindows.h)🤖 Generated with Claude Code
@Beanstalk on Windows (any GPU), with this branch's build: (1) replace bin\renhdrum.dll with a file that is not a Windows DLL (for example renhdrum.so from the Linux AppImage, renamed) and start the game: expect no "Bad Image" box, the game reaching the title screen, and "vibration: RenHDrum: renhdrum.dll would not load" in longshot_log.txt; (2) put back the renhdrum.dll this branch's build placed and start again: expect "renhdrum.dll ... loaded" in the log.
@HumanBean approval of
fc7a072recorded. This diff touches sensitive paths, so a second member ofBigBeansmust approve it too.Beanstalk test farm
Commit
fc7a072· tier untrusted · approved by HumanBean · dashboardThis diff touches sensitive paths, so it needs two members of
BigBeans:.forgejo/workflows/build-windows.ymlA member of
BigBeanscan review this commit and comment@Beanstalkto test it.WIP: fix(renhdrum): the release builds renhdrum.dll for Windows, refuses a Linux one, and the game falls back without a Bad Image boxto fix(renhdrum): the release builds renhdrum.dll for Windows, refuses a Linux one, and the game falls back without a Bad Image boxmooki referenced this pull request2026-11-19 19:52:22 +00:00