2

I'm working on a project in Common Lisp that uses GPGME for encryption. GPGME is installed from my distribution's repositories.

The following code works correctly when running in the repl, or if I load the file with --load and --eval '(main)' --eval '(exit)' from the command line, but when I build an executable with sbcl --load gpgme-test.lisp --eval "(sb-ext:save-lisp-and-die #p\"test\" :toplevel #'main :executable t)", I get GPGME returned error: Not operational (Unspecified source) when running the executable.

(eval-when (:compile-toplevel)
  (ql:quickload :gpgme))

(require 'gpgme)

(defun main ()
  (gpgme:with-context (ctx)
    (print (gpgme:get-key ctx "<id here>"))))

I'm building the executable with sbcl's --save-lisp-and-die option. I've also tried building the full project using Deploy with the same results.

  • Did you try with an .asd system definition, defining your gpgme dependency there instead of inside your source with eval-when…ql:quickload ? – Ehvince May 01 '23 at 21:32
  • @Ehvince yes. This is just the minimal working example, the full program has the asd file. – inventor500 May 06 '23 at 03:58
  • I am keen to try with the .asd definition. BTW, where is this CL's library project page? – Ehvince May 08 '23 at 11:17
  • 1
    The lisp bindings are part of the normal GPGME project. The repo is available at https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=summary, and the CL related stuff is in lang/cl in the repository. Other than the README file, I have found no documentation for this. – inventor500 May 10 '23 at 11:42

0 Answers0