slyrus / abcl

Armed Bear Common Lisp
Other
25 stars 4 forks source link

Creating deliverables using ASDFv3 bundle operations #4

Open hraban opened 11 months ago

hraban commented 11 months ago

There are a few ASDFv3 build operations which seem under ABCL to either be NOPs or cause full errors.

Example:

hello.asd:

  (asdf:defsystem "hello"
    :entry-point "hello:main"
    :components ((:file "main")))

main.lisp:

(defpackage :hello
  (:use :cl)
  (:export main))

(in-package :hello)

(defun main (&rest args)
  (format T "Hello, world~%"))

Execute:

CL_SOURCE_REGISTRY=$PWD abcl --noinit --nosystem --batch --eval '(require "asdf")' --eval '(asdf:operate '\''asdf:program-op "hello")'

Expected result: a binary (or a .jar, or some kind of build output?) in ~/.cache/common-lisp/...

Observed result:

Failed to introspect virtual threading methods: java.lang.reflect.InvocationTargetException
Armed Bear Common Lisp 1.9.2
Java 19.0.2 Azul Systems, Inc.
OpenJDK 64-Bit Server VM
Low-level initialization completed in 0.084 seconds.
Startup completed in 0.405 seconds.
; Compiling /private/tmp/hello/main.lisp ...
; (DEFPACKAGE :HELLO ...)
; (IN-PACKAGE :HELLO)
; (DEFUN MAIN ...)
; in (DEFUN MAIN ...)

; Caught STYLE-WARNING:
;   The variable ARGS is defined but never used.

; Wrote /Users/user/.cache/common-lisp/abcl-1.9.2-fasl43-macosx-arm64/private/tmp/hello/main-tmpJOXJUEIU.abcl (0.032 seconds)
; Caught COMPILE-WARNED-WARNING:
;   Lisp compilation had style-warnings while compiling #<ASDF/LISP-ACTION:CL-SOURCE-FILE "hello" "main">

; Compilation unit finished
;   Caught 1 WARNING condition
;   Caught 1 STYLE-WARNING condition

Caught UIOP/UTILITY:NOT-IMPLEMENTED-ERROR while processing --eval option "(asdf:operate 'asdf:program-op "hello")":
  #<NOT-IMPLEMENTED-ERROR {5158C4AB}>

I can find sundry articles online about bundling as .jar files or even as stand-alone executable using ABCL, but I'd expect this functionality to somehow be exposed to ASDF as one of the bundle operations.

Should ABCL support this in some way or another?