ldc: Fix compiler and output crashing on macOS Sequoia 15.4 (#404245)

authored by

Mathew Polzin and committed by
GitHub
b098c89e 8e36f97b

+19 -3
+7 -3
pkgs/by-name/ld/ldc/bootstrap.nix
··· 14 14 OS = if hostPlatform.isDarwin then "osx" else hostPlatform.parsed.kernel.name; 15 15 ARCH = 16 16 if hostPlatform.isDarwin && hostPlatform.isAarch64 then "arm64" else hostPlatform.parsed.cpu.name; 17 - version = "1.30.0"; 17 + # Work around macOS Sequoia 15.4 segfault by downgrading the bootstrap compiler - see: 18 + # - https://github.com/NixOS/nixpkgs/issues/398443 19 + # - https://github.com/dlang/dmd/issues/21126#issuecomment-2775948553 20 + # TODO: Remove this when bootstrap can be upgraded to a fixed version (>= 1.41.0-beta2)? 21 + version = if hostPlatform.isDarwin then "1.28.1" else "1.30.0"; 18 22 hashes = { 19 23 # Get these from `nix store prefetch-file https://github.com/ldc-developers/ldc/releases/download/v1.19.0/ldc2-1.19.0-osx-x86_64.tar.xz` etc.. 20 - osx-x86_64 = "sha256-AAWZvxuZC82xvrW6fpYm783TY+H8k3DvqE94ZF1yjmk="; 24 + osx-x86_64 = "sha256-mqQ+hNlDePOGX2mwgEEzHGiOAx3SxfNA6x8+ML3qYmw="; 21 25 linux-x86_64 = "sha256-V4TUzEfQhFrwiX07dHOgjdAoGkzausCkhnQIQNAU/eE="; 22 26 linux-aarch64 = "sha256-kTeglub75iv/jWWNPCn15aCGAbmck0RQl6L7bFOUu7Y="; 23 - osx-arm64 = "sha256-Nb/owBdIeroB9jLMDvwjo8bvsTC9vFyJPLMTOMsSAd4="; 27 + osx-arm64 = "sha256-m93rGywncBnPEWslcrXuGBnZ+Z/mNgLIaevkL/uBOu0="; 24 28 }; 25 29 in 26 30 stdenv.mkDerivation {
+12
pkgs/by-name/ld/ldc/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 fetchFromGitHub, 5 + fetchpatch, 5 6 callPackage, 6 7 makeWrapper, 7 8 removeReferencesTo, ··· 43 44 44 45 # https://issues.dlang.org/show_bug.cgi?id=19553 45 46 hardeningDisable = [ "fortify" ]; 47 + 48 + # Fix output programs segfaulting on macOS Sequoia 15.4 - see: 49 + # https://github.com/NixOS/nixpkgs/issues/398443 50 + # https://github.com/ldc-developers/ldc/issues/4899 51 + # TODO: Remove this when upgrading to a fixed version (>= 1.41.0-beta2) 52 + patches = [ 53 + (fetchpatch { 54 + url = "https://github.com/ldc-developers/ldc/commit/60079c3b596053b1a70f9f2e0cf38a287089df56.patch"; 55 + hash = "sha256-Y/5+zt5ou9rzU7rLJq2OqUxMDvC7aSFS6AsPeDxNATQ="; 56 + }) 57 + ]; 46 58 47 59 postPatch = 48 60 ''