On macOS, the binary make install builds needs a nix store path that nothing keeps #251

Closed
opened 2026-11-11 22:08:10 +01:00 by clawbot · 1 comment
Collaborator

On macOS, the ~/bin/quak that make install builds loads ICU, a library bun uses, from the nix store. nix-collect-garbage can delete that path, as with the glibc on Linux in #240. Not checked on a Mac: this is read from the nixpkgs source.

Why

  • On macOS, make build-bin runs bun build --compile through nix-shell -p bun. bun builds the binary from a copy of its own executable.
  • nixpkgs changes its bun for macOS. In pkgs/by-name/bu/bun/package.nix (nixpkgs-unstable 26.11, revision 104240a772428cc2e20d8fd86c9ddbb886bbaff2), install_name_tool replaces bun's reference to /usr/lib/libicucore.A.dylib with lib/libicucore.A.dylib of nixpkgs' darwin.ICU, a nix store path.
  • nix-shell -p creates no garbage-collection root. Once nothing references that ICU, nix-collect-garbage deletes it, and the binary no longer starts, so no cron backup runs.

Steps

  1. On macOS with nix, run make install.
  2. Run otool -L ~/bin/quak.

The nixpkgs source says step 2 lists a libicucore.A.dylib under /nix/store.

What should happen

  • otool -L ~/bin/quak names no path under /nix/store.
  • The binary runs on a Mac without /nix.

Model: opus-5-5

On macOS, the `~/bin/quak` that `make install` builds loads ICU, a library bun uses, from the nix store. `nix-collect-garbage` can delete that path, as with the glibc on Linux in https://git.eeqj.de/sneak/quak/issues/240. Not checked on a Mac: this is read from the nixpkgs source. ## Why - On macOS, `make build-bin` runs `bun build --compile` through `nix-shell -p bun`. bun builds the binary from a copy of its own executable. - nixpkgs changes its bun for macOS. In `pkgs/by-name/bu/bun/package.nix` (nixpkgs-unstable 26.11, revision `104240a772428cc2e20d8fd86c9ddbb886bbaff2`), `install_name_tool` replaces bun's reference to `/usr/lib/libicucore.A.dylib` with `lib/libicucore.A.dylib` of nixpkgs' `darwin.ICU`, a nix store path. - `nix-shell -p` creates no garbage-collection root. Once nothing references that ICU, `nix-collect-garbage` deletes it, and the binary no longer starts, so no cron backup runs. ## Steps 1. On macOS with nix, run `make install`. 2. Run `otool -L ~/bin/quak`. The nixpkgs source says step 2 lists a `libicucore.A.dylib` under `/nix/store`. ## What should happen - `otool -L ~/bin/quak` names no path under `/nix/store`. - The binary runs on a Mac without `/nix`. Model: opus-5-5
Author
Collaborator

Fixed in #252 (branch issue-251-macos-bun-release-build): on macOS, script/build-bin now compiles with bun 1.3.13's hash-checked release build, which loads only /usr/lib libraries, and no longer uses nix-shell.

Unverified: otool -L ~/bin/quak on a Mac; the archives' load commands were read on Linux instead.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/quak/pulls/252 (branch `issue-251-macos-bun-release-build`): on macOS, `script/build-bin` now compiles with bun 1.3.13's hash-checked release build, which loads only `/usr/lib` libraries, and no longer uses `nix-shell`. Unverified: `otool -L ~/bin/quak` on a Mac; the archives' load commands were read on Linux instead. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/quak#251