fix(build): preserve runtime symbol versions in the Linux renderer check #267
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!267
Loading…
Reference in a new issue
No description provided.
Delete branch "monsterlag/Longshot:fix/elf-symbol-version-metadata"
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
A valid Linux renderer can be rejected as having missing host functions when
nmomits its runtime-symbol version annotations. The guard should distinguish those runtime imports from genuinely unresolved strong host symbols.What changed
nx2/build.py,check_vk_symbols(): prefer GNU/LLVMreadelf --dyn-syms --widemetadata, retaining versions and weak binding; preserve the existing optionalnmfallback when metadata is unavailable or unrecognized.tests/test_vk_symbols.py: 14 game-free cases cover both readers, versioned runtime imports, real missing strong imports, weak/defined symbols and tool failures.Flags and settings
None. Symbol-reader discovery is automatic; no player or build switch changes.
Measurements
main:
9c9d69ed09(2026-11-14)this PR: fix/elf-symbol-version-metadata @
fa257ba303Hardware: Ryzen7 9800X3D, 96GiB RAM, Windows11 build26300 / native Python3.14.7; Ubuntu24.04 under WSL, Python3.12.3, GCC13.3, GNU binutils2.42. No GPU used by these checks.
Scene: authored symbol metadata and tiny ELF libraries; no game scene.
Method: focused warm-up, then two sequential interleaved main/PR runs of the same14 native regression methods. Separately, two interleaved main/PR pairs run the exact AST-extracted production guard against real authored ELF files with actual GNU
nm --without-symbol-versions; a transparent PATH wrapper adds that flag, and recorded output matches direct GNU invocations. Report medians below; no speed improvement claimed.How to reproduce: run
python -I -B tests/test_vk_symbols.py; for main, use its production function with the same new test. Build an authored shared library referencing abort/access/acosf/calloc/free and an optional weak host symbol; a second library addsissue246_missing_host. Verify withRTLD_NOW, then run the guard with GNU version suppression. Main and this PR use the same files/tools.9c9d69edfa257ba3Four self-contained files under docs/tested record the native regression runs. The measured source tree was0c4277d5; the final head adds only these records, with the guard and test unchanged. The reporter now identifies
/usr/bin/nm, OpenSUSE GNU binutils2.47.0.20260921-3, and supplies versionless libm definitions. That supports the omission hypothesis, but is not the failing renderer's undefined-import output. This PR verifies an explicit version-suppression condition; it does not reproduce all288 names or claim issue246 resolved.Testing
Tested: native14-case regression and two fresh interleaved comparisons; real GNU tool/ELF comparisons and independent loader agreement; weak-host preservation and deliberate strong-import rejection; GNU/LLVM metadata-layout and optional-fallback fixtures. Full native Windows
python -I -B tests/run_all.py --jobs 8on0c4277d5: 534 passed, 3 failed, 34 skipped in262s. The same three groups fail on untouched main9c9d69ed in fresh focused checks:test_oot_state_tap.py(Windows bridge connection race, issue481),test_tested_configurations.py(authored stream newline assumption, issue482), andtest_walk_key.py(missing stand-in after the Skip-title merge, already claimed by mooki). No assertion was weakened and no skip was added.The final head
fa257ba3adds only run-record data after that suite; repository-fragment validation passes, production/test files are unchanged, andgit diff --checkpasses. Earlier GNU/LLVM-reader evidence remains historical, not an additional current-head run.Not tested: exact reporter OpenSUSE/AppImage renderer or nm selection, a complete Linux renderer/AppImage build, or gameplay (the guard is build-time only). Actual GNU suppression was tested on Ubuntu/WSL, not the reporter's distro. Where readelf is absent/unusable, nm retains its existing versionless-output limitation.
Needs other testers: the OpenSUSE/AppImage environment from issue246: compare the actual linked renderer on main and this guard, verify the reported failure clears and genuinely unresolved strong imports remain rejected (T-ZPWZ; awaiting a maintainer testing-wanted label before others can claim it). This remains validation of the reported issue; the general guard hardening is covered by the authored regression and real ELF checks above.
Screenshots
Nothing on screen.
Risk and rollback
The risk is interpreting a symbol-reader output format incorrectly. Both GNU and LLVM layouts and failure fallbacks are tested; unrecognized output falls back to nm. Revert this commit to restore the previous reader selection. Runtime version exemptions are unchanged.
Reviewer notes
This hardens a reproduced checker precondition. It does not claim the specific OpenSUSE report fixed; diagnostics were requested on the issue. The earlier published measurement branch is retained; this branch was created from newer main without rewriting that history.
Issues
See #246
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
docs/tested/for each new measured run (format indocs/tested-configurations.md; no appended row or assembled view).Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened. The added symbol-reader regression reads the production function; existing source-reader checks also pass.Opened test request T-ZPWZ for the OpenSUSE/AppImage environment. It is waiting for a maintainer testing-wanted label before testers can claim it. The PR remains WIP: the reporter-specific cause is unconfirmed, and the full-suite run and later focused refresh are separately recorded rather than presented as an all-green current-head run.
Merged main9c9d69ed without rewriting history. Fresh native14-case pairs are8failures on main versus0 here; real GNU --without-symbol-versions pairs reject5 false runtime names on main versus0 here while the missing-strong control remains rejected. Current full suite534pass/3main-baseline-fail/34skip is recorded; final commit only adds validated run files. This completes the general guard-hardening evidence; exact OpenSUSE/AppImage issue246 validation remains explicitly unverified in T-ZPWZ, so this is See246, not a fixed-issue claim.
WIP: fix(build): preserve runtime symbol versions in the Linux renderer checkto fix(build): preserve runtime symbol versions in the Linux renderer checkCode-only review of
fa257ba303; informational findings, with final approval left to another reviewer.No introduced correctness defect found in the symbol-reader change. The readelf path preserves versioned imports, excludes weak and defined symbols, and retains the existing nm fallback and optional-tool policy. The added tests exercise the extracted production function, including rejection of a strong unresolved import when readelf fails; they are behavior checks rather than assertions about source spelling.
The reported native fixtures and real GNU/ELF comparison support the general guard hardening. They do not establish that the exact OpenSUSE/AppImage failure in issue 246 is resolved; T-ZPWZ remains the relevant follow-up. The description already keeps that distinction clear. An unrelated game run is not needed to assess this build-time check.
I read the complete diff, caller, test fixtures and recorded runs, and checked current main plus the open nx2/build.py overlaps. The guard is still absent from main; those overlaps modify other build paths, with no direct duplicate or required merge order identified. No tests, builds or PR code were run for this review.
The Linux renderer check reads dynamic symbols with
readelffirst, so a version such asabort@GLIBC_2.2.5stays on the name, and falls back tonmwhen that output is missing or unusable. I read headfa257ba3. This stays a comment. The description still wants the OpenSUSE/AppImage renderer from issue 246 (T-ZPWZ) before that report is called fixed, so I am not approving it.On a GNU
readelf --dyn-syms --widerow from this machine, the undefined mark is the seventh field and the version stays on the next one (_dl_argv@GLIBC_PRIVATE), with the version index in parentheses after it. That is the layout the new reader uses: undefined, not weak, and@GLIBC,@CXXABI,@GLIBCXXand@GCCstill skipped. A table it does not recognize falls back tonm. No tool at all still passes, as before. The tests run the function cut out ofnx2/build.py, including a strong import that must still fail whenreadelfitself fails.The guard and the test are unchanged since
0c4277d5; the last commit only adds the run records. It still merges onto current main. bibiburl's comment on this head already covers the same reading. T-ZPWZ is still the open check, and the pull request does not claim issue 246 is fixed.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.