Repository navigation
Fix Windows bootstrap command line limit and game version detection - #711
Merged
Zaldaryon merged 3 commits intoNov 20, 2026
Merged
Conversation
…s allows Windows rejects a command line over 32,766 characters, and a full bootstrap passes 300+ absolute patch paths to git apply from install roots such as C:\Users\<name>\AppData\Local\optimum\src-v0.4.1. Add 400 long-named patches to the batching test and check that a conflict inside one chunk does not mark already-applied patches as failed.
…ine limit Test-PatchSyntaxBatch and Invoke-GitApplyOptimumPatchBatch passed every patch path to one git call. From an install root such as C:\Users\<name>\AppData\Local\optimum\src-v0.4.1 that is over 37,000 characters, past the 32,766 CreateProcess limit, so the 0.4.1 Windows bootstrap died with 'The filename or extension is too long'. Split the paths into chunks under 7,000 characters, which also fits a git.cmd shim. git apply is atomic only inside one patch file, so check each chunk before applying it. A chunk that fails the check writes nothing and falls back per patch without reporting already-applied patches as failures.
DetectGameVersion read a three-part file version such as 1.22.7 as 1.22, so the overlay version check rejected every manifest listing 1.22.7. Move the normalization into NormalizeGameVersion and cover the three-part, four-part and suffixed forms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three user reports of the 0.4.1 Windows installer failing, all at
scripts/bootstrap.ps1:610withProgram 'git.exe' failed to run: The filename or extension is too long, plus a report that the overlay rejects Vintage Story 1.22.7.Command line too long.
Test-PatchSyntaxBatchpassed all 328 absolute patch paths to onegit apply --stat. Windows rejects a command line over 32,766 characters. FromC:\Users\<name>\AppData\Local\optimum\src-v0.4.1that line is about 37,600 characters; CI never hit it because its checkout isD:\a\Optimum\Optimum(about 29,000). Any install root longer than 31 characters fails.Invoke-GitApplyOptimumPatchBatchhas the same shape and would fail next. Both now split the paths withSplit-GitPathArgumentsinto chunks under 7,000 characters, which also fits agit.cmdshim.Partial apply on conflict.
git applyis atomic only inside one patch file. Given several, it applies them in order and stops at the first failure, so the earlier patches stay written and the per-patch fallback then reports them as failed. Each chunk is now checked withgit apply --checkbefore it is applied, so a chunk that fails writes nothing and falls back per patch on its own.Game version.
DetectGameVersionread the three-part file version1.22.7ofVintagestoryLib.dllas1.22, so the overlay version check rejected every manifest listing1.22.7. The check shipped after 0.3.22. The normalization is nowNormalizeGameVersion, with tests for1.22.7,1.22.7.0,1.22.7.3,1.22, a+suffix and non-versions.Commits are split so the CI history shows the failure first.
5799a4badds 400 long-named patches and a conflict case tobootstrap-patch-batching.ps1; on that commit alone,Windows PowerShell 5.1 and 7 batched patch applyfails with the sameThe filename or extension is too longerror users reported (run 44803659671). The next two commits fix it.Not covered: the
StandardOutputEncoding is only supported when standard output is redirectedmessage from one user. I could not reproduce it on Linux; it may come from the same call. Also not changed:bootstrap.shhas the same non-atomic assumption, but Linux and macOS argument limits are far above this patch count.Tested locally:
Optimum.Bootstrap.Core.Tests290 passed,Optimum.Installer.Tests106 passed,bootstrap-patch-batching.ps1under PowerShell 7.7 on Linux. The Windows PowerShell 5.1 and 7 runs are in this PR's CI.