Skip to content

Add native macOS (universal x86_64+arm64) build support#10

Open
regniws wants to merge 1 commit into
ROCTUP:mainfrom
regniws:macos-native-build
Open

Add native macOS (universal x86_64+arm64) build support#10
regniws wants to merge 1 commit into
ROCTUP:mainfrom
regniws:macos-native-build

Conversation

@regniws

@regniws regniws commented Jun 14, 2026

Copy link
Copy Markdown

Что это

Встроенный сервер уже работает на macOS — не хватало только сборки нативных компонент под mac. Этот PR добавляет macOS как полноценную цель сборки, не требуя физического Mac у мейнтейнера (бинарники собирает CI на macOS-раннере, ровно как Linux .so).

Изменения

  • native_components/*/build_macos.sh — собирает каждую компоненту как universal (x86_64 + arm64) .dylib, проверяет 4 обязательных экспорта 1C Native API и ad-hoc подписывает.
  • .github/workflows/build-macos.yml — на раннере macos-14 собирает MCPHttpTransport, QueryLineageAnalyzer, RegexHelper, SyntaxHelpReader, ToonConverter и публикует .dylib артефактами.
  • native_components/BUILDING_MACOS.md + ссылка из README.

Два неочевидных грабля (задокументированы)

  1. Клиент 1С под macOS — x86_64 (Rosetta 2 на Apple Silicon). arm64-only библиотека не грузится → Тип не определен (AddIn.*.*). Поэтому сборка universal.
  2. .epf нельзя пересохранять Конфигуратором новее рантаймаошибка формата потока при открытии. Собирать самой старой используемой версией платформы.

Заметки

  • ScreenCapture исключён намеренно — Windows GDI, нет не-Windows ветки. На macOS его макет остаётся Win-DLL, get_screenshot недоступен (одно предупреждение при старте), остальной функционал работает.
  • Все 5 портируемых компонент собраны и проверены локально на Apple Silicon (universal, 4/4 экспорта, ВК подключается, встроенный сервер поднимается на :6003).
  • CI не использует smoke-test (в репозитории нет tests/smoke_test.cpp), чтобы не зависеть от отсутствующего файла.

The embedded server already runs on macOS; only the native components
lacked a macOS build. This adds:

- native_components/*/build_macos.sh — builds each component as a
  universal (x86_64 + arm64) .dylib, verifies the 4 required 1C Native
  API exports, and ad-hoc signs it.
- .github/workflows/build-macos.yml — produces universal dylib artifacts
  on a macOS runner, so macOS binaries can be shipped without owning a Mac
  (same model as the Linux .so flow).
- native_components/BUILDING_MACOS.md + README pointer.

Documents the two non-obvious pitfalls found while porting:
- the 1C:Enterprise macOS client is an x86_64 binary (Rosetta 2 on Apple
  Silicon), so arm64-only libraries fail with "Тип не определен
  (AddIn.*.*)" — hence universal builds;
- an .epf re-saved by a Designer newer than the runtime fails to open with
  "ошибка формата потока" — build it with the oldest platform in use.

ScreenCapture is intentionally excluded (Windows GDI, no non-Windows path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant