about summary refs log tree commit diff
path: root/nix/buildLisp/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-09-12T11·19+0200
committersterni <sternenseemann@systemli.org>2021-09-12T21·39+0000
commit62fa36c9c2ef79b9b2aefaec8eac71665de45847 (patch)
treefdb34ce3c04aed33518b5e18f9a47782963fc3a0 /nix/buildLisp/default.nix
parente507b842918f80340257304bd9541cb3b3abc9da (diff)
fix(nix/buildLisp): preserve argv[0] in buildLisp.program r/2852
I *thought* I was being clever with the (cdr (member …)) call, but
somehow completely forgot that *posix-argv* and
*command-line-argument-list* are equivalent to argv, so they also
contain the program name as the first element. Dropping that made
argument parsing completely break down, so let's revert back to the
older solution which works quite well.

Change-Id: If7d3321cda0ca512bc8c23b6541ce390b81a3e24
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3538
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'nix/buildLisp/default.nix')
-rw-r--r--nix/buildLisp/default.nix13
1 files changed, 6 insertions, 7 deletions
diff --git a/nix/buildLisp/default.nix b/nix/buildLisp/default.nix
index 7e38c0283e47..1dae0efeb198 100644
--- a/nix/buildLisp/default.nix
+++ b/nix/buildLisp/default.nix
@@ -310,9 +310,9 @@ let
                                ;; Filter out everything prior to the `--` we
                                ;; insert in the wrapper to prevent SBCL from
                                ;; parsing arguments at startup
-                               (replace sb-ext:*posix-argv*
-                                        (cdr (member "--" sb-ext:*posix-argv*
-                                                     :test #'string=)))
+                               (setf sb-ext:*posix-argv*
+                                     (delete "--" sb-ext:*posix-argv*
+                                             :test #'string= :count 1))
                                (${main}))
                              :purify t))
       '';
@@ -552,10 +552,9 @@ let
                               ;; Filter out everything prior to the `--` we
                               ;; insert in the wrapper to prevent SBCL from
                               ;; parsing arguments at startup
-                              (replace ccl:*command-line-argument-list*
-                                       (cdr (member "--"
-                                                    ccl:*command-line-argument-list*
-                                                    :test #'string=)))
+                              (setf ccl:*command-line-argument-list*
+                                    (delete "--" ccl:*command-line-argument-list*
+                                                 :test #'string= :count 1))
                               (${main}))
                             :mode #o755
                             ;; TODO(sterni): use :native t on macOS