From b57854e24df1f5a72369b44345219f650227ad53 Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 29 Jan 2022 13:59:24 +0100 Subject: fix(nix/buildLisp): make uiop:argv0 work also for ccl and sbcl Detection is broken there, too, as UIOP relies on setting the variable before dumping the image in its portability wrapper dump-image which we don't use at all. Change-Id: If7bea5a8522a2e64707b1ee88d62d420bd00a952 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5112 Tested-by: BuildkiteCI Reviewed-by: grfn --- nix/buildLisp/tests/argv0.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 nix/buildLisp/tests/argv0.nix (limited to 'nix/buildLisp/tests') diff --git a/nix/buildLisp/tests/argv0.nix b/nix/buildLisp/tests/argv0.nix new file mode 100644 index 000000000000..bc29337d06cd --- /dev/null +++ b/nix/buildLisp/tests/argv0.nix @@ -0,0 +1,36 @@ +{ depot, pkgs, ... }: + +depot.nix.buildLisp.program { + name = "argv0-test"; + + srcs = [ + (pkgs.writeText "argv0-test.lisp" '' + (defpackage :argv0-test (:use :common-lisp :uiop) (:export :main)) + (in-package :argv0-test) + + (defun main () + (format t "~A~%" (uiop:argv0))) + '') + ]; + + deps = [ + { + sbcl = depot.nix.buildLisp.bundled "uiop"; + default = depot.nix.buildLisp.bundled "asdf"; + } + ]; + + passthru.meta.ci = { + extraSteps.verify = { + label = "verify argv[0] output"; + needsOutput = true; + command = pkgs.writeShellScript "check-argv0" '' + set -eux + + for invocation in "$(pwd)/result/bin/argv0-test" "./result/bin/argv0-test"; do + test "$invocation" = "$("$invocation")" + done + ''; + }; + }; +} -- cgit 1.4.1