fix: security hardening passes (update offer, builder and release downloads, setup lists, shared env file, files the game reads and writes, game folders from elsewhere, HLE guest ranges) #2430
Open
Joey-Magnus wants to merge 39 commits from
Joey-Magnus/security/hardening-passes into main
pull from: Joey-Magnus/security/hardening-passes
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2430
Loading…
Reference in a new issue
No description provided.
Delete branch "Joey-Magnus/security/hardening-passes"
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?
Takes over #2326 from @hckrman101, who asked for someone to pick it up. His 34 commits are unchanged; this adds a merge with main and three fixes on top. His description follows below the line.
Added in the takeover
CI fix:
tests/test_oot_menu_mouse.py(Windows only) failed to build because its stand-inhos.hhad nohos_guest_range, whichhost/oot_menu.cnow calls. The stand-in now has it.Merge with main (
5cbfead0). Ten files conflicted. The two that needed a decision:host/hos_update.c: since #2283, "Skip this version" is kept with the saves (hos_user_dir), not in<game>/user/.write_skipnow writes there and still never through a link at the file's name. The saves folder itself may be a link, because a player can keep it elsewhere.tests/test_update_skip_file.pycovers that case now.host/hos_main.c: main made the environment go overhookshot_env.txt. A name is now noted for the builder's start only when the file actually set it. Otherwise a switch the player set in their own environment would be taken from the builder.Main's new writes go through
hos_fopen_write: the driver faults note, and the predicted pipelines' marker and sample ingpu/vk/vk_draw.cpp.tests/test_game_writes_no_links.pyfound them.HOS_CONTROLandHOS_CONTROL_MEMare refused in a sharedhookshot_env.txt. The control bridge (#926) landed after this PR started. Its socket name passed the file's no-path rule as a bare name, andHOS_CONTROL_MEM=rwopens guest memory writes.tests/test_env_file.pyfound it.Test fixtures that compile code from both sides now get
hos_fopen_write.h,hookshot_env.handhos_env_file_names.test_env_file.pyalso findsHOOKSHOT_names read withenv_on.Second merge with main (
45f19993). Eight files conflicted; both sides are kept in each, and the merge commit lists them. The ones that needed a decision:host/hos_main.c: main's #2282 already makes the saves' links again by their full path, so itssaves_dirreplaces this PR's own link handling there.copy_treeno longer fails on a link inside a folder (main makes it again), and still copies files through the no-link, no-FIFO helpers.host/hos_update.c: main'sbuilder_local(#2367, the portable game'shookshot.exe) is taken as main takes it. Otherwisebuilder=still has to passbuilder_ok.gpu/vk/vk_draw.cpp: main now reads a pipeline cache's header before its size. That order is kept, with thekPcacheMaxlimit andhos_fopen_read_binaryon top.nx2/nup.py: main's newis_linktakeslinks_only, so a game folder OneDrive keeps still counts only real links.Main's new checks that cut code this PR changed get its helpers (
9f329311)..hookshot_builder_home, which the builder writes since #2367, is on the list of names a link at stops the build.Windows "Skip this version" takes a junctioned
userfolder (70b495de), as hckrman101 asked.The readme says that the game does not write through a link at
hookshot_options.ini,mouse_sens.txtor a pipeline cache, and to link the folder instead (1751ff48).Tested (takeover)
Second merge (
9f329311), Linux:python -I -B tests/run_all.py --jobs 4: 474 passed, 2 failed, 36 skipped. The two failures (test_lift_cache.py, andtest_updater_asset_digest.py, whose .NET restore finds no packages offline) fail on main on this PC too. With llvm-mingw 20261104, the changed host files (hos_update.c,hos_main.c,hos_svc.c, thenn_*.cfiles,nvn_native.c,oot_menu.c,prompts.c,discord_rpc.c) andbuilder/setup/setup.ccompile for Windows with no errors,hos_update.cwith no warnings under-Wall -Wextra.vk_draw.cpp,vk_main.cppandvk_menu.cpppass a syntax check for both Windows and Linux. Nothing was run on Windows.First merge:
Linux:
python -I -B tests/run_all.py: 367 passed, 0 failed, 53 skipped. The skips are Vulkan/SPIR-V headers, dotnet and Windows-only tests, which are not installed here.host/hos_update.cpasses a gcc-Wall -Wextrasyntax check.Not tested (takeover)
test_oot_menu_mouse.pywas not run: there is no MinGW here. A clang syntax check ofoot_menu.cagainst the new stand-in no longer reports thehos_guest_rangeerrors.Supersedes #2326.
Some files that players run, download or pass around are still trusted more than they should be. A game folder's text file can pick the program the update offer starts. A shared
hookshot_env.txtcan still set switches that write files or change how an update builds. A game folder unpacked from an archive can hold links that the game or the builder writes through. This PR closes those gaps and adds tests so they stay closed. None of it changes what a normal player sees.What changes
Update offer and builders
Update offer (host/hos_update.c). The update offer now uses
builder=/builder_args=fromhookshot_version.txtonly when they look like what our builders write:HookshotBuilder.exe, or topython(w).exewith-I <path>\hookshot_builder_start.py;AppRun.Anything else counts as "no builder", and the offer opens the download page instead. Only the shape of the path is checked, not where it is, so a builder unpacked anywhere still works.
"Skip this version" no longer writes through a skip file that is a link. The folder that holds it may be a link or a junction, since that is how a player keeps the saves on another drive. On Linux it uses lstat and O_NOFOLLOW. On Windows it refuses a symbolic link or junction at the file's name but still allows OneDrive's own reparse points.
The builder an update starts no longer gets the switches that the game's
hookshot_env.txtset. It inherits the rest of the game's environment, but the builder reads some of the same names for its build (RX_MARCH,RX_VK_ONLYand others). On Linux the builder is started withexecveand an environment built before the fork. On Windows those switches are cleared beforeShellExecuteW, and put back if the builder does not start.One tag rule for every builder. A tag may use
[0-9A-Za-z._+-], be at most 128 characters, and not be.or... The WPF, Python and Linux builders apply it to--tagand to every tag they read from GitHub. Before, the WPF builder's nightly lookup passed the list's tag line, unchecked, into a release API link. The WPF builder's patterns end in\z, because .NET's$also matches before a final line break.Windows Python builder downloads (setup_parts.py, updater.py).
Setup lists' parts (builder/setup/setup.c, setup_parts.py, builder/linux/linux_update.py). A part's link must now be under this project's GitHub releases, or llvm-mingw's for the Windows lists (the one part that is not ours). The rest of the link must have no
..step, escape, query or other host. Before, the checksums pinned each part's bytes, but a link could name any https host. A list given for testing (HOOKSHOT_SETUP_LIST) and the Linux updater's lists from this PC still take any https (or file) link.WPF builder downloads (Updater.cs). A download now stops as soon as it passes GitHub's size for the file. Before, a body with no Content-Length was written to disk in full and only then compared.
Shared
hookshot_env.txt(host/hos_main.c)_DUMPin its name is now refused as a group.RX_SCREENSHOT,RX_FLASH_LOG,HOS_SCAN_DTandRX_VK_FRAME_TRACEare refused by name.*_SAVE_FRAMESswitches (a picture each frame) and thediskaudio driver. OtherSDL_switches still work.HOOKSHOT_names: only the game's own are taken:HOOKSHOT_NO_UPDATE_CHECK,HOOKSHOT_NO_AV1_NOTICEandHOOKSHOT_OCCLUSION_OFF. The rest are the builder's.RX_VK_DLSS_DIRis still the one path the file may set, but only as a full local path (C:\...or/...) with no..step. Before, a relative value was resolved against whatever folder the game was started from.tests/test_env_file.pyscanshost/andgpu/for switches whose value is used as a path, and the builder's sources forHOOKSHOT_names. It fails if the shared file could set one of them. The readme says the same.HOS_ENV_FILEstill set anything.Files the game writes, and game folders from elsewhere
Files the game writes by itself (new host/hos_fopen_write.h). This covers
hookshot_options.ini, the pipeline caches, the state lists and their markers, the button-prompt textures,mouse_sens.txt,language.txtand the moved-saves note. A game folder unpacked from an archive can hold links, and before, the game wrote through a link at one of these names, emptying the file it pointed to.Files the game reads from its folder at start-up. These are now read only when they are regular files. Before, a FIFO under one of their names (an archive can carry one) made the game wait forever before its window opened. The files covered:
hookshot_env.txt,hookshot_options.ini,language.txtandmouse_sens.txt, through the newhos_fopen_read;hos_fopen_read_binary;This applies on Linux. On Windows the read is plain
fopen.Mouse sensitivity (host/nn_hid.c). A value from
mouse_sens.txtorHOS_MOUSE_SENSis taken only when it is a finite number, and it is kept to the menu's 10-500%. Before, a value likeinfwent into the menu's option as an undefined number.Saves moved from an old
user/folder (Linux). The game movesuser/into$XDG_DATA_HOME/hookshotand copies an entry when it cannot rename it. Since main's #2282, every link inuser/is made again in the new place by the full path it names, and the clean-up removes a link without going into it. This PR adds that the copy reads and writes files throughhos_fopen_read_binary/hos_fopen_write, so a FIFO fails the copy (the saves stay inuser/) and nothing is written through a link.Rebuilding or updating an existing game folder (nx2/make_game.py, nx2/nup.py).
.hookshot_romfs_headshas to name a.zsfile inside the romfs, under the same path rule the extraction uses. If any line does not, the list is dropped and every file is checked instead.<name>.part..hookshot_exefs, or inside the romfs the build hard-links into, stops the build and asks for an empty folder. On Windows only symbolic links, junctions and WSL links count, so a folder under OneDrive still updates.language.txt,hookshot_version.txt,bin,prompts, the staged.newfiles and so on) stops the build before anything is written. Links at other names, such as a cache moved to another drive, are left alone. A test checks that every name the builder writes is on the list.Pipeline cache (gpu/vk/vk_draw.cpp).
mkw_vk_pipelines.binand the play caches are now checked by their header before the rest is read, and a file over 4 GB is not read. Before, the whole file was loaded into memory first.Button-prompt files (host/prompts.c). A file is read only when its magic is right, and never past 256 MB. Before, the whole file was loaded into memory first.
Pipeline notes and state lists (gpu/vk/vk_draw.cpp). A record is used only with a sample count the GPU supports, vertex strides up to 2048 (Vulkan's least limit) and divisors up to 65535. Before, any power of two up to 64 and any stride or divisor were handed to the driver.
Contributed pipeline state lists (nx2/pipeline_states.py).
add,tourandcheck(which CI runs) now stop on a record with a value no pipeline has: a count past its array, a sample count or topology Vulkan does not have, a yes/no value other than 0 or 1, non-zero padding, or a stride or divisor past those limits. They name the record and the reason.A refused write is logged. The first time a file stops at a link or a non-file in
hos_fopen_write, it writesfiles: <path> is a link or not a plain file: the game does not write through itto the game's log. That gives a setting that does not stick a visible reason.Host functions the game calls (HLE)
GP()turns a guest address into a host pointer without checking it. Before, a size the game passed could carry a copy past the guest window into the host's own memory. These functions now usehos_guest_rangeon the whole span, as nn::fs and the libc copy hooks already do:hos_main.candoot_menu.c.nvnDeviceGetProcAddressandnvnBootstrapLoadernow copy the name the game passes, at most 255 characters and only from inside guest memory. Before, they read it in place to its end.Release and CI
--require-hashes, from a newrequirements-lock.txt.python -I scripts/python_lock.pywrites it after a pin changes.tests/test_python_lock.pyfails when the lock and the pins differ.<name>.part. Each file is hashed while it downloads, and a download stops past 1 GB. The pinned commits and SHA-256s are unchanged..zsyncinto thercrelease only when GitHub gives a SHA-256 digest for each file. This is checked before the tag moves or anything uploads. Before, a file without a digest was copied unchecked.requirements.txt,nx2/prompt_requirements.txt) weekly, with the same 7-day cooldown as the actions. After it changes a pin,scripts/python_lock.pymust write the lock again;tests/test_python_lock.pyfails until it does. The builder's .NET project has no NuGet packages, so there is no NuGet entry.fetchwith SHA-256 pins, like every other download there.persist-credentials: false(except the release record job's);${{ }}of event data or inputs inside arun:script;pull_request_targetworkflow.Tested
Linux, RTX 3090. The branch merges main@origin
ebbba2ea, which carriesscripts/release_rc.shand the setup-list code changed here; the merge had no conflicts. Testing used merges with main as it moved (e19d9693,d7a73062,ebbba2ea,49f75dc8), all without conflicts. The link and env game runs used thee19d9693merge, the FIFO run and the last game build thed7a73062merge, and the last full suite the49f75dc8merge.python -I -B tests/run_all.py). 373 passed, 1 failed, 12 skipped. The failure,tests/test_wayland_libdecor_hint.py, also fails on main on this PC.--require-hashesfor Linux x86_64 / Python 3.12 (with dependencies) and for Windows x64 / Python 3.12, 3.13 and 3.14 (as the Windows part installs them): 10 of 10 each time.host/hos_update.ccompiles with no warnings (-Wall -Wextra) under gcc (Linux) and llvm-mingw clang (Windows).hookshot_vk.dll) cross-built with llvm-mingw before the last round. After it,vk_draw.cppandvk_main.cpppass a syntax check for both Linux and Windows.host/nvn_native.c,builder/setup/setup.cand the host files that includehos_fopen_write.hpass one for both too.language.txtlink planted in the folder, the build stopped at the start and named it, and the link's target was left as it was.HOS_HEADLESS=1 HOS_NO_SDL=1, separate data folder, links planted in the game folder; final run on the branch head):hookshot_options.inior at the pipeline marker;user/was moved to the saves folder, and itsuser/savelink was moved as a link with its target left alone;RX_VK_DLSS_DIRwas left out ofhookshot_env.txt;RX_VK_FRAME_TRACE,HOOKSHOT_MEM_LIMIT_GB,HOOKSHOT_JOBSandHOOKSHOT_PREPARE_ONLYwere left out, and nosdlaudio.raworhookshot_frames.csvappeared;language.txt,hookshot_env.txtandhookshot_options.ini. On a build that had moved only the host's reads, the game hung after listing the GPUs, on the renderer's own read ofhookshot_options.ini. With every start-up read moved over, it started and ran as usual and never waited on the FIFOs.tests/test_updater_asset_digest.pybuilds the wholeUpdater.cswith its fixture: 22 of 22 cases pass. Its two new cases fail on the code before the fix.tests/test_builder_dlss_update.pypasses (57 checks).EnableWindowsTargeting=true, with no warnings.Not tested
hos_fopen_write, which was only tested with a stand-inwindows.h. The Windows host files were only syntax-checked.Thanks for picking this up from #2326 and for the clear takeover notes. I went through the update offer, the builders' download and list checks, the env file rules,
hos_fopen_write/hos_fopen_read, the saves move, the builder's folder-link checks and the HLE ranges. Mostly this does what it says. A few things below.What holds up
builder_okmatches what the three builders actually write (Runner.csProcessPath,paths.launcher_command()withlist2cmdline(["-I", start]), AppRun's$APPIMAGE/$HERE/AppRun). The env hand-off is correct on both sides: Windows_putenvupdates the process blockShellExecuteWpasses on, and Linux buildsenvpbefore the fork.../%/?/@/:closes the "any https host" gap.release_rc.shchecks every digest before the tag moves.hos_fopen_writeon Linux:O_NOFOLLOW|O_NONBLOCK, thenfstatfor a regular file, then truncate. That order closes the link and FIFO cases. The pipeline caches still go.tmpthen rename, so a link at the final name gets replaced, never written through.hos_guest_rangechecks work like the existing fs/libc ones, and the wave-buffer mixer already bounds each read byw->size, so checking[buffer, size)up front is the right span. I didn't find a check that would reject a valid call.RUN_ALL_SKIPwhere it needs one.Worth a look
userfolder that is a junction (inline). That's where Windows keeps the saves, and a junction is the usual way to move them to another drive. In that case the skip silently fails and the offer comes back every start. On Linux the takeover deliberately allows a linked saves folder. I'd keep only the file-name check on Windows too.hookshot_options.ini,mouse_sens.txtor a pipeline cache (dotfile managers, a cache on another disk) now gets no write, just one log line. It's defensible for archive-borne links, but a line in the readme's file section would save a confused report.builder_portable, whichbuilder_okwould refuse. Arkex-ai already raised it on #2326 and it isn't settled yet.part_url_ok/PART_SOURCEShardcodeNotRexed/Hookshot. Whichever lands second has to reconcile the two.CI: the only red job is Windows part 1/2, on
test_native_astc_texture_count.py(scanfdeprecated under-Werror). That's main's: #2397 fixed it, and main's source checks are green since. A merge with main should clear it. GitHub reports no conflicts right now.Splitting: the commits are already split by area, so I wouldn't force a split. If @NotRexed would rather take it in pieces, the natural cut is (a) release/CI/lock/dependabot, (b) builders and update offer, (c) game file I/O and env file, (d) HLE ranges and pipeline record limits. Only (b) collides with #2367/#1414.
Not run on Windows yet: the update offer with a real builder, the junction check and the
hos_fopen_writeWindows branch. A Windows run of the update offer before merge would be good.!is_link(user, ua)refuses a junctioned<game>\user, which is where Windows keeps the saves and the usual way to move them to another drive. In that case the skip is silently not written and the offer comes back every start. The Linuxwrite_skipdeliberately allows a linked saves folder and only refuses a link at the file's own name. Dropping the folder check here and keeping!is_link(file, fa)would match that.Thanks for the merge. I compared the PR's patch at
348d26ccwith the one atd827111dfile by file: all 84 files are line-for-line the same, so this push is the main merge only.The make_game.py resolution is right.
stand_in_damaged_fileskeeps all of #2096's flow (theresolved-v1checked stamp and removing an old one, the note written before the stop, thefailon unresolved files, the stamp and heads removal only after that) and wraps the PR's checks around the heads list:.zsonly,nup.extraction_path(..., links_only=True)for each entry, falling back to opening every file if one doesn't pass. Nothing from either side is dropped.Earlier points, none changed by this push:
userfolder (!is_link(user, ua)inhost/hos_update.c, inline thread above). Still open; I'd keep only the file-name check, as on Linux.hookshot_options.ini,mouse_sens.txtor a pipeline cache on purpose isn't there yet. Small, but still open.builder_okvs relativebuilder_portablequestion with #2367 is still unsettled. Nothing to fix here on its own, but the order needs deciding with @NotRexed.hos_fopen_writeWindows branch. The 414 local checks are a good sign, but they don't cover those.CI: the new head's runs are only queued so far. Main now has #2397, so the Windows
test_native_astc_texture_count.pyfailure from last time should be gone; worth a look once they finish.Nothing new from the merge. Point 1 and a Windows run are what I'd still want before merge.
This now conflicts with main in
builder/linux/hookshot_builder.py,host/hos_main.c,host/hos_update.c,nx2/nup.py,tests/test_bound_keys.py. Could you merge main into the branch (or rebase) when you get a chance? I'll take another look once it's up to date.Fixed in 70b495de: the Windows skip no longer checks the
userfolder for a link, only the skip file's own name (!is_link(file, fa)), as Linux'swrite_skipdoes. The folder still has to be a folder, so a junctioned<game>\usertakes the file.tests/test_update_skip_file.pynow fails if the folder check comes back.Merged main again and took the review points that can be done in code.
Merge with main (
45f19993). Eight files conflicted, and both sides are kept in each. The merge commit lists all of them. These needed a decision:host/hos_main.c: main's #2282 already makes every link inuser/again in the new place, by the full path it names, and checks every entry before it moves any. Itssaves_dirreplaces this PR's link handling there.copy_treeno longer fails on a link inside a folder, because main now makes that link again instead of following it. File copies still go throughhos_fopen_read_binary/hos_fopen_write, so a FIFO fails the copy and nothing is written through a link.tests/test_saves_move_links.pynow expects links to be made again and still checks the rest.host/hos_update.c: main'sbuilder_local(#2367: a fixedhookshot.exein the game folder) is accepted as main accepts it. Any otherbuilder=still has to passbuilder_okwithbuilder_args=.gpu/vk/vk_draw.cpp: main now reads a pipeline cache's header before its size. That order is kept, and thekPcacheMaxlimit andhos_fopen_read_binarysit on top of it.nx2/nup.py: main's newis_linktakeslinks_only, so the read-back of a folder that OneDrive keeps still counts only symlinks, junctions and WSL links.builder/linux/hookshot_builder.py,builder/setup/setup.c,scripts/ngx_sdk.pyandtests/test_bound_keys.pyjust needed both sides kept.--tagis still checked next to main's--allow-downgrade-from,part_url_oksits besidebuilder_ready, and main's DLSS and Frame Generation runtimes are copied through a new temp file each.Some of main's new checks cut code that this PR changed. In
9f329311they get this PR's helpers (hos_guest_range,hos_fopen_read.h,kPcacheMax,linux_update). The builder has written.hookshot_builder_homein the game folder since #2367, so that name is now on the list of names where a link stops the build.test_game_folder_links.pycaught it.Review points
userfolder: fixed in70b495de. Only the skip file's own name is checked for a link or junction now, the same as Linux'swrite_skip.tests/test_update_skip_file.pyfails if the folder check comes back.1751ff48. "Where the files go" now says that the game does not write through a link athookshot_options.ini,mouse_sens.txtor a pipeline cache, and that it says so once in the log. It tells players to link the folder instead.builder_localas is. Its relative-path question no longer comes up throughbuilder=. #1414 (whose repository the setup follows, against the hardcodedNotRexed/Hookshotinpart_url_ok/PART_SOURCES) and #2317 (the per-user data folder) are still open. Whichever lands second has to reconcile them.hos_fopen_writeon Windows. That needs someone with a Windows PC.Tested. Linux:
python -I -B tests/run_all.py --jobs 4gives 474 passed, 2 failed, 36 skipped. The two failures (test_lift_cache.py, andtest_updater_asset_digest.py, whose .NET restore finds no packages offline) also fail on main on this PC. With llvm-mingw 20261104, the changed host files (hos_update.c,hos_main.c,hos_svc.c, the changednn_*.cfiles,nvn_native.c,oot_menu.c,prompts.c,discord_rpc.c) andbuilder/setup/setup.ccompile for Windows with no errors.hos_update.calso has no warnings under-Wall -Wextra -Werror.vk_draw.cpp,vk_main.cppandvk_menu.cpppass a syntax check for both Windows and Linux. There was no game build or run after this merge.(_trash.panda's agent)