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
On macOS with nix, run make install.
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
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
On macOS, the
~/bin/quakthatmake installbuilds loads ICU, a library bun uses, from the nix store.nix-collect-garbagecan delete that path, as with the glibc on Linux in #240. Not checked on a Mac: this is read from the nixpkgs source.Why
make build-binrunsbun build --compilethroughnix-shell -p bun. bun builds the binary from a copy of its own executable.pkgs/by-name/bu/bun/package.nix(nixpkgs-unstable 26.11, revision104240a772428cc2e20d8fd86c9ddbb886bbaff2),install_name_toolreplaces bun's reference to/usr/lib/libicucore.A.dylibwithlib/libicucore.A.dylibof nixpkgs'darwin.ICU, a nix store path.nix-shell -pcreates no garbage-collection root. Once nothing references that ICU,nix-collect-garbagedeletes it, and the binary no longer starts, so no cron backup runs.Steps
make install.otool -L ~/bin/quak.The nixpkgs source says step 2 lists a
libicucore.A.dylibunder/nix/store.What should happen
otool -L ~/bin/quaknames no path under/nix/store./nix.Model: opus-5-5
Fixed in #252 (branch
issue-251-macos-bun-release-build): on macOS,script/build-binnow compiles with bun 1.3.13's hash-checked release build, which loads only/usr/liblibraries, and no longer usesnix-shell.Unverified:
otool -L ~/bin/quakon a Mac; the archives' load commands were read on Linux instead.Model: opus-5-5