about summary refs log tree commit diff
path: root/nix/buildLisp
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-07-27T19·48+0200
committersterni <sternenseemann@systemli.org>2021-08-01T23·37+0000
commitc8f521e96a2d2b127ad4e6b6785b25f906c01ddf (patch)
tree6ab161571af9a17b27c47153684cdfd8f87d693a /nix/buildLisp
parent04ecf9cbbb6e62302cb829eb4748c16caed2325d (diff)
refactor(nix/buildLisp): use passthru for extra attributes r/2701
Using passthru and appending the attributes via `//` have the same
effect with a subtle difference: In the latter case re-evaluating
the derivation when using the underlying `mkDerivation`'s
`overrideAttrs` will delete all appended attributes. Using
passthru at least preserves the attributes although the self
reference to the derivation in `passthru.sbcl` will become
outdated (unless updated manually).

Change-Id: I8b85009f386b9375b86a23fd50c4ec8c6a9dea7f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3257
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'nix/buildLisp')
-rw-r--r--nix/buildLisp/default.nix32
1 files changed, 17 insertions, 15 deletions
diff --git a/nix/buildLisp/default.nix b/nix/buildLisp/default.nix
index fe43c895f4..3e503a96a2 100644
--- a/nix/buildLisp/default.nix
+++ b/nix/buildLisp/default.nix
@@ -162,6 +162,13 @@ let
     in lib.fix (self: runCommandNoCC "${name}-cllib" {
       LD_LIBRARY_PATH = lib.makeLibraryPath lispNativeDeps;
       LANG = "C.UTF-8";
+      passthru = {
+        inherit lispNativeDeps lispDeps;
+        lispName = name;
+        lispBinary = false;
+        tests = testDrv;
+        sbcl = sbclWith [ self ];
+      };
     } ''
       ${if ! isNull testDrv
         then "echo 'Test ${testDrv} succeeded'"
@@ -176,13 +183,7 @@ let
 
       chmod +x cat_fasls
       ./cat_fasls > $out/${name}.fasl
-    '' // {
-      inherit lispNativeDeps lispDeps;
-      lispName = name;
-      lispBinary = false;
-      tests = testDrv;
-      sbcl = sbclWith [ self ];
-    });
+    '');
 
   # 'program' creates an executable containing a dumped image of the
   # specified sources and dependencies.
@@ -215,6 +216,14 @@ let
       nativeBuildInputs = [ makeWrapper ];
       LD_LIBRARY_PATH = libPath;
       LANG = "C.UTF-8";
+      passthru = {
+        lispName = name;
+        lispDeps = [ selfLib ] ++ (tests.deps or []);
+        lispNativeDeps = native;
+        lispBinary = true;
+        tests = testDrv;
+        sbcl = sbclWith [ self ];
+      };
     } ''
       ${if ! isNull testDrv
         then "echo 'Test ${testDrv} succeeded'"
@@ -226,14 +235,7 @@ let
       }
 
       wrapProgram $out/bin/${name} --prefix LD_LIBRARY_PATH : "${libPath}"
-    '' // {
-      lispName = name;
-      lispDeps = [ selfLib ] ++ (tests.deps or []);
-      lispNativeDeps = native;
-      lispBinary = true;
-      tests = testDrv;
-      sbcl = sbclWith [ self ];
-    });
+    '');
 
   # 'bundled' creates a "library" that calls 'require' on a built-in
   # package, such as any of SBCL's sb-* packages.