From d7895c2810864934356131ee47de2ba18947c844 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 13 Jun 2018 16:25:12 -0400 Subject: [PATCH] darwin stdenv: fix llvmPackage overrides It may seem nice and abstract to just override the default version, but that breaks the alias relationship where the original llvmPackages_* is no longer in sync. Put another away, modifying the referee rather instead of breaking the reference "copy-on-write" is impossible. --- pkgs/stdenv/darwin/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 951c96877f96..57b59f26204c 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -275,10 +275,9 @@ in rec { libcxxabi libcxx ncurses libffi zlib gmp pcre gnugrep coreutils findutils diffutils patchutils; - llvmPackages = let llvmOverride = llvmPackages.llvm.override { inherit libcxxabi; }; - in super.llvmPackages // { - llvm = llvmOverride; - clang-unwrapped = llvmPackages.clang-unwrapped.override { llvm = llvmOverride; }; + llvmPackages_5 = super.llvmPackages_5 // { + llvm = llvmPackages_5.llvm.override { inherit libcxxabi; }; + clang-unwrapped = llvmPackages_5.clang-unwrapped.override { llvm = self.llvmPackages_5.llvm; }; }; darwin = super.darwin // { @@ -314,8 +313,8 @@ in rec { libcxxabi libcxx ncurses libffi zlib llvm gmp pcre gnugrep coreutils findutils diffutils patchutils; - llvmPackages = super.llvmPackages // { - inherit (llvmPackages) llvm clang-unwrapped; + llvmPackages_5 = super.llvmPackages_5 // { + inherit (llvmPackages_5) llvm clang-unwrapped; }; darwin = super.darwin // {