From 62fa36c9c2ef79b9b2aefaec8eac71665de45847 Mon Sep 17 00:00:00 2001 From: sterni Date: Sun, 12 Sep 2021 13:19:19 +0200 Subject: fix(nix/buildLisp): preserve argv[0] in buildLisp.program MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- nix/buildLisp/default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'nix/buildLisp') 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 -- cgit 1.4.1