fix: mod-api on Windows: every fix its Windows tests turned up, in one pull request #2938
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2938
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/mod-api-testing-fixes"
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). Every fix a Windows test ofmod-apiturned up, in one pull request, as asked: the eleven open pull requests below, rebased ontomod-api@5740a5dfwith their commits as they were reviewed, and the Windows bugs found since. Each commit is one fix or one check, a fix after the test that shows it. They close in favour of this one.Carried over (each pull request's description says how to see its bug on
mod-api):longshot_builder.py build: the release's C++ runtime link-args reach rustc whole (they went in one character at a time)cfg, one new:GAME_BUILDER_E_FAILEDimported on Unix only)main's #2872, now inmod-api, skips the output's own argument, andcompile_link's unchanged rebuild still linked again with it alone)\\?\), the builder's file rules keeping every refusal#2827 and #2847 are not here: #2898 covers them (their closing comments say how).
New (each found by running
mod-api's checks on Windows; how to see it is in its commit):GetFileInformationByHandleEx(FileAttributeTagInfo)), which Windows answers only for a handle withFILE_READ_ATTRIBUTES; a handle that cannot be told is taken as a link. The service opened with the game's own access, so on Windows every file a confined game opened to write only (GENERIC_WRITE) was refused, and every folder it made was made and then reported not made. Wine does not check the right, sofiles_windows' check passed there.open_innow adds the right to the service's own handle; the game's handle carries what it asked and the attributes' read every CreateFileW handle has (the next fix), which the check asserts.FILE_READ_ATTRIBUTESandSYNCHRONIZEbeside what was asked; the service gave the confined game only what it asked. Rust'sstd::fs::metadata(andis_dir,is_file) opens with access 0 and reads the attributes by the handle, so every one of those calls on a file or folder the builder serves failed: the save list found no save, anddev.py smokestayed on the title screen ("skip title: there is no saved game"). The rules decide on what was asked, as before; a STAT already tells the attributes of any path they let the game open, so the handle reads nothing more.longshot_bridge.pyandLongshot.exe mod shotasked the game on Windows to write the path itself (a pipe has no folder to stage beside), which a confined game cannot:dev.py smoke's menu shot failed ("the PNG could not be written"). On Windows a shot to a path is now staged in the game'stemp/as on Linux and moved by the client, read through no link (FILE_FLAG_OPEN_REPARSE_POINTin Rust; in Python the name is no reparse point and the file opened is the one looked at). With no path, the game writes its own default, as before.settleflushed each copied file throughFile::open(...).sync_all(): Windows' FlushFileBuffers refuses a read-only handle, so every copy failed and the saves stayed in the game folder at every start.file_damagedread the zstd magic withread_atand hashed the rest from the file's position: Windows'seek_readmoves it (Unix's pread does not), so every.zsa second extraction checked was counted damaged.nul(orcon,aux,prn,comN,lptNon Windows 10) was a screenshots folder Windows cannot make: it gets_first, as the mods' stores' files do.reference/build.md, Where dev data lives.re.pycloses the index it opened, so Windows can delete or replace it (test_re.pyfailed in its cleanup).-mno-incremental-linker-compatible, as the link already takes/Brepro(compile_link's byte-for-byte check failed whenever two compiles fell in different seconds).dev.py ab's report, and everydev.pytool's, to a pipe or a file is UTF-8 (cp1252 has no Δ: the report raised UnicodeEncodeError), anddev.py migrateleaves no base marked busy (it deleted its marker while it was open, which Windows refuses).main's PRs the re-squash brought in: the host cores check (#2876) stands in forGetActiveProcessorCount, the counthos_coresasks Windows for; the profile symbols check leaves its ELF reader (Linux's) out on Windows, as where its tools are missing.WaitNamedPipeWreturns at once on Windows while there is none);user_of's check takes the game folder asuser_ofdoes (never\\?\); the screenshot check compares the settled path, not its debug text;prepare_only's check names the game program by this system's name; a package's second extraction expects the case pair written again where the file system folds case; the audio output devices' fixture takes the start's settings from the shared stand-in.Read first:
builder/crates/build-core/src/files_windows.rs(open_in, OPEN'sgive_access),scripts/longshot_bridge.py(take_shot,Bridge.request), thenuser_folder.rs(copy_tree),build-driver/src/folder.rs(stat_of,stat_matches),build-driver/src/play.rs(carry_saves),game-files/src/nup.rs(file_damaged),build-compile/src/toolchain.rs(reproducible_object).Testing
Tested: On this PC: Windows 11 Pro (build 26300), RTX 5080 (NVIDIA 621.40), Ryzen 9 9900X3D. Everything built and run without MSVC: Rust 1.99.1 on the
x86_64-pc-windows-gnullvmhost,tools.lock's llvm-mingw for C and C++ and as linker; the builder and the runtime import no MSVC runtime (llvm-objdump -p).sandbox: in the AppContainer),dev.py smoke: PASS (fromkokiri-start: in play, 900 frames, the Insert menu open with its pagesystem/menu, the bridge's shot staged in the game'stemp\and moved to the run folder; no FATAL line, every system mod started;files: 237 served by the builderat the first frame in play). Runtime made bydev.py rtat ee7b1726 with the builder at 545f97c6 (the file service's fixes); the shot's fix is the client's (longshot_bridge.py, at the head). Onmod-apiwithout them the same run stays on the title screen (skip title: there is no saved game), and with the first alone fails its shot (the PNG could not be written). A windowed run of the same runtime with the Insert menu opened over the bridge shows the menu over the game.mise run test'srun_all.py --strict, 12 at once) at13cf57a6(the head but its docs note): 797 passed, 10 failed, 49 skipped. The 10: the nine renderer checks Risks names (they fail onmaintoo) andtest_lifter, whose workspace tests had one intermittentlongshot-gamefailure (Risks; 187 of 187 in 8 runs alone). The skips are the checks whose tools this PC lacks (gcc, Linux-only ones). Rust:cargo fmt --check; clippy-D warningsfor the workspace andmodtool; tests ofbuild-core(148),modtool(221),sites,longshot-game(187), and the workspace's earlier.mise.toml'srusttask's commands andrun_all.py --strictat809cbd68(only environment failures, no glslang, spirv-val, llvm-mc or dav1d, and the nine renderer checks); for the last commits, fmt, clippy and the tests ofmodtool(243) andbuild-core(183),test_longshot_ctl(55),test_pipeline_tour,test_job_queue.build-core'sfiles_windowsandfiles_rulestests (21) andsandbox_windows' with the crate's 148; on Linuxtest_sandbox_windows.py(19 checks: the start decision, the path form, the file service handing no more than the access decided),test_sandbox_linux.py,test_builder_files_linux.py,test_sandbox_profile.py,test_sandbox_save_folders.py,test_pad_appcontainer.py.test_builder_files_wine.pyskipped there (no llvm-mingw in WSL); the samefiles_windowscode's tests run natively here, where Windows checks the access rights Wine does not. The rules' normalizer refuses the plain form of every\\?\path its test refuses (checked once, by hand), so the file layer's taking the prefix off opens no way around a rule.319bdf5e): each test fails before its fix and passes after; with the zero-id entry's hash check taken out, its test fails again. Windows:build-driver(219) andbuild-core'suser_foldertests, fmt and clippy-D warningsfor both crates. Linux:build-driver244 of 244 in three whole runs, fmt and clippy for both crates. Builder code only (an install's note, the user folder's move): not run in the game since.-mno-incremental-linker-compatible, through the queue: the objects the same bytes but the header's 4-byte time (335,411 bytes both ways); one file's compile 301 ms without, 279 ms with. The whole set's times are noise on this PC today (9 to 34 s a round, other builds running, no order by the flag); a quiet PC's numbers: by hand.SeCreateSymbolicLinkPrivilege):test_longshot_ctl.py'sShotStagingrun withos.symlinkrefusing as Windows refuses such an account (WinError 1314): its two session tests pass, the link test is skipped saying why (no symbolic link can be made here: [WinError 1314] ...), its plain take andstaged_atchecks before the skip passing.modtool'swindows_testsnow takes its plain file before the link (e2d9c75a), so such an account runs that half: passing here with links, and with the link refused (a local edit, not committed, making the link fail withERROR_PRIVILEGE_NOT_HELD): the plain file taken, thenskipped: no symbolic link can be made here: A required privilege is not held by the client. (os error 1314). Not run from a real account without the right.mod-apifor the bug's reason and passes here; with the fix's key line taken out, it fails again.Still to test:
@Beanstalk dev.py smoke on Linux, confined: in play from the save, the menu open, its shot taken.@Beanstalk dev.py smoke on Windows with an AMD and an Intel GPU, confined: in play from the save, the menu open, its shot taken.Measurements
Nothing to measure: fixes and checks. The file service's handles gain the attribute read (its own checks, and the game's handle as CreateFileW's has it), and a bridge shot on Windows is moved once by the client; nothing on a path the game runs every frame changes. No switch is added:
LONGSHOT_NO_CLANGin the diff is the tests' own variablemod-apialready has (with no clang, a check that needs one passes over it, asa64's llvm-mc check does), which the object check follows.Risks
The sandbox: as tight as
mod-apihas it, and checked. The file service's own handle can now read attributes, which its checks after every open need; the handle the game is given carries the access the request was allowed (or less, for a folder) and the attributes' read every CreateFileW handle carries, which a STAT already gives of any path the rules let the game open: the rules decide on what was asked, unchanged. The shot change is the clients' (outside the sandbox): the game writes only its owntemp/, which it could already, and the client takes a plain file there through no link, on Windows as on Linux. Every refusal of the service's rules is unchanged; #2838's\\?\paths keep every refusal (files_rules/windows.rschecks it). Nothing here touches the sandbox's plan or its grants. The sandbox ismod-api's only;mainhas none.For players on Windows: an older build's
user\folder beside the game now does move to%APPDATA%\Longshotat the first start, as the move was meant to; a screenshot folder of a mod whose id has a device's name is named with_first; an earlier saves' import with a file where the profile's saves go now fails and says so, and leaves the file. A revert is enough for each. On a drive that gives Windows no file ids (FAT32 or exFAT, some network shares), a game folder's note has none to record, and its entries are compared by size and time alone, asmod-apicompares them now: a different file of the same size and time put in such a game folder could still be kept by a build, or linked into a runtime (a build after it is changed or removed puts it right). Hashing every file at every build there would close it, at a cost each build: not done.Named, not changed here (as
mod-api's rules have them): on a Windows PC with tools.lock's llvm-mingw alone (no gcc), the checks whoseRUN_ALL_ARGSname gcc or g++ are skipped, or fail with--strict, astests/run_all.pysays of a compiler that is not there; about ten checks' own test programs pass a path through the ANSI code page and fail from a temporary folder whose path has a letter outside it (both onmaintoo).modtool'sthe_typescript_system_mods_pass_their_testsfailed once on this PC with two builds beside it and passed alone and in two whole runs (its cost checks read the wall clock on Windows): not changed, watched. Two tests are intermittent on Windows with their crate's other tests beside them, never alone (40 runs each):game-core'sfixes::barrier::tests::an_or_and_its_wake_end_a_wait_on_another_thread(2 of 40: the waiter can see the OR itself beforewake, which then finds no one) andgame-sites'phase::tests::callbacks_run_by_order_then_by_when_added_and_stop_after_removal(1 of 40:on_threadreads the process-wide phase thread, which another test's run of the same phase moves): test races, not changed. One more, seen once in a whole run under load and never alone (187 of 187, 8 runs):longshot-game'ssettings_now::tests::a_new_installs_output_resolution_is_the_size_the_run_started_at, whose new install's size is skipped when the process-wideAT_STARTwas first filled by a test whose settings are the Handheld profile's (set_up_for_a_weak_laptop_is_a_preset_of_the_games,a_preset_chosen_in_the_game_sets_its_rows_and_a_row_changed_makes_it_custom): test order, not changed. And on Linux,build-driver'sdev_runtime::tests::a_copy_links_the_builders_files_clones_the_rest_and_refreshes_in_placefails now and then with the whole crate's tests beside it, onmod-apitoo (3 of 6 runs at5740a5df:game_folder_busy, the runtime's folder lock still held at its next copy), never alone;a_give_back_skips_a_unit_a_running_game_holdsfailed once so: not changed. Nine renderer checks fail on every system onmain@4908cc6dand onmod-apialike (test_blocks_at_start,test_draw_stream_visibility,test_fsr_uniform_ownership,test_image_reaper_threads,test_readback_timeout_reuse,test_recording_admission,test_target_retention,test_tex_desc_memo,test_vram_compact: their cuts ofgpu/vkno longer match it),main's to mend, not this pull request's.Checklist
Ready for review
mod-api; the title is a Conventional Commit. (One topic:mod-api's Windows fixes, in one pull request as asked; onmod-api@5740a5df.)mise run testpasses (any failure that also fails onmod-apiis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mod-apiand passes here (each fix's key line taken out, its test fails).tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
🤖 Generated with Claude Code
host/hos_file_windows.c's whole_utf8 cut and compiled with the PC's C compiler, given each path form: \?\C:\... and \?\UNC\server\share\... must be the builder's, in their plain form, as C:\... and \server\... are; a device's path, a pipe and the console never. It fails on mod-api: the prefixed forms are never the builder's, so in a profile past 260 characters the confined game's Rust read nothing of it ("settings.toml could not be read (Access is denied. (os error 5))", "profile.json is not a list of mods (Access is denied ...)"). Windows only (RUN_ALL_SKIP on Linux). Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>Each failed on Windows (mise run test, llvm-mingw clang, Windows 11) and passed on main at the merge base; each passes here on Windows and on Linux: - audio_output_devices: options_path.h's hos_options_line now asks the game's game_setting_line: a stand-in that reads the test's longshot_options.ini line, as the file did (was: ld.lld undefined symbol game_setting_line); - audio_source_load: romfs_index.c's Windows side includes sandbox_win_plan.h (and sandbox_plan.h): both copied in (was: 'sandbox_win_plan.h' file not found); - present_sites: the fixture's unsetenv, which Windows' C runtime lacks, is _putenv("NAME=") there (was: call to undeclared function 'unsetenv'); - longshot_ctl: ShotStaging skipped on Windows, where a named pipe has no folder and nothing is staged (shot_stage is None there by design), and the session's shot checked without the staged path there (was: KeyError 'game_path', shot_stage None); - menu_hooks: the dlss lock's line compared as text: it is made again at each call, and Windows' heap gives the new one another address than the first (was: "the dlss lock by key is not lock_dlss", same text at two addresses). Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>The watch hands the loader the folders whose served files changed with `/` between their names (watch.rs's slashes); a row's path is the profile's, joined with `\`. A Windows-only test of loader::same_path with both forms, another letter case, and another folder. It fails on mod-api ("the watch's form"): same_path compares the two as text, so on Windows a changed folder matches no mod, and tests::a_content_mods_changed_module_runs_again_and_its_outputs_are_served fails there for the same reason (it passes on Linux). Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>settle copies an older build's `user/` into the new place (%APPDATA%\Longshot) and flushes each file copied with `File::open(to)?.sync_all()`. On Windows that is FlushFileBuffers, which refuses a handle opened only to read (ERROR_ACCESS_DENIED), so every copy counted as failed, the move was called off, and the saves stayed in the game folder at every start ("saves: N entries of ... could not go to ..."). The copy is now opened to write on Windows before the flush (Linux's open is the same as before: fsync takes a read-only descriptor, and a file copied read-only still opens). user_folder's an_older_build_s_user_folder_is_moved_whole and a_move_cut_at_any_step_leaves_every_save_in_the_place_the_next_start_uses failed on Windows for this reason and pass with it; every refusal settle has (a link, a journal not finished, a clash) is unchanged. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>services::gfx::tests::a_screenshot_goes_to_the_mods_folder_and_settles_with_its_path looked for the file's path in `format!("{got:?}")`. On Windows the path holds `\`, which the settled JSON escapes and the debug text escapes again (`\\`), so the plain path was never found and the check failed though the screenshots settled with the right path. It now compares each settled value with the path as JSON. It also checks all four, where it checked the first's kind. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>gfx.screenshot keeps a mod's shots in folders named by its id's parts (`<user>/screenshots/<publisher>/<name>/`). An id's part may be `nul`, `con`, `aux`, `prn`, `com1`-`com9` or `lpt1`-`lpt9` (lower-case letters and digits), and on Windows a folder of that name opens the device: on Windows 11, making `screenshots\nul` fails ("the system cannot find the path specified"; `con`, `aux` and the rest are made there but not on Windows 10), so every screenshot of such a mod settled null. The mods' stores already give such a name `_` first (storage::file_name). The check fails here, for that reason, and passes with the next commit. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>_first be09e6647dre.py's run opened the index (Index, a read-only SQLite connection) for every query and for `index`'s counts and never closed it. The connection's own statement cache keeps it alive past the last reference until a garbage collection, so the file stayed open after the command returned. Linux deletes or replaces an open file; Windows does neither: tests/test_re.py's Index class failed on Windows in its tearDownClass ("[WinError 32] The process cannot access the file because it is being used by another process: ...\index.sqlite"), after test_the_commands_print_json ran the `fn` command in the test's own process. run now closes the index it opened before printing, in both places. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>- test_dev_build: game_roots() joins ~ and Games with the system's separator, the check expected `~/Games`; and test_a_job_above_with_no_marker_left reads the processes above it, which are the PC's own, not the Linux the class plays (it found no /proc on Windows): common.WINDOWS is the real system's there. - test_dev_update: a dump's folder is dirname(normpath(exefs)), `\d` on Windows: the check expects normpath("/d"). - test_dev_disk: the older dev.py's stores outside the development folder are under %LOCALAPPDATA%\Longshot on Windows, $XDG_CACHE_HOME on Linux; the check planted only Linux's, and left the PC's own LOCALAPPDATA read. It now has a LOCALAPPDATA of its own and plants the old store where this system's dev.py looks. Every assertion is unchanged. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>test_arguments_arrive_unchanged runs `mise run build` in a scratch project whose mise.toml had no tools, so the task's python3 was the PATH's: on Windows that can be the Microsoft Store's alias, which is no Python ("Python was not found"). The scratch mise.toml now pins the repository's own Python, read from its mise.toml, as the real task has it. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>link::tests::the_output_is_not_an_input_whatever_its_path_holds: a link whose output exists (the last link's) and an ordering file inside an option; the inputs must be the ordering file alone. It fails on mod-api on Windows: link_inputs looks for a file after an argument's first ':' or '=', and a whole path's drive (C:/w/x.exe) gives /w/x.exe, the output itself under another name, which then is in the link's key and changes it at each link. tests/compile_link.rs's program is prog.exe on Windows, the file the link writes (it linked prog, and link::run looked for prog): an_unchanged_rebuild_compiles_nothing_and_a_change_compiles_what_it_touches then fails on Windows for the same reason ("and links nothing"). Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>Windows' CreateFileW gives every handle FILE_READ_ATTRIBUTES (and SYNCHRONIZE) beside what was asked. Rust's std::fs::metadata, is_dir and is_file open with access 0 and read the attributes by the handle. The file service gives the confined game only SYNCHRONIZE and the access it asked, so each of those calls on a file or folder the builder serves fails with ERROR_ACCESS_DENIED: the save list's search (save_start::newest_save) finds no folder, and `dev.py smoke` stays on the title screen with "skip title: there is no saved game". Fails here: "game: Err(Os { code: 5, kind: PermissionDenied, message: "Access is denied." })". Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>On Windows the clients (longshot_bridge.py, Longshot.exe mod shot) asked the game to write a shot's path itself, a pipe having no folder to stage beside; a confined game writes no path the client names, so every shot to a path failed ("the PNG could not be written"), dev.py smoke's menu shot among them. A shot to a path is now staged in the game's temp/ on Windows as on Linux and moved by the client. The take reads through no link on Windows too: Rust opens the link itself (FILE_FLAG_OPEN_REPARSE_POINT), whose metadata is no plain file; Python checks the name is no reparse point and the file opened is the one it looked at. With no path, the game writes its own default, as before. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: Windows 11 Pro (26300), RTX 5080 (NVIDIA 621.40): dev.py smoke PASS, confined in the AppContainer, from kokiri-start: in play, 900 frames, the Insert menu open with its page (system/menu), the bridge's shot staged in the game's temp\ and moved; no FATAL, every system mod started. Without these fixes the same run stayed on the title screen (skip title: there is no saved game), then failed its shot. A windowed run showed the Insert menu over the game.
Possibly related, for context:
WIP: fix: mod-api on Windows: every fix its Windows tests turned up, in one pull requestto fix: mod-api on Windows: every fix its Windows tests turned up, in one pull requestRecommendation: Request changes. Existing Windows installation notes continue to accept a replaced base file, so a runtime can still receive the wrong file. The user-folder migration also still fails when an older folder contains a read-only file.
The pull request fixes several Windows sandbox, build, mod and screenshot failures, with a reported confined game run on NVIDIA hardware. It also adds file-identity checks and changes compiler flags, but the identity check does not protect existing notes and the migration does not handle read-only files.
Blocking (1): must change before merging.
builder/crates/build-driver/src/folder.rs:154: A note with file ID zero continues to match solely by size and time, and kept entries are never upgraded to a file ID. (more on the line) Do: Validate old zero-ID entries against their recorded hash before trusting them, then write their current file IDs into the note, including entries kept without staging.Should fix (1): not blocking, but worth doing before merging.
builder/crates/build-core/src/user_folder.rs:252: The copied file retains its read-only attribute, so reopening it with write access to flush it fails on Windows. (more on the line) Do: Copy through a writable handle and flush before restoring the source permissions, or otherwise make the staged copy writable for the flush and restore its attribute afterward.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
scripts/longshot_bridge.py:251: The changed screenshot client has not been exercised in a confined Linux game run. (more on the line) Do: Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.builder/crates/build-compile/src/toolchain.rs:291: The Windows compiler flag change has no reported clean or incremental build-time comparison. (more on the line) Do: Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.@fixcan do L1 and L2.Questions (1) (not confirmed from the code; they don't hold the recommendation)
More: does it help, other systems, switches, what was read
Does it help: Yes for the tested sandbox and screenshot failures: the author reports a confined Windows run reaching play and taking a staged screenshot, where the base stayed at the title screen and then failed the screenshot. The other fixes are supported by reported game-free checks; clean and incremental build-time effects of the compiler flag change are not reported.
Other systems: The screenshot clients also changed on Linux; a confined Linux game run remains outstanding. Windows AMD and Intel runs and a Windows account without symbolic-link privileges are also outstanding. The file-identity change affects existing Windows game-folder notes and runtime hard links.
Switches: No production switch added or changed. LONGSHOT_NO_CLANG is an existing test variable.
Reviewed:
5b5e238efaagainst5740a5dff9: Read repository instructions, CONTRIBUTING.md, standards and the pull request template; inspected the diff for the sandbox, migration, file identity, screenshot, loader and menu changes and their relevant surrounding code. The full 79-file change, translations, generated-file claims and all changed tests were not read in full; the combined diff and commit-log output were truncated.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no build, test, script or game run was executed.
Overlaps and merge order: The description identifies eleven carried-over pull requests that are to close in favor of this one; their current Forgejo state could not be checked offline.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as llun took it out of WIP. Nothing was run; a maintainer decides.
@ -287,2 +288,4 @@};let mut target = native_target.clone();if mingw.is_some() {target.push(reproducible_object());L4 (should fix): The Windows compiler flag change has no reported clean or incremental build-time comparison.
When: Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown.
Do: Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.
@ -250,1 +250,3 @@return copied && std::fs::File::open(to).and_then(|f| f.sync_all()).is_ok();// (Windows flushes a file only through a handle that may write it: FlushFileBuffers)let flushed = || std::fs::OpenOptions::new().read(true).write(cfg!(windows)).open(to)?.sync_all();return copied && flushed().is_ok();L2 (should fix): The copied file retains its read-only attribute, so reopening it with write access to flush it fails on Windows.
When: If an older user folder contains a read-only save or other file, copy succeeds but the write-enabled open fails; settle keeps the old folder and retries the migration on later starts.
Do: Copy through a writable handle and flush before restoring the source permissions, or otherwise make the staged copy writable for the flush and restore its attribute afterward.
@ -145,0 +151,4 @@/// game folder copies its files again for it.pub(crate) fn stat_matches(noted: (u64, u128, u64), now: Option<(u64, u128, u64)>) -> bool {now.is_some_and(|n| n.0 == noted.0 && n.1 == noted.1 && (noted.2 == 0 || n.2 == noted.2))}L1 (blocking): A note with file ID zero continues to match solely by size and time, and kept entries are never upgraded to a file ID.
When: On Windows, a base created before this change has an ID of zero in its note. If one of its files is replaced by a different file with the same size and timestamp, install accepts that note and hard-links the replacement into a new runtime; subsequent unchanged installs retain the zero-ID note.
Do: Validate old zero-ID entries against their recorded hash before trusting them, then write their current file IDs into the note, including entries kept without staging.
@ -238,2 +249,3 @@# and moved here to the path asked, or shots/ beside the socket, by the client, which may write it)# and moved here to the path asked, or shots/ beside the socket, by the client, which may write it; on Windows,# a pipe with no folder, a shot to a path)stage = want = NoneL3 (should fix): The changed screenshot client has not been exercised in a confined Linux game run.
When: A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path.
Do: Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.
Thanks. Answered at
319bdf5e:folder.rs): fixed, test first (8c97104e, then319bdf5e). A note entry with id 0 is now taken only when the file's bytes are its SHA-256 too, read once (still_noted, everywhere a note's stat is trusted:owned, an install's kept check, the base's link check,dev_runtime's base check), and the install that keeps it writes the file's id into the note. The test swaps a file for another of the same size and time under an id-0 note: not the builder's, not linked into a runtime, copied over; every entry has its id after. With the hash check taken out it fails again. A note with ids is compared as before.user_folder.rs): fixed, test first (a5e90860, then67afe81d). A read-only copy is made writable for its flush, then read-only again; the test's read-only save moves and stays read-only. Before, the move was kept back as you said: "saves: 3 entries of ... could not go to ...".@Beanstalk dev.py smoke on Linux, confined); there's no Linux PC here.On the related pull requests: #2726's
files_windowsfix (the broker opening withFILE_READ_ATTRIBUTES, and the game's handle having it) is the same as this one's two, found separately; the rest of #2726 and #2747 is inmod-apinow through #2898 (the test mode's folder in the plan, its results folder, the save folder from the builder's hello). Both are onmod-apifrom before its re-squash.Also new in the description: on Linux,
dev_runtime's copy test fails now and then with the whole crate beside it, onmod-apitoo (game_folder_busy): not this change's, named under Risks.Beanstalk test farm
Commit
e2d9c75· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.@review
Recommendation: Approve. The code is ready: only testing is left. The two code fixes address the reported cases. A confined Linux screenshot run and a clean Windows build-time comparison remain outstanding. Recommend approval; not approved on the forge.
The pull request fixes Windows build, sandbox, save migration, mod and screenshot problems. The review fixes validate older file notes before trusting them and allow read-only files to be copied during migration, at the cost of hashing older noted files once.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
scripts/longshot_bridge.py:251: The changed screenshot client has not been exercised in a confined Linux game run. When: A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path. Do: Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.builder/crates/build-compile/src/toolchain.rs:291: The Windows compiler flag change has no reported clean or incremental build-time comparison. When: Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown. Do: Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.Since the last review (on
5b5e238efa)Resolved: L1 (A note with file ID zero continues to match solely by size and time, and kept entries are…); L2 (The copied file retains its read-only attribute, so reopening it with write access to flus…)
Still open: L3 (The changed screenshot client has not been exercised in a confined Linux game run.); L4 (The Windows compiler flag change has no reported clean or incremental build-time compariso…)
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes for the reported Windows failures: the author reports a confined game smoke run passing after the sandbox and screenshot fixes, where it previously stopped at the title screen or failed its screenshot. The compiler flag's build-time effect remains unmeasured on a quiet PC.
Other systems: The screenshot client also changes Linux behavior; a confined Linux game run remains outstanding. The reported Windows game run used NVIDIA; AMD and Intel runs are listed as outstanding. The note and migration fixes have reported Windows and Linux crate tests.
Switches: No switches added, changed or removed. LONGSHOT_NO_CLANG is an existing test variable.
Reviewed:
319bdf5e0bagainst5740a5dff9: Read AGENTS.md, CONTRIBUTING.md, the changes since the ledger and user_folder.rs; inspected the affected note callers and portions of folder.rs, dev_runtime.rs, toolchain.rs and longshot_bridge.py. The full pull request diff and remaining changed files were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports Windows build-driver and user-folder tests, Linux build-driver tests, and a Windows confined game smoke run; the Linux confined screenshot run and quiet build-time comparison remain outstanding.
Overlaps and merge order: The description identifies eleven carried-over pull requests to close in favor of this one; the author says the file-service fixes overlap #2726, with the remainder of #2726 and #2747 already in mod-api through #2898.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
On the two things the re-review noticed:
mod-apicompares them now. No change frommod-apithere, and nothing new broken. It matters only if a different file of the same size and time is put in such a game folder; a build after it changes or removes it puts it right. Hashing every file at every build on those drives would close it, at a cost each build, so it is named under Risks and not done.user_folder'san_older_folder_s_read_only_file_moves_with_itchecks the old folder's saves are gone after the move (whole_in), and it passes on Windows: Rust'sremove_dir_alldeletes a read-only file there. Not checked on a FAT32 or exFAT drive; there, at worst, a copy would stay in the old place, the saves already in the new one and used from it.Tested: a Windows account that may not make symbolic links (it was under Still to test).
This PC's account makes links only through Developer Mode (it has no
SeCreateSymbolicLinkPrivilege), so each link step was made to fail as Windows fails it for an account without the right,ERROR_PRIVILEGE_NOT_HELD(1314):test_longshot_ctl.py'sShotStaging, withos.symlinkraisingWinError 1314: the two session tests pass; the link test is skipped saying why (no symbolic link can be made here: [WinError 1314] A required privilege is not held by the client), its plain take andstaged_atchecks before the skip passing.modtool'swindows_tests::a_staged_link_is_not_taken, with the link's creation returning error 1314 (a local edit, not committed): the plain file is taken, thenskipped: no symbolic link can be made here: A required privilege is not held by the client. (os error 1314). Beforee2d9c75athis test returned at the link before its plain file, so such an account ran neither half; it now takes the plain file first.Not run from a real account without the right; the description's Testing says so.
@review
@review
Recommendation: Approve. The code is ready: only testing is left. The Windows fixes have reported game and game-free coverage, but the changed screenshot client still needs a confined Linux game run, and the compiler flag still needs a clean build-time comparison. Recommend approval; not approved on the forge.
The pull request fixes Windows installation, sandbox, mod, screenshot and menu problems. The latest change lets the Windows screenshot test exercise a plain file even when the account cannot create symbolic links.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
scripts/longshot_bridge.py:251: The changed screenshot client has not been exercised in a confined Linux game run. When: A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path. Do: Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.builder/crates/build-compile/src/toolchain.rs:291: The Windows compiler flag change has no reported clean or incremental build-time comparison. When: Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown. Do: Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.Since the last review (on
319bdf5e0b)Still open: L3 (The changed screenshot client has not been exercised in a confined Linux game run.); L4 (The Windows compiler flag change has no reported clean or incremental build-time compariso…)
More: does it help, other systems, switches, what was read
Does it help: Yes for the reported Windows smoke case: the confined run reached play and saved a staged screenshot, whereas the base stayed on the title screen or failed the shot. The compiler flag's build-time effect remains unproven; reported whole-set timings were noisy.
Other systems: The screenshot client also runs on Linux; its confined game path has not yet been exercised. Windows game coverage was reported on NVIDIA, with AMD and Intel runs requested. The compiler flag applies to llvm-mingw builds.
Switches: No switch added or changed; LONGSHOT_NO_CLANG is an existing test variable.
Reviewed:
e2d9c75a20against5740a5dff9: Read the change since the ledger, the surrounding Windows test and screenshot-taking code, and the relevant bridge and compiler-flag sections. Read AGENTS.md, CONTRIBUTING.md and the pull request template; the review checklist was absent. Skimmed the overall diff stat and reported runs; the other changed files were not read in full during this re-check.; nothing run (a code review).Checked and fine:
Testing: No commands that build, execute project code or run tests were run. The author reports Windows smoke and game-free checks; the confined Linux smoke and quiet Windows build-time comparison remain outstanding.
Overlaps and merge order: The description says the carried pull requests close in favour of this one; #2726 overlaps the Windows file-service fixes, and #2898 covers the excluded fixes.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.