Skip to content

Support mid-sync abort for external GUIs - #1198

Merged
gdt merged 1 commit into
bcpierce00:masterfrom
bcourbage:register-abortall-callback
Jun 24, 2026
Merged

Support mid-sync abort for external GUIs#1198
gdt merged 1 commit into
bcpierce00:masterfrom
bcourbage:register-abortall-callback

Conversation

@bcourbage

Copy link
Copy Markdown
Contributor

The OCaml to Cocoa bridge in uimacbridge.ml doesn't expose a way for the macOS Cocoa frontend to abort an in-progress sync. This change registers an abortAll callback that calls the existing Abort.all, so Cocoa frontends can hook into it. This change is purely additive. No behavior change for existing callers.

If applied, this change will enable external GUIs to trigger mid-sync abort via Callback.register. It has no behavior impact on calling apps. It just expands what external GUIs can hook into.
bcourbage added a commit to bcourbage/unison-ui-mac that referenced this pull request Jun 22, 2026
Moves the abortAll item out of "resolved as won't-do" — a human-authored
version was submitted to bcpierce00/unison#1198. Records the retirement
plan: if it merges, drop patches/0001-… and the make apply-patches step
once the vendored blob is rebuilt from an upstream that includes it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gdt

gdt commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

I am unclear if our CI does any useful tests, so I wonder what the state of the in-tree mac gui was, and if you have run it after. (I get it that one can reason it must not be harmed; I'm asking if we know that's true.) I myself do not use the unison GUIs at all.

I enabled the CI run; sorry for not hitting that earlier but I didn't realize it wouldn't run (for some definition of "new contributor", it only runs if I hit "approve running CI").

@bcourbage

Copy link
Copy Markdown
Contributor Author

Thanks for enabling CI.

I built and ran the app from this branch. Built Unison.app via make macui (OCaml 5.4.1 / Xcode 26.5): clean build, codesigns and codesign --verify --deep --strict passes. Launched it and ran an actual sync. Files propagate correctly, archives are written, and the app exits cleanly. The interactive reconcile window renders normally and shows queued changes as expected. The change is purely additive (registers a new abortAll callback; the in-tree Cocoa frontend never calls it), so existing behavior is unchanged.

I also looked into the CI failure. Both red jobs are the Windows builds, failing at the lablgtk install step (building GTK/gettext from source under MSVC: GUI library lablgtk not found), before this PR's code is reached. This change touches only src/uimacbridge.ml, which compiles solely on macOS. All macOS and Linux jobs passed, including macOS: Build and package Unison.app. The Windows break looks pre-existing on main rather than introduced here.

@gdt

gdt commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

The CI setup is a bit flaky; jobs randomly fail to fetch packages that must be installed. I just usually rerun them. Thanks for testing/reporting.

@gdt

gdt commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Windows CI is failing reliably, and it's not about your change.

@gdt
gdt merged commit 28684b0 into bcpierce00:master Jun 24, 2026
51 of 57 checks passed
@bcourbage
bcourbage deleted the register-abortall-callback branch June 25, 2026 01:21
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