Shipping a Self-Contained macOS App: How 24 Homebrew dylibs Broke My DeepSeek Harness Installer
Описание и применение
Автор создал самодостаточный macOS‑приложение для DeepSeek Harness, исправив проблему с 24 динамическими библиотеками Homebrew, которые были привязаны к абсолютным путям. Перенесённые библиотеки, переписанные пути и повторная подпись позволили приложению успешно запускаться на чистых macOS‑устройствах, уменьшив размер диска с 792 МБ до 620 МБ и добавив три плагина.
Задача
An Electron‑based macOS installer for DeepSeek Harness failed on clean Macs because the bundled Node binary linked 24 Homebrew‑provided dynamic libraries via absolute paths, causing the app to terminate instantly with no logs.
Результат
The app became truly self‑contained, ran on clean macOS installations, reduced size, and shipped additional plugins.
Рабочий процесс
- 1. Run
otool -Lon the bundled Node to list all linked dylibs. - 2. Recursively scan each dylib for further dependencies using a custom
scan()script. - 3. Copy every discovered dylib into the app’s
runtime/lib/directory. - 4. Use
install_name_tool -changeto rewrite absolute Homebrew paths to relative@loader_pathreferences. - 5. Manually handle libraries referenced via
@rpath(e.g., ICU, brotli) by copying them and updating the path. - 6. Re‑sign the modified binaries with
codesign --force --deep --sign -. - 7. Verify no remaining Homebrew paths with
otool -Land test the installer on a clean Mac.
Доказательства
otool -L revealed 24 dynamic libraries linked by absolute Homebrew paths.
Fixing it meant copying every dylib into the app bundle, rewriting paths to @loader_path, and re‑signing.
The installer got smaller (792 MB → 620 MB) while gaining three plugins.
- Дата записи: 2026-09-21T07:45:25.944Z