From aa359813c48d84d1fb4369aded908ee2a4d561e5 Mon Sep 17 00:00:00 2001 From: Gabriel Gonzalez Date: Mon, 4 Mar 2019 19:43:31 -0800 Subject: [PATCH] Install mostly static executables on OS X when using Nix (#830) These aren't fully static executables (they still have some `/nix/store` references), but they at least compile Haskell dependencies statically. That means that they can be `nix-env --install`ed side-by-side with other Haskell executables, which would otherwise conflict with an error like this one: ``` error: packages '/nix/store/hrxnlwlsiw5jjjkq5v6ihcwb0shx4fga-dhall-1.20.1/lib/li nks/libHSbasement-0.0.8-8QjArDsw3GWCcbHE5iqtz3-ghc8.4.3.dylib' and '/nix/store/d 2y5373anwf1q3h86ar3lljk11k1lq0h-dhall-json-1.2.6/lib/links/libHSbasement-0.0.8-8 QjArDsw3GWCcbHE5iqtz3-ghc8.4.3.dylib' have the same priority 5; use 'nix-env --s et-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority) ``` --- dhall-bash/default.nix | 2 +- dhall-json/default.nix | 2 +- dhall-text/default.nix | 2 +- dhall/default.nix | 2 +- nix/shared.nix | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dhall-bash/default.nix b/dhall-bash/default.nix index 9c06d3d..7b4f288 100644 --- a/dhall-bash/default.nix +++ b/dhall-bash/default.nix @@ -1 +1 @@ -(import ../nix/shared.nix {}).dhall-bash +(import ../nix/shared.nix {}).possibly-static.dhall-bash diff --git a/dhall-json/default.nix b/dhall-json/default.nix index 7372088..8ec1c09 100644 --- a/dhall-json/default.nix +++ b/dhall-json/default.nix @@ -1 +1 @@ -(import ../nix/shared.nix {}).dhall-json +(import ../nix/shared.nix {}).possibly-static.dhall-json diff --git a/dhall-text/default.nix b/dhall-text/default.nix index c2d08a1..c01b892 100644 --- a/dhall-text/default.nix +++ b/dhall-text/default.nix @@ -1 +1 @@ -(import ../nix/shared.nix {}).dhall-text +(import ../nix/shared.nix {}).possibly-static.dhall-text diff --git a/dhall/default.nix b/dhall/default.nix index 52b5fec..744ba66 100644 --- a/dhall/default.nix +++ b/dhall/default.nix @@ -1 +1 @@ -(import ../nix/shared.nix {}).dhall +(import ../nix/shared.nix {}).possibly-static.dhall diff --git a/nix/shared.nix b/nix/shared.nix index 69d476c..3d44e46 100644 --- a/nix/shared.nix +++ b/nix/shared.nix @@ -505,7 +505,7 @@ let then pkgsStaticLinux.pkgsMusl.haskell.packages."${compiler}"."${name}-static" else - pkgs.haskell.packages."${compiler}"."${name}"; + pkgs.haskell.lib.justStaticExecutables (pkgs.haskell.packages."${compiler}"."${name}"); makeTarball = name: pkgsStaticLinux.releaseTools.binaryTarball rec {