WIP: fix(game): longshot-game's integration tests link on Windows: the version text goes through host-sys like every host call #2844
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2844
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/mod-api-win-version-link"
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?
Summary
For #2822 (into
mod-api). On Windows,cargo test -p longshot-gamestops before its integration tests run:tests/startup_layout.rsdoes not link, withld.lld: error: undefined symbol: hos_version.The cause:
version_text(game/crates/longshot-game/src/host.rs) was the crate's one direct host call. It calledhost_sys::ffi::hos_versionand used a stand-in only undercfg(test). That covers the crate's unit tests, not its integration tests, which build the library as the game does, against host-sys's fake host. There the real call stayed. On Windows the exportedhos_perf_info(perf.rs) returns it, so it stays in the link, and the test program has no host to link against. Every other host call goes through host-sys, whosefakefeature swaps it for a stand-in in any test build.This adds
host_sys::info::version_c, the host's static text, or a static stand-in in the fake host, besideversion(), andversion_textcalls it. The game's own build callshos_versionas before.To see it on
mod-api: on Windows,cargo test -p longshot-game --target x86_64-pc-windows-gnullvm --testswith llvm-mingw.Read first:
version_cingame/crates/host-sys/src/info.rs.Testing
Tested: Windows 11, RTX 5080, NVIDIA 621.40, the game confined through
longshot-builder game, run 80 s with performance statistics on in that runtime only (config/longshot_perf.inisend=1,RX_VK_PERF_INTERVAL=60). Itslongshot_version.txthas noperf_reports=, so the summaries stayed inperf_pending, as the log said. Both summaries say"version": "v3.2.0-152-g27818733b", the host's text throughhos_perf_info→version_text→version_c→hos_version, not the stand-in. The run is onmod-apiwith #2726's save-folder fix and its broker change applied locally, beneath this PR: on plainmod-apia confined Windows start with a profile stops at the save folder. The summaries were deleted after.Checks, on Windows (
--target x86_64-pc-windows-gnullvmwith llvm-mingw):mod-apiis the crate's own integration tests. Onmod-apithey do not link:undefined symbol: hos_version,could not compile longshot-game (test "startup_layout"). Heretests/registry.rs(2) andtests/startup_layout.rs(1) link and pass.cargo test -p host-sys: 24 pass.cargo test -p longshot-game --lib: 165 pass. The three that fail fail the same way onmod-api:mod_tests::…a_folder_of_mods_tests_each_of_its_folders,runtime::…a_mods_profile_sits_inside_the_launchers_save_folderandruntime::…a_separate_mod_moves_the_saves_into_its_profile_and_records_it. They are Windows-only test fixtures with Unix paths, for a PR of their own.cargo fmt --checkandcargo clippy -p host-sys -p longshot-game --all-targets --no-deps -- -D warnings(Windows target) pass, and so doesmise run lint.Still to test:
cargo test -p host-sys -p longshot-game(CI)Measurements
Verdict: fixed.
longshot-game's integration tests link and run on Windows.Baseline:
mod-api(#2822's head), the branch this PR goes into. Nothing to time: the game makes the same host call.c5e5b6765f3c7ea5cargo test -p longshot-game --testson Windowsundefined symbol: hos_version)v3.2.0-152-g27818733b)Risks
The sandbox: not touched. The game makes the same
hos_versioncall, a static string in its own image. The stand-in is behind host-sys'sfakefeature, which only test builds turn on: it is a dev-dependency feature everywhere butmodtool, and the game is built alone (build-compile'scargo build -p longshot-rs, a manifest of the game's crates only), so the fake host never reaches the game.If a build had the fake host, the version would read
0.0.0 (source test), as host-sys's other stand-ins already do. A revert is enough.Checklist
Ready for review
mod-api(#2822's head); the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (The checks this change reaches pass, as above.mod-api's whole suite has failures on Windows that this PR doesn't change: #2825 and #2826 fix eight of them.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (The crate's integration tests, which fail to link onmod-apion Windows.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in the game: Windows 11, RTX 5080, NVIDIA 621.40, confined through
longshot-builder game, 80 s with performance statistics on in that runtime only (noperf_reports=, so nothing was sent). Both performance summaries say"version": "v3.2.0-152-g27818733b": the host's text throughhos_perf_info->version_text->host_sys::info::version_c->hos_version, not the tests' stand-in. Onmod-apiwith #2726's save-folder fix and its broker change applied locally, beneath this PR.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.