Skip to content

starship: fix build on Darwin - #540463

Merged
stepbrobd merged 1 commit into
NixOS:masterfrom
mnixry:fix-starship-darwin-notify-build
Jul 11, 2026
Merged

stepbrobd merged 1 commit into
NixOS:masterfrom
mnixry:fix-starship-darwin-notify-build

Conversation

@mnixry

@mnixry mnixry commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Use LLVM ld64.lld for Darwin builds instead of nixpkgs classic ld64. The classic open-source ld64 currently crashes in its stubs pass when linking the mac-notification-sys Objective-C object pulled in by starship default features.

This keeps the default notify feature enabled; only the Darwin linker is changed.

Assisted-by: OpenAI Codex (GPT-5.5)

Fixes #540450

Things done

@mnixry
mnixry force-pushed the fix-starship-darwin-notify-build branch from 36ab0ad to fe2b4ff Compare July 10, 2026 18:08
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. labels Jul 10, 2026
@nixpkgs-review-gha

Copy link
Copy Markdown

✅ nixpkgs-review result

Generated using nixpkgs-review-gha (71d8654)

Command: nixpkgs-review pr 540463
Commit: fe2b4ffcda4b9af1092d37845d074ce1faa713fd (subsequent changes)
Merge: 12875c28ca1cbbd0a597722f016e9a197e73989f

Triggered by @mnixry (32300164)
Logs: https://github.com/mnixry/nixpkgs-review-gha/actions/runs/29113019682/attempts/2


x86_64-linux

✅ No rebuilds


aarch64-linux

✅ No rebuilds


aarch64-darwin (sandbox = true)

✅ 1 package built:
  • starship

@stepbrobd

Copy link
Copy Markdown
Member

i think this is over-complicating things, try https://github.com/search?q=repo%3ANixOS%2Fnixpkgs+isDarwin+NIX_CFLAGS_LINK+lld&type=code

just add lld as optional darwin input and set the same attr but for lld

@al3xtjames

Copy link
Copy Markdown
Contributor

FWIW, I believe the root cause of the ld64 crashes should be addressed by #536365.

Work around the Darwin ld64 libc++ hardening issue by linking starship with LLVM lld on Darwin. This follows the temporary mitigation pattern used by other affected Darwin packages while NixOS#536365 is pending.

This keeps the default notify feature enabled; only the Darwin linker is changed.

Assisted-by: OpenAI Codex (GPT-5.5)
@mnixry
mnixry force-pushed the fix-starship-darwin-notify-build branch from fe2b4ff to 883e799 Compare July 11, 2026 09:32
@nixpkgs-review-gha

Copy link
Copy Markdown

✅ nixpkgs-review result

Generated using nixpkgs-review-gha (71d8654)

Command: nixpkgs-review pr 540463
Commit: 883e799eb2843d1438a5ce76ed8ac4a924cf6ce5 (subsequent changes)
Merge: 3b50a6d9929120aca486c5b8509397b65a90d6a3

Triggered by @mnixry (32300164)
Logs: https://github.com/mnixry/nixpkgs-review-gha/actions/runs/29147954851/attempts/1


x86_64-linux

✅ No rebuilds


aarch64-linux

✅ No rebuilds


aarch64-darwin (sandbox = true)

✅ 1 package built:
  • starship

@mnixry

mnixry commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

just add lld as optional darwin input and set the same attr but for lld

@stepbrobd fixed.

@stepbrobd
stepbrobd added this pull request to the merge queue Jul 11, 2026
Merged via the queue into NixOS:master with commit d5d379a Jul 11, 2026
25 checks passed
@n8henrie n8henrie mentioned this pull request Jul 11, 2026
4 tasks done
@eclairevoyant eclairevoyant mentioned this pull request Jul 11, 2026
2 of 13 tasks
fredclausen added a commit to fredsystems/nixos that referenced this pull request Jul 12, 2026
…crash

The nixpkgs bump carried by PR #1970 ships a classic ld64
(cctools-binutils-darwin-1010.6) whose stubs pass crashes with
'Trace/BPT trap: 5' when linking any Rust binary that pulls
mac-notification-sys via notify-rust.  freminal 0.11.1 is such a
binary (its notifications feature depends on notify-rust), so every
aarch64-darwin freminal build fails with exit code 133 out of
cctools-binutils-darwin-1010.6/bin/ld.  This is the same failure mode
that killed the removed cargo-watch and that nixpkgs upstream just
hot-fixed for starship in NixOS/nixpkgs#540463 (fixes #540450).

Apply the same recipe to the freminal home-manager package on darwin
only:

  - add llvmPackages.lld to nativeBuildInputs
  - set env.NIX_CFLAGS_LINK = '-fuse-ld=lld' so rustc's cc-driven link
    step uses LLVM's lld instead of the broken classic ld64

Wire it in via features/desktop/freminal/default.nix, which is the
darwin-only importer of the feature.  Linux freminal is untouched
(gated on pkgs.stdenv.hostPlatform.isDarwin); confirmed by a local
Daytona (Linux) build resolving to an unmodified upstream derivation
via the Attic cache, and by the Freds-MacBook-Pro darwinConfiguration
now producing a fresh drv whose env contains NIX_CFLAGS_LINK and
whose closure references lld-21.1.8.

Registered in .github/tracked-upstream-fixes.json as
nixpkgs-536365-ld64-mac-notification-sys with check type
nixpkgs-pin-contains-commit and fix_commit set to the zero sha so the
entry is permanently BLOCKED until #536365 (the root ld64 fix)
merges; at that point we update fix_commit to the merge sha and the
weekly upstream-fix tracker will flag the revert once #536365 lands
in our pinned nixpkgs.

All nine nixosConfigurations and both darwinConfigurations still
evaluate cleanly.

Unblocks #1970.
MacroPower added a commit to MacroPower/dotfiles that referenced this pull request Jul 20, 2026
nixpkgs' classic open-source ld64 (cctools 1010.6) crashes with
Trace/BPT trap: 5 in its stubs pass when linking the
mac-notification-sys Objective-C object that notify-rust pulls in.
Both workmux and czkawka's GUI binaries link that crate. Use LLVM
ld64.lld on darwin instead, mirroring nixpkgs' starship workaround
(NixOS/nixpkgs#540463). Drop once the cctools fix
(NixOS/nixpkgs#536365) reaches our pin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: starship on aarch64-darwin

4 participants