Skip to content

Windows front end: the cloud-saves patch adds save_sync.c to the Makefile SRC - #190

Merged
LNPANDY merged 3 commits into
mainfrom
save-sync-icloud-fix
Oct 29, 2026
Merged

LNPANDY merged 3 commits into
mainfrom
save-sync-icloud-fix

Conversation

@LNPANDY

@LNPANDY LNPANDY commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Stacked on #185: the cloud-saves patch adds save_sync.c to dm/host/Makefile's SRC line, and frontend-qt/nspb_qt/win/build_app.py mirrors that list — its test compares the two, which is why #185's Qt job failed. Both mirror lines updated (WANT_SRC and host_sources).

If #185 merges first, this reduces to the one file; retarget as needed.

dreamw0rk and others added 3 commits October 29, 2026 09:52
…through an iCloud Drive folder

Until now a save moved between the Mac and an iPhone only by hand (the Mac front end's Saves sheet, over the cable). The apps are signed ad hoc or with a free/personal team, so CloudKit and iCloud entitlements are out; a folder the player picks in iCloud Drive is not.

dm/host/save_sync.c packs the committed save (DM_SAVE and DM_SAVE_device) into one file, <folder>/<title ID>/save.dmsync (a folder named after the title ID is taken as the game's own), because iCloud replaces a file as a whole but syncs a folder file by file. The cloud's copy comes in at the game's first save mount, before the work directory is cloned; the committed save goes out a few seconds after a Commit on a thread of its own, when the iPhone app goes to the background, and from the Mac launcher once the host has exited. <DM_SAVE>.sync keeps the hash of the save last known to be the same on both sides: only the cloud's changed, it comes in; only this one changed, it goes out; both changed, the newer wins. Every save this replaces, here or in the cloud, is kept first in <DM_SAVE>-backups/<date> local|cloud.

The folder is chosen in each app's launcher: Cloud saves in the Mac settings window (dm/mac/Launcher.swift, defaults key cloudSaves.folder, read by launcher.c) and on the iPhone (a security-scoped bookmark, DataBookmark.m). DM_SAVE_SYNC (a folder, icloud, or 0) overrides both. On the iPhone the copies go through NSFileCoordinator (SaveSync.m), which downloads a file iCloud has only listed.

Tested: dm/host/tests/t_save_sync.c (47 checks, also under TSan and ASan/UBSan), and TOTK 1.4.3 between an iPhone and a Mac in both directions.
Exported with scripts/patches.py export; patches.py check passes (20 patches on seedds/nxnative 062cd06 give the committed vendored tree).
…file SRC

The Windows front end mirrors dm/host/Makefile's SRC line to know what to
compile for its own host build, and its test compares the two — the cloud-
saves patch (#185) added save_sync.c to the Makefile but not to the mirror,
so the Qt suite failed. Both lists updated.
@LNPANDY
LNPANDY merged commit 52c1564 into main Oct 29, 2026
9 checks passed
@v0lumehi
v0lumehi deleted the save-sync-icloud-fix branch October 29, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants