1 | #+TITLE: Notes Packaging ABCL for Distribution |
---|
2 | |
---|
3 | |
---|
4 | * abcl-aio |
---|
5 | |
---|
6 | The standard ABCL build process as described in the ~build.xml~ file |
---|
7 | and executed by the Ant build tool results in two artifacts: |
---|
8 | ~abcl.jar~ and ~abcl-contrib.jar~. ~abcl.jar~ contains all the Java |
---|
9 | and Common Lisp code necessary that constitute the ANSI conforming |
---|
10 | implementation runtime. The ~abcl-contrib.jar~ (aka "contrib") |
---|
11 | artifact contains additional Common Lisp-only code that extends the |
---|
12 | implementation in useful manners. |
---|
13 | |
---|
14 | We create two separate jar artifacts in order to: |
---|
15 | |
---|
16 | 1. To place an upper bound of size of ~abcl.jar~ regardless of what we |
---|
17 | package in ~abcl-contrib.jar~. |
---|
18 | |
---|
19 | 2. Clearly mark which parts of the code-base are covered under |
---|
20 | GPLv2+classpath from those that may have other licensing terms. By |
---|
21 | making the loading of "contrib" a dynamic operation, we defer |
---|
22 | possible infringement to the User who redistributes the resulting |
---|
23 | jar artifact. |
---|
24 | |
---|
25 | Users often want to simply package both artifacts in a single jar for |
---|
26 | deployment convenience. abcl-1.5.0 introduced the build machinery to |
---|
27 | create such an "all-in-one" artifact via the [[https://github.com/armedbear/abcl/blob/master/build.xml#L517][~abcl-aio.jar~]] target. |
---|
28 | Upon invoking the ~abcl-aio.jar~ target |
---|
29 | |
---|
30 | #+begin_src shell |
---|
31 | ant -f build.xml abcl-aio.jar |
---|
32 | #+end_src |
---|
33 | |
---|
34 | the resulting artifact contains both the core implementation and the |
---|
35 | ABCL contrib which may be run as usual via |
---|
36 | #+begin_src shell |
---|
37 | java -jar dist/abcl-aio.jar |
---|
38 | #+end_src |
---|
39 | |
---|
40 | * abcl-jar contrib |
---|
41 | |
---|
42 | The ABCL-JAR contrib provides a mechanism for package ASDF systems and |
---|
43 | their recursive dependencies in a jar archive. |
---|
44 | |
---|
45 | An example of using this to package the CL-PPCRE system from Quicklisp |
---|
46 | |
---|
47 | #+begin_src lisp |
---|
48 | ;; |
---|
49 | (require :abcl-contrib) |
---|
50 | (require :quicklisp-abcl) |
---|
51 | (ql:quickload :cl-ppcre) |
---|
52 | |
---|
53 | (require :asdf-jar) |
---|
54 | (asdf-jar:package :cl-ppcre) |
---|
55 | #+end_src |
---|
56 | |
---|
57 | results in a jar archive at something like |
---|
58 | ~#P"/var/tmp/cl-ppcre-all-2.1.1.jar"~. |
---|
59 | |
---|
60 | This jar archive may be loaded in a version of the implementation via |
---|
61 | |
---|
62 | #+begin_src lisp |
---|
63 | (require :abcl-contrib) |
---|
64 | (require :asdf-jar) |
---|
65 | (setf *load-verbose* t) ;; so we can verify where the load is coming from |
---|
66 | (asdf-jar:add-to-asdf #P"/var/tmp/cl-ppcre-all-2.1.1.jar") |
---|
67 | (asdf:load-system :cl-ppcre) |
---|
68 | #+end_src |
---|
69 | |
---|
70 | =asdf-jar= uses all items declared in the ASDF definitions so it won't |
---|
71 | work well for: |
---|
72 | |
---|
73 | 1. An ASDF system which depends on artifacts that are not declared as |
---|
74 | existing on the file-system via an explicit reference within the |
---|
75 | ASDF source reference mechanism. |
---|
76 | |
---|
77 | 2. Libraries such as CFFI which depend on items to be have been make |
---|
78 | available via an operating system packaging mechanism. |
---|
79 | |
---|
80 | * Current hack |
---|
81 | |
---|
82 | Ideally, we would like allow the AIO mechanism to include additional |
---|
83 | ASDF systems in the single jar artifact. |
---|
84 | |
---|
85 | Currently one can hack this together by: |
---|
86 | |
---|
87 | 1. Manually extracting the ~abcl-aio.jar~ artifact to a file-system. |
---|
88 | |
---|
89 | 2. Placing the necessary ASDF systems in the resulting "contrib" |
---|
90 | directory. |
---|
91 | |
---|
92 | 3. Recreating the single archive from the file-system contents. |
---|
93 | |
---|
94 | * TODO Future directions |
---|
95 | |
---|
96 | Obviously, we could packaging ABCL applications as single archives |
---|
97 | much more convenient. Rather than mucking around in the Ant build |
---|
98 | system, I would rather that we add the necessary machinery |
---|
99 | =ABCL-BUILD= contrib as it will make customization much easier for |
---|
100 | those who know Common Lisp. |
---|
101 | |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | * Colophon |
---|
106 | #+begin_example |
---|
107 | Mark <evenson.not.org@gmail.com> |
---|
108 | Created: <2019-11-25 Mon> |
---|
109 | Revised: <2019-11-25 Mon 14:07> |
---|
110 | #+end_example |
---|
111 | |
---|
112 | |
---|
113 | |
---|