fix(nix/buildLisp): preserve argv[0] in buildLisp.program

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>
This commit is contained in:
sterni 2021-09-12 13:19:19 +02:00
parent e507b84291
commit 62fa36c9c2

View file

@ -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