Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

PortableGit: the pinned size was a guess (it is 60,087,472 bytes, not 57,200,000)

LNPANDY734d1dfa8c94
diff --git a/frontend-qt/nspb_qt/win/fetch.py b/frontend-qt/nspb_qt/win/fetch.py
index fcf46e60..0698b40f 100644
--- a/frontend-qt/nspb_qt/win/fetch.py
+++ b/frontend-qt/nspb_qt/win/fetch.py
@@ -90,9 +90,12 @@ def download(url: str, dest: Path, sha256: str, size: int | None = None,
f' expected {sha256.lower()}\n got {got}\n'
'The download was deleted. If this repeats, the release was replaced upstream: '
'set "llvm_dir" in toolchain.json to an existing install instead.')
+ # The length is a progress hint, not a check: SHA-256 above is the authority. A pinned size
+ # that is off by a byte (an estimate, or an asset re-uploaded without its hash changing in the
+ # code) must not fail a download whose content is provably right.
if size and total != size:
- part.unlink(missing_ok=True)
- raise DownloadError(f'{dest.name} is {total} bytes, expected {size}')
+ log(f'note: {dest.name} is {total} bytes, the pinned size says {size} — content verified '
+ f'by SHA-256, continuing')
part.replace(dest)
log(f'downloaded {dest.name} ({total / 2**20:.0f} MiB in {time.time() - t0:.0f} s, '
f'sha256 {got[:16]}…)')
diff --git a/frontend-qt/nspb_qt/win/toolchain.py b/frontend-qt/nspb_qt/win/toolchain.py
index 28b8e67a..d27e5448 100644
--- a/frontend-qt/nspb_qt/win/toolchain.py
+++ b/frontend-qt/nspb_qt/win/toolchain.py
@@ -67,7 +67,7 @@ GIT_ASSETS = {
'AMD64': {
'name': f'PortableGit-{GIT_VERSION}-64-bit.7z.exe',
'sha256': 'b1f3e52216e2ed6882d1bebfd4d3fdf319bec40d2edbbf9fd26ec4fd3fce7ed1',
- 'size': 57200000,
+ 'size': 60087472, # measured from the published asset; a guess here fails the length check
},
}
# The tag is v<version>.windows.<n>, and GIT_VERSION already carries the patch number after the