Skip to content

chore(packaging): path-context seam and a runtime-bearing macOS bundle in CI - #41

Merged
Dimoshka merged 2 commits into
mainfrom
chore/packaging-followups
Nov 11, 2026
Merged

Dimoshka merged 2 commits into
mainfrom
chore/packaging-followups

Conversation

@Dimoshka

Copy link
Copy Markdown
Contributor

Implements the two remaining checklist items of #39.

Item A — pathContext seam for ServerBinaryLocatorImpl

ServerBinaryLocatorImpl now takes an optional p.Context? pathContext (default p.context) and renders every join, normalize, dirname, isAbsolute and PATH-list separator through it, mirroring LlamaLibraryLocator. Production defaults and the executability logic are unchanged. New tests cover:

  • a Windows context (p.Style.windows): C:\Program Files\LlamaPulse\data\llama-server.exe, the adjacent llama-server.exe, the config bin candidate and the PATH entry with the bare .exe name last;
  • a POSIX context: <X.app>/Contents/Resources/runtime/v0.8.0/metal/llama-server is produced and resolved.

Item B — CI verifies a runtime-bearing macOS bundle

The Package (macOS) job keeps the runtime-free package/upload path and adds:

  1. a deterministic fixture runtime in $RUNNER_TEMP — a compiled Mach-O libllama.dylib, a libggml-metal.dylib copy, an executable llama-server script and a realistic runtime.yaml;
  2. package_app.dart --runtime v0.8.0 metal --out dist-runtime;
  3. ditto -x -k, then asserts the four runtime files under Contents/Resources/runtime/v0.8.0/metal/, the app executable bit, codesign --verify --deep --strict, and no com.apple.security.app-sandbox entitlement.

docs/packaging.md now says CI packages a runtime-bearing macOS bundle too, but with a fixture runtime, not a downloaded production archive.

Still unverified

  • A downloaded production Metal runtime and real GPU backends.
  • Windows FFI loading of a bundled runtime.
  • A GUI launch, model load or any runtime execution.

Test plan

  • dart run melos run check green: gen twice with no drift, gen:catalog:check (362 parameters), analyze, 1293 tests (894 core plus two host/env-gated skips, 233 CLI, 166 app), format:check, CLI AOT build.
  • CI on this PR (all seven jobs) exercises the new macOS runtime-bearing leg.

Refs #39

ServerBinaryLocatorImpl renders every candidate with an optional package:path context, defaulting to the host's, so Windows and macOS shapes are testable on Linux. Two context tests cover the Windows candidate list and the macOS Contents/Resources runtime; suite counts move to 1293 (894 core plus two skips, 233 CLI, 166 app).
The macOS packaging job builds a deterministic fixture runtime (a compiled Mach-O dylib, a libggml-metal copy, a scripted llama-server and a realistic runtime.yaml), packages it under Contents/Resources/runtime, then extracts the archive with ditto and asserts the runtime files, the executable bit, codesign --verify --deep --strict and the absence of the App Sandbox entitlement. docs/packaging.md records the fixture and what remains unverified.
@Dimoshka
Dimoshka merged commit 10c0369 into main Nov 11, 2026
7 checks passed
@Dimoshka
Dimoshka deleted the chore/packaging-followups branch November 11, 2026 16:51
@Dimoshka
Dimoshka restored the chore/packaging-followups branch November 11, 2026 17:03
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