Skip to content

macOS: bundle only the enchant applespell backend - #1

Merged
markiehill merged 1 commit into
markiehill:mainfrom
jamesbannan:jamesbannan/macos-enchant-applespell-only
Jul 24, 2026
Merged

markiehill merged 1 commit into
markiehill:mainfrom
jamesbannan:jamesbannan/macos-enchant-applespell-only

Conversation

@jamesbannan

Copy link
Copy Markdown

Summary

Slims the macOS DMG build (build-mac.yml) to bundle only the enchant applespell backend instead of every backend Homebrew ships.

On a clean Mac the aspell backend is dead weight: its word-list data is not bundled, so it registers zero dictionaries while still dragging libaspell into the app via Mach-O dependency analysis. Spell-check on the shipped app is provided entirely by the applespell backend, which delegates to the macOS system spell checker (NSSpellChecker) and needs no bundled dictionary data.

Changes

  • Bundle only enchant_applespell.so (drop the for so in .../enchant-2/*.so loop).
  • Add a build-time check that enchant_applespell.so exists in the Homebrew prefix (fail fast otherwise).
  • Tighten the post-build guard to require enchant_applespell.so specifically instead of "at least one .so".

Validation (arm64, Apple Silicon)

Built a frozen novelWriter.app with this exact enchant logic, then hid Homebrew's enchant backends and aspell data to simulate a clean user Mac:

  • enchant-2/ contains only enchant_applespell.so; libaspell is no longer bundled.
  • Direct enchant check: providers ['AppleSpell'], 43 dictionaries (en_GB/en_US/en_AU/de_DE/fr_FR, ...), en_GB checks colour OK / wrongg rejected and suggests "language" for "langauge".
  • Real app launch (its own runtime hook, no manual env var) logs:
Checking package 'pyenchant': OK
Ready: SpellEnchant
Enchant spell checking for language 'en' loaded

This confirms the shipped .app spell-checks via the macOS system dictionaries with zero bundled dictionary data (fixes the empty-dropdown regression from saga-soft#2705), now without the dead aspell/libaspell weight.

Relates to saga-soft#2748.

The macOS DMG workflow bundled every enchant-2 backend Homebrew ships,
which includes aspell. On a clean Mac the aspell backend is dead weight:
its word-list data is not bundled, so it registers zero dictionaries
while still dragging libaspell into the app via Mach-O dependency
analysis.

Spell-check on the shipped app is provided entirely by the applespell
backend, which delegates to the macOS system spell checker
(NSSpellChecker) and needs no bundled dictionary data. Bundle only that
backend, add a build-time check that it exists in the Homebrew prefix,
and tighten the post-build guard to require enchant_applespell.so
specifically instead of "at least one .so".

Verified on arm64: a frozen novelWriter.app built this way, with the
Homebrew enchant and aspell data hidden, loads the applespell backend,
exposes 43 OS dictionaries (en_GB/en_US/en_AU/de_DE/fr_FR, ...), and
spell-checks correctly. libaspell is no longer bundled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dfbf93cc-170a-4853-be97-161aa477883e
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