Skip to content

chore: drop darwin from flake (Linux-only) - #4

Merged
ryanleecode merged 2 commits into
mainfrom
chore/drop-darwin-flake
Oct 7, 2026
Merged

ryanleecode merged 2 commits into
mainfrom
chore/drop-darwin-flake

Conversation

@systemfsoftware-maker

Copy link
Copy Markdown

Removes macOS from the fork's build and CI config, following the org rule that systemfsoftware repos have no macOS. Base is main at c93d6c8, which includes #3.

Changes

flake.nix

  • flake-utils.lib.eachDefaultSystem is replaced with eachSystem [ "x86_64-linux" "aarch64-linux" ].
  • Removed the aarch64-darwin and x86_64-darwin node-modules hashes. x86_64-linux keeps its hash, and aarch64-linux stays on fakeHash as before.
  • Removed the optionals isDarwin [ pkgs.darwin.cctools ] entry from nativeBuildInputs.
  • In the wrapper, removed --set DYLD_LIBRARY_PATH, the Darwin/Metal residency comment, and the uname -s = Darwin branch of --run. The MCP log-level part of --run is unchanged. LD_LIBRARY_PATH no longer depends on isLinux; on Linux the value is the same as before.
  • meta.platforms changed from platforms.unix to platforms.linux.

Other config

  • .github/workflows/ci.yml: removed DYLD_LIBRARY_PATH: /opt/homebrew/opt/sqlite/lib from the bun test step.
  • scripts/test-all.mjs: removed the darwin-only GGML_METAL_NO_RESIDENCY env injection.
  • src/test-preload.ts: updated the header comment so it lists only the injector that is left (bin/qmd).

Verification (local, x86_64-linux)

$ nix build . -L                 → exit 0
$ ./result/bin/qmd --version     → qmd 2.8.3 (exit 0)
$ nix flake check -L             → all checks passed! (exit 0; aarch64-linux omitted as incompatible host)

The generated wrapper exports only LD_LIBRARY_PATH (sqlite, glibc, gcc-lib) plus the MCP log-level block.

macOS handling left in place (runtime source and docs, not changed here)

  • bin/qmd: the darwin GGML_METAL_NO_RESIDENCY launcher block.
  • src/db.ts: Homebrew libsqlite3.dylib setCustomSQLite lookup, plus the macOS hint in the sqlite-vec error.
  • src/llm.ts: isDarwinMetalMitigationActive, installDarwinExitGuard, isDarwinExitGuardInstalled, and the Metal dispose comments.
  • src/cli/qmd.ts: doctor's "darwin metal residency" check, the metal (macOS Metal backend) label, and the QMD_METAL_KEEP_RESIDENCY/GGML_METAL_NO_RESIDENCY env help.
  • src/store.ts: the Homebrew SQLite / BREW_PREFIX error text.
  • src/cli/mcp-pid.ts: the ps fallback comment for macOS.
  • package.json optionalDependencies: sqlite-vec-darwin-arm64 and sqlite-vec-darwin-x64. These are runtime native packages; removing them changes the lockfiles and the published package.
  • scripts/repro-metal-rsets-crash.mjs: a macOS-only repro script.
  • README.md: the macOS Homebrew SQLite requirement.
  • Tests covering the runtime paths above (test/bin-wrapper.test.ts and others).
  • flake.nix devShell: BREW_PREFIX export. It is a Homebrew name but not macOS-specific, and nothing in src/ reads it.
  • Lockfiles: transitive darwin platform packages from upstream dependencies such as esbuild, oxlint and typescript.

Org rule: no macOS in systemfsoftware repos.

- flake.nix: eachDefaultSystem -> eachSystem [ x86_64-linux aarch64-linux ];
  drop the aarch64-darwin/x86_64-darwin node-modules hashes, the
  isDarwin pkgs.darwin.cctools nativeBuildInputs, DYLD_LIBRARY_PATH, and
  the Darwin Metal residency branch of the wrapper --run script (MCP
  log-level env unchanged); LD_LIBRARY_PATH is now unconditional (same
  value as before on Linux); meta.platforms = platforms.linux.
- ci.yml: drop the Homebrew DYLD_LIBRARY_PATH env from the bun test step.
- scripts/test-all.mjs: drop the darwin-only GGML_METAL_NO_RESIDENCY env;
  src/test-preload.ts comment updated to match.
The flake wrapper no longer carries the darwin Metal residency branch, so
"makeWrapper seeds the same pre-import env as bin/qmd (tobi#723)" failed on
GGML_METAL_NO_RESIDENCY. Retarget it at what the Linux wrapper seeds:
the mcp log-level exports (LLAMA_LOG_LEVEL, GGML_LOG_LEVEL,
GGML_BACKEND_SILENT) and LD_LIBRARY_PATH, scoped to the makeWrapper
invocation, and assert flake.nix sets none of GGML_METAL_NO_RESIDENCY,
QMD_METAL_KEEP_RESIDENCY or DYLD_LIBRARY_PATH.
@ryanleecode
ryanleecode merged commit 3d0cb9d into main Oct 7, 2026
4 checks passed
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