about summary refs log tree commit diff
path: root/nix/buildLisp
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-17T16·41+0000
committerVincent Ambo <tazjin@google.com>2020-01-17T16·41+0000
commit21e9a65a3593b3770a93026ea05bcfbe9e2f6b04 (patch)
treea0eda59f426579f1895f719179c97b56fae827a6 /nix/buildLisp
parente1cc4966b7d08e6ce36e8d508e0e873548b5943b (diff)
fix(nix/buildLisp): Don't load binaries in sbclWith r/386
Adds an attribute on each Lisp derivation that specifies whether it is
a binary or not. This attribute is then filtered for in sbclWith.
Diffstat (limited to 'nix/buildLisp')
-rw-r--r--nix/buildLisp/default.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/nix/buildLisp/default.nix b/nix/buildLisp/default.nix
index baf7a14843..b8f3402ad1 100644
--- a/nix/buildLisp/default.nix
+++ b/nix/buildLisp/default.nix
@@ -8,7 +8,7 @@
 , ... }:
 
 let
-  inherit (builtins) map elemAt match;
+  inherit (builtins) map elemAt match filter;
   inherit (pkgs.third_party) lib runCommandNoCC makeWrapper writeText writeShellScriptBin sbcl;
 
   #
@@ -130,6 +130,7 @@ let
   '' // {
     inherit lispNativeDeps lispDeps;
     lispName = name;
+    lispBinary = false;
   };
 
   # 'program' creates an executable containing a dumped image of the
@@ -153,11 +154,18 @@ let
     }
 
     wrapProgram $out/bin/${name} --prefix LD_LIBRARY_PATH : "${libPath}"
-  '' // { lispName = name; lispDeps = [ selfLib ]; lispNativeDeps = []; };
+  '' // {
+    lispName = name;
+    lispDeps = [ selfLib ];
+    lispNativeDeps = native;
+    lispBinary = true;
+  };
 
   # 'sbclWith' creates an image with the specified libraries /
   # programs loaded.
-  sbclWith = deps: let lispDeps = allDeps deps; in writeShellScriptBin "sbcl" ''
+  sbclWith = deps:
+  let lispDeps = filter (d: !d.lispBinary) (allDeps deps);
+  in writeShellScriptBin "sbcl" ''
     export LD_LIBRARY_PATH=${lib.makeLibraryPath (allNative [] lispDeps)};
     exec ${sbcl}/bin/sbcl ${
       if deps == [] then ""