I found the root cause of my issue:
cl-dbi will quickload a DB driver dependency on the fly if it doesn't find it.
It calls ql-dist:installed-p, which calls ASDF which errors out.
The real error message was hiding behind ASDF's one.

I had to reference dbd-sqlite3 into my dependencies… as simple as that.

To find out, I had to instrument my code, to grep for "asdf" and "quicklisp" in the suspected dependencies,
to prevent cl-dbi from doing this (in that case, (delete :quicklisp *features*)),
and finally I saw the real error message.

Of course, I already have encountered this issue.

Finally all is well, but I still tend to think ASDF should not have errored out here.
I couldn't get my deploy:deployed-app test to work but it *might* be a good idea.

Best,




Le 29/08/2024 à 18:15, vindarel a écrit :
Hi everyone,

I built a binary, I run it on my server but I get an ASDF error:

;; Error while trying to load definition for system asdf from pathname
;; /home/vince/common-lisp/asdf/asdf.asd:
;; couldn't load #P"/home/vince/common-lisp/asdf/asdf.asd": file does not exist.


and my binary exits with an error code.
ASDF looks for itself on the ~/common-lisp/ directory, which doesn't exist on my VPS, as expected.


Do I have a way to tell ASDF to not do this, so that my binary can run?


Actually my script doesn't exit right away, it does something, then exits. So, something in my program or in my dependencies are asking this operation to ASDF, when probably it shouldn't.
I'm trying to figure it out.
However if there was an easy way to gently ask ASDF not to fail, that would be a bliss.

Thanks in advance!


More details…


---

I tried one thing.

First, let's show you my .asd declaration.

(in-package :asdf-user)
(defsystem "observatoire"
  :version "0"
  :depends-on (:ciel
               :secret-values
               :progressons
               )
  :components ((:module "src"
                :components
                ((:file "packages")
                 (:file "common")
                 (:file "extractor")
                 (:file "stock")
                 (:file "ventes")
                 (:file "observatoire"))))
  :build-operation "program-op"
  :build-pathname "observatoire"
  :entry-point "observatoire::main"
  )

I built the binary with asdf:make.

I tried adding these lines at the end of the .asd:

#+asdf (asdf:clear-source-registry)
#+asdf (defun asdf:upgrade-asdf () nil)

This did not help, now I get:

There is no applicable method for the generic function
#<STANDARD-GENERIC-FUNCTION QL-DIST:INSTALLEDP (3)>
when called with arguments (NIL)


I had the same issue before, which I bypassed by using Deploy and a hook, containing those two lines:

(deploy:define-hook (:deploy asdf) (directory)
  (declare (ignorable directory))
  #+asdf (asdf:clear-source-registry)
  #+asdf (defun asdf:upgrade-asdf () NIL))


but unsurprisingly it doesn't help either.

---


I see that ASDF is signaling a load-system-definition-error condition.
Without knowing the root cause, I don't think handling it would help.

I'll try to avoid the error:

;; ASDF, find-system.lisp
#'(lambda (condition)
               (if (uiop:symbol-call :deploy :deployed-p)                  ;; added
                   (warn "asdf: ignoring load-system-definition-error~&")  ;; added
                   (error 'load-system-definition-error
                          :name (coerce-name s) :pathname pathname :condition condition)))

Here, we use Deploy's (deploy:deployed-p) that tells us when the binary is running.
It could be another flag.
I'll try and see…



Thanks for any pointers,
Best regards,

Vincent
@vindarel


SBCL 2.1.5
ASDF "3.3.4.15" on my development machine