ci: de-nix macOS binary libiconv via install_name_tool + re-sign
macos-build-test / build (push) Successful in 2m11s
build-ci-image / build (push) Successful in 9m49s
ci / gate (push) Successful in 2m50s

libiconv is the only /nix/store dep the darwin stdenv bakes in (everything
else is system frameworks + libSystem/libobjc). The smoke-test now rewrites
that load path to /usr/lib/libiconv.2.dylib (ABI-compatible, present on
every Mac), re-signs ad-hoc (install_name_tool breaks the sig; arm64
requires a valid one), then verifies no /nix/store paths remain, the
signature is valid, and the native binary launches. Flake comment updated
to reflect the propagated-libiconv reality.
This commit is contained in:
claude@clouddev1
2026-06-14 21:43:01 +00:00
parent 4d004f5847
commit 9a126782f1
2 changed files with 30 additions and 14 deletions
+6 -5
View File
@@ -63,11 +63,12 @@
buildInputs = buildInputs ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
# macOS release builds (aarch64/x86_64-apple-darwin) link AppKit
# (arboard) + libSystem; the Apple SDK provides those framework/
# system-lib stubs as *system* paths (/usr/lib, /System/Library), so
# the resulting binary is portable. NOTE: do NOT add `pkgs.libiconv`
# — it makes the linker prefer the nix-store libiconv.dylib, baking a
# /nix/store path into the binary (non-portable). The SDK's own
# libiconv stub resolves `-liconv` to /usr/lib/libiconv instead.
# system-lib stubs as *system* paths (/usr/lib, /System/Library).
# NOTE: the darwin stdenv still propagates a *nix-store* libiconv and
# links it regardless of inputs, so the release workflow rewrites that
# one load path to /usr/lib/libiconv.2.dylib (install_name_tool) and
# re-signs — see release-macos / the macOS smoke-test. Adding
# `pkgs.libiconv` here would only reinforce the wrong path, so don't.
pkgs.apple-sdk
];
nativeBuildInputs = nativeBuildInputs ++ [